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
  • Field Details

  • Method Details

    • getInstance

      public static Digipeater 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

      public static String 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

      public void setSupplementalTxIGateFilterExpression(String suppFilterExpr) throws ParseException
      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

      public int addToBlacklist(String callsign)
      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

      public int updateBlacklist(String callsign)
      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

      public Digipeater.BlacklistMask getBlacklist(String callsign)
      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

      public int removeFromBlacklist(String callsign)
      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

      public boolean isBlacklisted(String callsign)
      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

      public boolean isBlacklisted(String callsign, int reasonMask)
      Test if the specified callsign is on the blacklist for a specific reason.
      Parameters:
      callsign - String callsign to test
      reasonMask - 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

      public void rememberLocallyOriginatedMessage(AX25Frame frame)
      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

      public void aprsMessageReceived(Message msg)
      DO NOT CALL. Listener to deliver APRS packets to the Digipeater.
      Specified by:
      aprsMessageReceived in interface AprsMessageListener
      Parameters:
      msg - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
      See Also:
    • consumeAX25Frame

      public void consumeAX25Frame(AX25Frame frame, Connector connector)
      DO NOT CALL. Listener to deliver AX.25 frames to the Digipeater.
      Specified by:
      consumeAX25Frame in interface AX25FrameListener
      Parameters:
      frame - AX25Frame to consider digipeating
      connector - Connector that frame was received from
    • parsedAX25MessageReceived

      public void parsedAX25MessageReceived(byte pid, AX25Message msg)
      Delivers the next message received by YAAC that is some sort of parsed AX.25 higher-level message.
      Specified by:
      parsedAX25MessageReceived in interface ParsedAX25MessageListener
      Parameters:
      pid - AX.25 protocol ID
      msg - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
      See Also:
    • addDuplicateCheckedAX25Listener

      public void addDuplicateCheckedAX25Listener(DuplicateCheckedAX25Listener l)
      Register a listener to be informed of receipt of AX25Messages who wants to know if the frame is a duplicate.
      Parameters:
      l - DuplicateCheckedAX25Listener
    • removeDuplicateCheckedAX25Listener

      public void removeDuplicateCheckedAX25Listener(DuplicateCheckedAX25Listener l)
      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

      public void addTXIGatedStationStatusListener(Digipeater.TXIGatedStationStatusListener l)
      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

      public void removeTXIGatedStationStatusListener(Digipeater.TXIGatedStationStatusListener l)
      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