mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-02-19 22:57:40 +00:00
Compare commits
No commits in common. "4b0a0668a574d42f50803a8ff43071e511976413" and "465695b9ae8eb5c1e16c26026c580d31b3b0f4f6" have entirely different histories.
4b0a0668a5
...
465695b9ae
@ -35,7 +35,6 @@ Pull requests have a high chance of being accepted if they are:
|
|||||||
- In alignment with the [Roadmap](./Roadmap.md) or solve an open issue or feature request
|
- In alignment with the [Roadmap](./Roadmap.md) or solve an open issue or feature request
|
||||||
- Sufficiently tested to work with all API functions, and pass the standard test suite
|
- Sufficiently tested to work with all API functions, and pass the standard test suite
|
||||||
- Functionally and conceptually complete and well-designed
|
- Functionally and conceptually complete and well-designed
|
||||||
- Not simply formatting or code style changes
|
|
||||||
- Well-documented
|
- Well-documented
|
||||||
|
|
||||||
Even new ideas and proposals that have not been approved by a maintainer, or fall outside the established roadmap, are *occasionally* accepted - if they possess the remaining of the above qualities. If not, they will be closed and removed without comments or explanation.
|
Even new ideas and proposals that have not been approved by a maintainer, or fall outside the established roadmap, are *occasionally* accepted - if they possess the remaining of the above qualities. If not, they will be closed and removed without comments or explanation.
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
# of the packet. #
|
# of the packet. #
|
||||||
##########################################################
|
##########################################################
|
||||||
|
|
||||||
import os
|
|
||||||
import argparse
|
import argparse
|
||||||
import RNS
|
import RNS
|
||||||
|
|
||||||
@ -28,19 +27,8 @@ def server(configpath):
|
|||||||
# We must first initialise Reticulum
|
# We must first initialise Reticulum
|
||||||
reticulum = RNS.Reticulum(configpath)
|
reticulum = RNS.Reticulum(configpath)
|
||||||
|
|
||||||
# Load identity from file if it exist or randomley create
|
# Randomly create a new identity for our echo server
|
||||||
if configpath:
|
server_identity = RNS.Identity()
|
||||||
ifilepath = "%s/storage/identitiesy/%s" % (configpath,APP_NAME)
|
|
||||||
else:
|
|
||||||
ifilepath = "%s/storage/identities/%s" % (RNS.Reticulum.configdir,APP_NAME)
|
|
||||||
if os.path.exists(ifilepath):
|
|
||||||
# Load identity from file
|
|
||||||
server_identity = RNS.Identity.from_file(ifilepath)
|
|
||||||
RNS.log("loaded identity from file: "+ifilepath, RNS.LOG_VERBOSE)
|
|
||||||
else:
|
|
||||||
# Randomly create a new identity for our echo example
|
|
||||||
server_identity = RNS.Identity()
|
|
||||||
RNS.log("created new identity", RNS.LOG_VERBOSE)
|
|
||||||
|
|
||||||
# We create a destination that clients can query. We want
|
# We create a destination that clients can query. We want
|
||||||
# to be able to verify echo replies to our clients, so we
|
# to be able to verify echo replies to our clients, so we
|
||||||
@ -340,4 +328,4 @@ if __name__ == "__main__":
|
|||||||
client(args.destination, configarg, timeout=timeoutarg)
|
client(args.destination, configarg, timeout=timeoutarg)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("")
|
print("")
|
||||||
exit()
|
exit()
|
@ -28,20 +28,8 @@ def server(configpath):
|
|||||||
# We must first initialise Reticulum
|
# We must first initialise Reticulum
|
||||||
reticulum = RNS.Reticulum(configpath)
|
reticulum = RNS.Reticulum(configpath)
|
||||||
|
|
||||||
# Load identity from file if it exist or randomley create
|
# Randomly create a new identity for our link example
|
||||||
if configpath:
|
server_identity = RNS.Identity()
|
||||||
ifilepath = "%s/storage/identitiesy/%s" % (configpath,APP_NAME)
|
|
||||||
else:
|
|
||||||
ifilepath = "%s/storage/identities/%s" % (RNS.Reticulum.configdir,APP_NAME)
|
|
||||||
RNS.log("ifilepath: %s" % ifilepath)
|
|
||||||
if os.path.exists(ifilepath):
|
|
||||||
# Load identity from file
|
|
||||||
server_identity = RNS.Identity.from_file(ifilepath)
|
|
||||||
RNS.log("loaded identity from file: "+ifilepath, RNS.LOG_VERBOSE)
|
|
||||||
else:
|
|
||||||
# Randomly create a new identity for our link example
|
|
||||||
server_identity = RNS.Identity()
|
|
||||||
RNS.log("created new identity", RNS.LOG_VERBOSE)
|
|
||||||
|
|
||||||
# We create a destination that clients can connect to. We
|
# We create a destination that clients can connect to. We
|
||||||
# want clients to create links to this destination, so we
|
# want clients to create links to this destination, so we
|
||||||
@ -300,4 +288,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("")
|
print("")
|
||||||
exit()
|
exit()
|
@ -43,9 +43,6 @@ class AutoInterface(Interface):
|
|||||||
SCOPE_ORGANISATION = "8"
|
SCOPE_ORGANISATION = "8"
|
||||||
SCOPE_GLOBAL = "e"
|
SCOPE_GLOBAL = "e"
|
||||||
|
|
||||||
MULTICAST_PERMANENT_ADDRESS_TYPE = "0"
|
|
||||||
MULTICAST_TEMPORARY_ADDRESS_TYPE = "1"
|
|
||||||
|
|
||||||
PEERING_TIMEOUT = 7.5
|
PEERING_TIMEOUT = 7.5
|
||||||
|
|
||||||
ALL_IGNORE_IFS = ["lo0"]
|
ALL_IGNORE_IFS = ["lo0"]
|
||||||
@ -77,7 +74,7 @@ class AutoInterface(Interface):
|
|||||||
ifas = self.netinfo.ifaddresses(ifname)
|
ifas = self.netinfo.ifaddresses(ifname)
|
||||||
return ifas
|
return ifas
|
||||||
|
|
||||||
def __init__(self, owner, name, group_id=None, discovery_scope=None, discovery_port=None, multicast_address_type=None, data_port=None, allowed_interfaces=None, ignored_interfaces=None, configured_bitrate=None):
|
def __init__(self, owner, name, group_id=None, discovery_scope=None, discovery_port=None, data_port=None, allowed_interfaces=None, ignored_interfaces=None, configured_bitrate=None):
|
||||||
from RNS.vendor.ifaddr import niwrapper
|
from RNS.vendor.ifaddr import niwrapper
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.netinfo = niwrapper
|
self.netinfo = niwrapper
|
||||||
@ -131,13 +128,6 @@ class AutoInterface(Interface):
|
|||||||
else:
|
else:
|
||||||
self.discovery_port = discovery_port
|
self.discovery_port = discovery_port
|
||||||
|
|
||||||
if multicast_address_type == None:
|
|
||||||
self.multicast_address_type = AutoInterface.MULTICAST_TEMPORARY_ADDRESS_TYPE
|
|
||||||
elif str(multicast_address_type).lower() == "temporary":
|
|
||||||
self.multicast_address_type = AutoInterface.MULTICAST_TEMPORARY_ADDRESS_TYPE
|
|
||||||
elif str(multicast_address_type).lower() == "permanent":
|
|
||||||
self.multicast_address_type = AutoInterface.MULTICAST_PERMANENT_ADDRESS_TYPE
|
|
||||||
|
|
||||||
if data_port == None:
|
if data_port == None:
|
||||||
self.data_port = AutoInterface.DEFAULT_DATA_PORT
|
self.data_port = AutoInterface.DEFAULT_DATA_PORT
|
||||||
else:
|
else:
|
||||||
@ -166,7 +156,7 @@ class AutoInterface(Interface):
|
|||||||
gt += ":"+"{:02x}".format(g[9]+(g[8]<<8))
|
gt += ":"+"{:02x}".format(g[9]+(g[8]<<8))
|
||||||
gt += ":"+"{:02x}".format(g[11]+(g[10]<<8))
|
gt += ":"+"{:02x}".format(g[11]+(g[10]<<8))
|
||||||
gt += ":"+"{:02x}".format(g[13]+(g[12]<<8))
|
gt += ":"+"{:02x}".format(g[13]+(g[12]<<8))
|
||||||
self.mcast_discovery_address = "ff"+self.multicast_address_type+self.discovery_scope+":"+gt
|
self.mcast_discovery_address = "ff1"+self.discovery_scope+":"+gt
|
||||||
|
|
||||||
suitable_interfaces = 0
|
suitable_interfaces = 0
|
||||||
for ifname in self.list_interfaces():
|
for ifname in self.list_interfaces():
|
||||||
|
@ -540,7 +540,6 @@ class Reticulum:
|
|||||||
group_id = c["group_id"] if "group_id" in c else None
|
group_id = c["group_id"] if "group_id" in c else None
|
||||||
discovery_scope = c["discovery_scope"] if "discovery_scope" in c else None
|
discovery_scope = c["discovery_scope"] if "discovery_scope" in c else None
|
||||||
discovery_port = int(c["discovery_port"]) if "discovery_port" in c else None
|
discovery_port = int(c["discovery_port"]) if "discovery_port" in c else None
|
||||||
multicast_address_type = c["multicast_address_type"] if "multicast_address_type" in c else None
|
|
||||||
data_port = int(c["data_port"]) if "data_port" in c else None
|
data_port = int(c["data_port"]) if "data_port" in c else None
|
||||||
allowed_interfaces = c.as_list("devices") if "devices" in c else None
|
allowed_interfaces = c.as_list("devices") if "devices" in c else None
|
||||||
ignored_interfaces = c.as_list("ignored_devices") if "ignored_devices" in c else None
|
ignored_interfaces = c.as_list("ignored_devices") if "ignored_devices" in c else None
|
||||||
@ -551,7 +550,6 @@ class Reticulum:
|
|||||||
group_id,
|
group_id,
|
||||||
discovery_scope,
|
discovery_scope,
|
||||||
discovery_port,
|
discovery_port,
|
||||||
multicast_address_type,
|
|
||||||
data_port,
|
data_port,
|
||||||
allowed_interfaces,
|
allowed_interfaces,
|
||||||
ignored_interfaces
|
ignored_interfaces
|
||||||
|
@ -47,12 +47,6 @@ system, which should be enabled by default in almost all OSes.
|
|||||||
|
|
||||||
group_id = reticulum
|
group_id = reticulum
|
||||||
|
|
||||||
# You can also choose the multicast address type:
|
|
||||||
# temporary (default, Temporary Multicast Address)
|
|
||||||
# or permanent (Permanent Multicast Address)
|
|
||||||
|
|
||||||
multicast_address_type = permanent
|
|
||||||
|
|
||||||
# You can also select specifically which
|
# You can also select specifically which
|
||||||
# kernel networking devices to use.
|
# kernel networking devices to use.
|
||||||
|
|
||||||
|
@ -47,12 +47,6 @@ system, which should be enabled by default in almost all OSes.
|
|||||||
|
|
||||||
group_id = reticulum
|
group_id = reticulum
|
||||||
|
|
||||||
# You can also choose the multicast address type:
|
|
||||||
# temporary (default, Temporary Multicast Address)
|
|
||||||
# or permanent (Permanent Multicast Address)
|
|
||||||
|
|
||||||
multicast_address_type = permanent
|
|
||||||
|
|
||||||
# You can also select specifically which
|
# You can also select specifically which
|
||||||
# kernel networking devices to use.
|
# kernel networking devices to use.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user