mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-06-04 13:08:58 -04:00
Added rnpath utility
This commit is contained in:
parent
8436bc5ba3
commit
dc36644a1e
2 changed files with 109 additions and 0 deletions
|
@ -1276,6 +1276,28 @@ class Transport:
|
|||
else:
|
||||
return Transport.PATHFINDER_M
|
||||
|
||||
@staticmethod
|
||||
def next_hop(destination_hash):
|
||||
"""
|
||||
:param destination_hash: A destination hash as *bytes*.
|
||||
:returns: The destination hash as *bytes* for the next hop to the specified destination, or *None* if the next hop is unknown.
|
||||
"""
|
||||
if destination_hash in Transport.destination_table:
|
||||
return Transport.destination_table[destination_hash][1]
|
||||
else:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def next_hop_interface(destination_hash):
|
||||
"""
|
||||
:param destination_hash: A destination hash as *bytes*.
|
||||
:returns: The interface for the next hop to the specified destination, or *None* if the interface is unknown.
|
||||
"""
|
||||
if destination_hash in Transport.destination_table:
|
||||
return Transport.destination_table[destination_hash][5]
|
||||
else:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def request_path(destination_hash):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue