Package org.ka2ddo.yaac.ax25
Class Digipeater
java.lang.Object
org.ka2ddo.yaac.ax25.Digipeater
- All Implemented Interfaces:
AprsMessageListener
,AX25FrameListener
,ParsedAX25MessageListener
public class Digipeater
extends Object
implements AX25FrameListener, AprsMessageListener, ParsedAX25MessageListener
This singleton class/object handles digipeating operations according to the rules for AX.25
digipeating, as modified for APRS to handle I-gating and New-N paradigm digipeat aliases.
- Author:
- Andrew Pavlin, KA2DDO
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class specifying the specific level of blacklisting for a particular callsidn-SSID.static class
Status of stations trying to RF-transmit through this station from the Internet.static interface
Interface for listeners to be informed of changes to the list of Tx I-gated stations. -
Field Summary
Modifier and TypeFieldDescriptionList of callsigns on the sender's blacklist (do not digipeat or I-gate).List of stations currently being forwarded from the Internet to local RF networks by this station. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Register a listener to be informed of receipt of AX25Messages who wants to know if the frame is a duplicate.int
addToBlacklist
(String callsign) Add a callsign to the blacklist.void
Register a listener to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.void
DO NOT CALL.void
consumeAX25Frame
(AX25Frame frame, Connector connector) DO NOT CALL.getBlacklist
(String callsign) Get the blacklist information for a callsign-SSID.int
Report the number of APRS messages forwarded by this station from APRS-IS to RF.static Digipeater
Get the singleton instance of the digipeater logic.static long
Get the maximum age of RF-received messages that will be considered in deciding if a station is local.static int
Get the maximum number of hops to be considered a "local" station.static String
Get the current supplemental Tx I-Gate filter expression.boolean
Reports if HF packets without digipeat paths may be retransmitted through VHF RF ports.boolean
isBlacklisted
(String callsign) Test if the specified callsign is on the blacklist.boolean
isBlacklisted
(String callsign, int reasonMask) Test if the specified callsign is on the blacklist for a specific reason.boolean
Reports if RF-to-IP packet gating is allowed.boolean
Reports if IP-to-RF packet gating is allowed.void
parsedAX25MessageReceived
(byte pid, AX25Message msg) Delivers the next message received by YAAC that is some sort of parsed AX.25 higher-level message.void
Record in the short-term memory that the specified frame has been locally originated by this station and should not be digipeated again.void
Unregister a listener who no longer wants to be informed of receipt of AX25Messages.int
removeFromBlacklist
(String callsign) Remove a callsign from the blacklist.void
Unregister a listener who no longer want to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.void
setAllowVirtualDigipeatsForHF
(boolean allowVirtualDigipeatsForHF) Specifies if HF packets without digipeat paths may be retransmitted through VHF RF ports.void
setDoRxIGate
(boolean doRxIGate) Specify if RF-to-IP packet gating is allowed.void
setDoTxIGate
(boolean doTxIGate) Specify if IP-to-RF packet gating is allowed.static void
setMaxAgeForLocal
(long maxAgeForLocal) Set the maximum age of RF-received messages that will be considered in deciding if a station is local.static void
setMaxHopsForLocal
(int maxHopsForLocal) Set the maximum number of hops to be considered a "local" station.void
setSupplementalTxIGateFilterExpression
(String suppFilterExpr) Set the current supplemental Tx I-Gate filter expression.int
updateBlacklist
(String callsign) Update the persisted blackist settings for a callsign.
-
Field Details
-
listOfTXIGatedStations
List of stations currently being forwarded from the Internet to local RF networks by this station. -
listOfBlacklistedStations
List of callsigns on the sender's blacklist (do not digipeat or I-gate).
-
-
Method Details
-
getInstance
Get the singleton instance of the digipeater logic.- Returns:
- Digipeater instance
-
isDoRxIGate
public boolean isDoRxIGate()Reports if RF-to-IP packet gating is allowed.- Returns:
- boolean true if RF-to-IP packet gating is allowed
-
setDoRxIGate
public void setDoRxIGate(boolean doRxIGate) Specify if RF-to-IP packet gating is allowed.- Parameters:
doRxIGate
- boolean true if RF-to-IP packet gating is allowed
-
isDoTxIGate
public boolean isDoTxIGate()Reports if IP-to-RF packet gating is allowed.- Returns:
- boolean true if IP-to-RF packet gating is allowed
-
setDoTxIGate
public void setDoTxIGate(boolean doTxIGate) Specify if IP-to-RF packet gating is allowed.- Parameters:
doTxIGate
- boolean true if IP-to-RF packet gating is allowed
-
isAllowVirtualDigipeatsForHF
public boolean isAllowVirtualDigipeatsForHF()Reports if HF packets without digipeat paths may be retransmitted through VHF RF ports.- Returns:
- boolean true if HF-to-VHF virtual digipeat is allowed
-
setAllowVirtualDigipeatsForHF
public void setAllowVirtualDigipeatsForHF(boolean allowVirtualDigipeatsForHF) Specifies if HF packets without digipeat paths may be retransmitted through VHF RF ports.- Parameters:
allowVirtualDigipeatsForHF
- boolean true if HF-to-VHF virtual digipeat is allowed
-
getMaxHopsForLocal
public static int getMaxHopsForLocal()Get the maximum number of hops to be considered a "local" station.- Returns:
- maximum hop count where 1 is direct (not digipeated), 2 is digipeated once, etc.
-
setMaxHopsForLocal
public static void setMaxHopsForLocal(int maxHopsForLocal) Set the maximum number of hops to be considered a "local" station.- Parameters:
maxHopsForLocal
- maximum hop count where 1 is direct (not digipeated), 2 is digipeated once, etc.
-
getMaxAgeForLocal
public static long getMaxAgeForLocal()Get the maximum age of RF-received messages that will be considered in deciding if a station is local.- Returns:
- maximum acceptable age in milliseconds
-
setMaxAgeForLocal
public static void setMaxAgeForLocal(long maxAgeForLocal) Set the maximum age of RF-received messages that will be considered in deciding if a station is local.- Parameters:
maxAgeForLocal
- maximum acceptable age in milliseconds
-
getSupplementalTxIGateFilterExpression
Get the current supplemental Tx I-Gate filter expression.- Returns:
- String of filter expression, or null if not authorizing extra Tx I-Gate traffic
-
setSupplementalTxIGateFilterExpression
Set the current supplemental Tx I-Gate filter expression.- Parameters:
suppFilterExpr
- String of filter expression, or null if not authorizing extra Tx I-Gate traffic- Throws:
ParseException
- if filter expression has a syntax error or is otherwise undecodeable
-
addToBlacklist
Add a callsign to the blacklist.- Parameters:
callsign
- String of callsign- Returns:
- index of list where callsign was added, or -1 if callsign was already on list
-
updateBlacklist
Update the persisted blackist settings for a callsign.- Parameters:
callsign
- String of callsign- Returns:
- index of list where callsign was updated, or -1 if callsign wasn't on list
-
getBlacklist
Get the blacklist information for a callsign-SSID.- Parameters:
callsign
- String callsign-SSID of the station to check for blacklist info- Returns:
- BlacklistMask for the callsign-SSID, or null if not blacklisted
-
removeFromBlacklist
Remove a callsign from the blacklist.- Parameters:
callsign
- String of callsign- Returns:
- index of list where callsign was removed, or -1 if callsign wasn't on list
-
isBlacklisted
Test if the specified callsign is on the blacklist.- Parameters:
callsign
- String callsign to test- Returns:
- boolean true if the callsign is on the blacklist for any reason
-
isBlacklisted
Test if the specified callsign is on the blacklist for a specific reason.- Parameters:
callsign
- String callsign to testreasonMask
- int bitmask of reason why this station should not be processed- Returns:
- boolean true if the callsign is on the blacklist for any reason
- See Also:
-
rememberLocallyOriginatedMessage
Record in the short-term memory that the specified frame has been locally originated by this station and should not be digipeated again.- Parameters:
frame
- AX25Frame to be remembered
-
aprsMessageReceived
DO NOT CALL. Listener to deliver APRS packets to the Digipeater.- Specified by:
aprsMessageReceived
in interfaceAprsMessageListener
- Parameters:
msg
- some subclass of Message containing the message contents; the message should have an AX25Frame connected to it- See Also:
-
consumeAX25Frame
DO NOT CALL. Listener to deliver AX.25 frames to the Digipeater.- Specified by:
consumeAX25Frame
in interfaceAX25FrameListener
- Parameters:
frame
- AX25Frame to consider digipeatingconnector
- Connector that frame was received from
-
parsedAX25MessageReceived
Delivers the next message received by YAAC that is some sort of parsed AX.25 higher-level message.- Specified by:
parsedAX25MessageReceived
in interfaceParsedAX25MessageListener
- Parameters:
pid
- AX.25 protocol IDmsg
- some subclass of Message containing the message contents; the message should have an AX25Frame connected to it- See Also:
-
addDuplicateCheckedAX25Listener
Register a listener to be informed of receipt of AX25Messages who wants to know if the frame is a duplicate.- Parameters:
l
- DuplicateCheckedAX25Listener
-
removeDuplicateCheckedAX25Listener
Unregister a listener who no longer wants to be informed of receipt of AX25Messages.- Parameters:
l
- DuplicateCheckedAX25Listener
-
getCountDigiFromIgateToRf
public int getCountDigiFromIgateToRf()Report the number of APRS messages forwarded by this station from APRS-IS to RF.- Returns:
- forwarded message count
-
addTXIGatedStationStatusListener
Register a listener to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.- Parameters:
l
- TXIGatedStationStatusListener
-
removeTXIGatedStationStatusListener
Unregister a listener who no longer want to be informed when a station is added, updated, or removed from the list of stations that this station will Tx I-gate to.- Parameters:
l
- TXIGatedStationStatusListener
-