rns 1.3.3__tar.gz → 1.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. {rns-1.3.3 → rns-1.3.4}/PKG-INFO +1 -1
  2. {rns-1.3.3 → rns-1.3.4}/RNS/Identity.py +7 -0
  3. {rns-1.3.3 → rns-1.3.4}/RNS/Reticulum.py +74 -67
  4. {rns-1.3.3 → rns-1.3.4}/RNS/Transport.py +1 -1
  5. rns-1.3.4/RNS/_version.py +1 -0
  6. {rns-1.3.3 → rns-1.3.4}/rns.egg-info/PKG-INFO +1 -1
  7. rns-1.3.3/RNS/_version.py +0 -1
  8. {rns-1.3.3 → rns-1.3.4}/CRNS/__init__.py +0 -0
  9. {rns-1.3.3 → rns-1.3.4}/README.md +0 -0
  10. {rns-1.3.3 → rns-1.3.4}/RNS/Buffer.py +0 -0
  11. {rns-1.3.3 → rns-1.3.4}/RNS/Channel.py +0 -0
  12. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/AES.py +0 -0
  13. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/Ed25519.py +0 -0
  14. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/HKDF.py +0 -0
  15. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/HMAC.py +0 -0
  16. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/Hashes.py +0 -0
  17. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/PKCS7.py +0 -0
  18. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/Provider.py +0 -0
  19. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/Proxies.py +0 -0
  20. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/SHA256.py +0 -0
  21. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/SHA512.py +0 -0
  22. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/Token.py +0 -0
  23. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/X25519.py +0 -0
  24. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/__init__.py +0 -0
  25. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/aes/__init__.py +0 -0
  26. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/aes/aes128.py +0 -0
  27. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/aes/aes256.py +0 -0
  28. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/pure25519/__init__.py +0 -0
  29. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/pure25519/_ed25519.py +0 -0
  30. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/pure25519/basic.py +0 -0
  31. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/pure25519/ed25519_oop.py +0 -0
  32. {rns-1.3.3 → rns-1.3.4}/RNS/Cryptography/pure25519/eddsa.py +0 -0
  33. {rns-1.3.3 → rns-1.3.4}/RNS/Destination.py +0 -0
  34. {rns-1.3.3 → rns-1.3.4}/RNS/Discovery.py +0 -0
  35. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/AX25KISSInterface.py +0 -0
  36. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/Android/KISSInterface.py +0 -0
  37. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/Android/RNodeInterface.py +0 -0
  38. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/Android/SerialInterface.py +0 -0
  39. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/Android/__init__.py +0 -0
  40. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/AutoInterface.py +0 -0
  41. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/BackboneInterface.py +0 -0
  42. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/I2PInterface.py +0 -0
  43. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/Interface.py +0 -0
  44. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/KISSInterface.py +0 -0
  45. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/LocalInterface.py +0 -0
  46. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/PipeInterface.py +0 -0
  47. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/RNodeInterface.py +0 -0
  48. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/RNodeMultiInterface.py +0 -0
  49. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/SerialInterface.py +0 -0
  50. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/TCPInterface.py +0 -0
  51. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/UDPInterface.py +0 -0
  52. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/WeaveInterface.py +0 -0
  53. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/__init__.py +0 -0
  54. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/util/__init__.py +0 -0
  55. {rns-1.3.3 → rns-1.3.4}/RNS/Interfaces/util/netinfo.py +0 -0
  56. {rns-1.3.3 → rns-1.3.4}/RNS/Link.py +0 -0
  57. {rns-1.3.3 → rns-1.3.4}/RNS/Packet.py +0 -0
  58. {rns-1.3.3 → rns-1.3.4}/RNS/Resolver.py +0 -0
  59. {rns-1.3.3 → rns-1.3.4}/RNS/Resource.py +0 -0
  60. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/__init__.py +0 -0
  61. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rncp.py +0 -0
  62. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/__init__.py +0 -0
  63. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/client.py +0 -0
  64. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/commitsigs.py +0 -0
  65. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/highlight.py +0 -0
  66. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/main.py +0 -0
  67. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/pages.py +0 -0
  68. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/server.py +0 -0
  69. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rngit/util.py +0 -0
  70. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnid.py +0 -0
  71. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnir.py +0 -0
  72. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnodeconf.py +0 -0
  73. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnpath.py +0 -0
  74. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnpkg.py +0 -0
  75. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnprobe.py +0 -0
  76. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsd.py +0 -0
  77. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/__init__.py +0 -0
  78. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/_version.py +0 -0
  79. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/args.py +0 -0
  80. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/exception.py +0 -0
  81. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/helpers.py +0 -0
  82. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/initiator.py +0 -0
  83. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/listener.py +0 -0
  84. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/loop.py +0 -0
  85. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/process.py +0 -0
  86. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/protocol.py +0 -0
  87. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/retry.py +0 -0
  88. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/rnsh.py +0 -0
  89. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnsh/session.py +0 -0
  90. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnstatus.py +0 -0
  91. {rns-1.3.3 → rns-1.3.4}/RNS/Utilities/rnx.py +0 -0
  92. {rns-1.3.3 → rns-1.3.4}/RNS/__init__.py +0 -0
  93. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/__init__.py +0 -0
  94. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/configobj.py +0 -0
  95. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/__init__.py +0 -0
  96. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/__version__.py +0 -0
  97. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/aiosam.py +0 -0
  98. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/exceptions.py +0 -0
  99. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/log.py +0 -0
  100. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/sam.py +0 -0
  101. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/tunnel.py +0 -0
  102. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/i2plib/utils.py +0 -0
  103. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/platformutils.py +0 -0
  104. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/umsgpack.py +0 -0
  105. {rns-1.3.3 → rns-1.3.4}/RNS/vendor/validate.py +0 -0
  106. {rns-1.3.3 → rns-1.3.4}/rns.egg-info/SOURCES.txt +0 -0
  107. {rns-1.3.3 → rns-1.3.4}/rns.egg-info/dependency_links.txt +0 -0
  108. {rns-1.3.3 → rns-1.3.4}/rns.egg-info/entry_points.txt +0 -0
  109. {rns-1.3.3 → rns-1.3.4}/rns.egg-info/requires.txt +0 -0
  110. {rns-1.3.3 → rns-1.3.4}/rns.egg-info/top_level.txt +0 -0
  111. {rns-1.3.3 → rns-1.3.4}/setup.cfg +0 -0
  112. {rns-1.3.3 → rns-1.3.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rns
3
- Version: 1.3.3
3
+ Version: 1.3.4
4
4
  Summary: Self-configuring, encrypted and resilient mesh networking stack for LoRa, packet radio, WiFi and everything in between
5
5
  Home-page: https://reticulum.network/
6
6
  Author: Mark Qvist
@@ -316,6 +316,7 @@ class Identity:
316
316
  no_path = 0
317
317
  retained = 0
318
318
  never_used = 0
319
+ ratchetdir = RNS.Reticulum.storagepath+"/ratchets"
319
320
 
320
321
  with Identity.known_destinations_lock: destination_hashes = list(Identity.known_destinations.keys())
321
322
  for destination_hash in destination_hashes:
@@ -359,6 +360,12 @@ class Identity:
359
360
  Identity.known_destinations.pop(destination_hash)
360
361
  removed += 1
361
362
 
363
+ try:
364
+ hexhash = RNS.hexrep(destination_hash, delimit=False)
365
+ ratchet_path = f"{ratchetdir}/{hexhash}"
366
+ if os.path.isfile(ratchet_path): os.unlink(ratchet_path)
367
+ except Exception as e: RNS.log(f"Could not clean stale ratchets for {RNS.prettyhexrep(destination_hash)}: {e}", RNS.LOG_WARNING)
368
+
362
369
  # RNS.log(f"Total destinations: {total}, stale: {len(stale)}, removed: {removed}, no path: {no_path}, never used: {never_used}, with path: {total-no_path}, used: {total-never_used}, retained: {retained}. Completed in {RNS.prettyshorttime(time.time()-st)}", RNS.LOG_WARNING) # TODO: Remove
363
370
  if not RNS.Transport.owner.is_connected_to_shared_instance: Identity.save_known_destinations(recombine=False)
364
371
 
@@ -48,6 +48,7 @@ else:
48
48
 
49
49
  from RNS.vendor.configobj import ConfigObj
50
50
  from threading import Lock
51
+ import RNS.vendor.umsgpack as mp
51
52
  import configparser
52
53
  import multiprocessing.connection
53
54
  import importlib.util
@@ -668,6 +669,9 @@ class Reticulum:
668
669
  self.shared_instance_type = "tcp"
669
670
  self.use_af_unix = False
670
671
 
672
+ if self.shared_instance_type == "tcp":
673
+ self.local_socket_path = None
674
+
671
675
  if self.local_socket_path == None and self.use_af_unix:
672
676
  self.local_socket_path = "default"
673
677
 
@@ -1179,60 +1183,63 @@ class Reticulum:
1179
1183
  os.makedirs(Reticulum.configdir)
1180
1184
  self.config.write()
1181
1185
 
1186
+ def rpc_return(self, connection, response):
1187
+ connection.send_bytes(mp.packb(response))
1188
+
1182
1189
  def rpc_loop(self):
1183
1190
  while RNS.Transport._should_run:
1184
1191
  try:
1185
- rpc_connection = self.rpc_listener.accept()
1186
- call = rpc_connection.recv()
1192
+ conn = self.rpc_listener.accept()
1193
+ call = mp.unpackb(conn.recv_bytes())
1187
1194
 
1188
1195
  if "get" in call:
1189
1196
  path = call["get"]
1190
1197
 
1191
1198
  if path == "path_table":
1192
1199
  mh = call["max_hops"]
1193
- rpc_connection.send(self.get_path_table(max_hops=mh))
1194
-
1195
- if path == "interface_stats": rpc_connection.send(self.get_interface_stats())
1196
- if path == "rate_table": rpc_connection.send(self.get_rate_table())
1197
- if path == "next_hop_if_name": rpc_connection.send(self.get_next_hop_if_name(call["destination_hash"]))
1198
- if path == "next_hop": rpc_connection.send(self.get_next_hop(call["destination_hash"]))
1199
- if path == "first_hop_timeout": rpc_connection.send(self.get_first_hop_timeout(call["destination_hash"]))
1200
- if path == "link_count": rpc_connection.send(self.get_link_count())
1201
- if path == "packet_rssi": rpc_connection.send(self.get_packet_rssi(call["packet_hash"]))
1202
- if path == "packet_snr": rpc_connection.send(self.get_packet_snr(call["packet_hash"]))
1203
- if path == "packet_q": rpc_connection.send(self.get_packet_q(call["packet_hash"]))
1204
- if path == "blackholed_identities": rpc_connection.send(self.get_blackholed_identities())
1205
- if path == "is_blackholed": rpc_connection.send(self.is_blackholed(call["identity_hash"]))
1200
+ self.rpc_return(conn, self.get_path_table(max_hops=mh))
1201
+
1202
+ if path == "interface_stats": self.rpc_return(conn, self.get_interface_stats())
1203
+ if path == "rate_table": self.rpc_return(conn, self.get_rate_table())
1204
+ if path == "next_hop_if_name": self.rpc_return(conn, self.get_next_hop_if_name(call["destination_hash"]))
1205
+ if path == "next_hop": self.rpc_return(conn, self.get_next_hop(call["destination_hash"]))
1206
+ if path == "first_hop_timeout": self.rpc_return(conn, self.get_first_hop_timeout(call["destination_hash"]))
1207
+ if path == "link_count": self.rpc_return(conn, self.get_link_count())
1208
+ if path == "packet_rssi": self.rpc_return(conn, self.get_packet_rssi(call["packet_hash"]))
1209
+ if path == "packet_snr": self.rpc_return(conn, self.get_packet_snr(call["packet_hash"]))
1210
+ if path == "packet_q": self.rpc_return(conn, self.get_packet_q(call["packet_hash"]))
1211
+ if path == "blackholed_identities": self.rpc_return(conn, self.get_blackholed_identities())
1212
+ if path == "is_blackholed": self.rpc_return(conn, self.is_blackholed(call["identity_hash"]))
1206
1213
 
1207
1214
  if "drop" in call:
1208
1215
  path = call["drop"]
1209
- if path == "path": rpc_connection.send(self.drop_path(call["destination_hash"]))
1210
- if path == "all_via": rpc_connection.send(self.drop_all_via(call["destination_hash"]))
1211
- if path == "announce_queues": rpc_connection.send(self.drop_announce_queues())
1216
+ if path == "path": self.rpc_return(conn, self.drop_path(call["destination_hash"]))
1217
+ if path == "all_via": self.rpc_return(conn, self.drop_all_via(call["destination_hash"]))
1218
+ if path == "announce_queues": self.rpc_return(conn, self.drop_announce_queues())
1212
1219
 
1213
1220
  if "blackhole_identity" in call:
1214
1221
  identity_hash = call["blackhole_identity"]
1215
1222
  until = call["until"]
1216
1223
  reason = call["reason"]
1217
- rpc_connection.send(self.blackhole_identity(identity_hash, until=until, reason=reason))
1224
+ self.rpc_return(conn, self.blackhole_identity(identity_hash, until=until, reason=reason))
1218
1225
 
1219
1226
  if "unblackhole_identity" in call:
1220
1227
  identity_hash = call["unblackhole_identity"]
1221
- rpc_connection.send(self.unblackhole_identity(identity_hash))
1228
+ self.rpc_return(conn, self.unblackhole_identity(identity_hash))
1222
1229
 
1223
1230
  if "destination_data" in call:
1224
1231
  operation = call["destination_data"]
1225
1232
  destination_hash = call["destination_hash"]
1226
- if operation == "used": rpc_connection.send(self._used_destination_data(destination_hash))
1227
- elif operation == "retain": rpc_connection.send(self._retain_destination_data(destination_hash))
1228
- elif operation == "unretain": rpc_connection.send(self._unretain_destination_data(destination_hash))
1233
+ if operation == "used": self.rpc_return(conn, self._used_destination_data(destination_hash))
1234
+ elif operation == "retain": self.rpc_return(conn, self._retain_destination_data(destination_hash))
1235
+ elif operation == "unretain": self.rpc_return(conn, self._unretain_destination_data(destination_hash))
1229
1236
 
1230
1237
  if "identity_data" in call:
1231
1238
  operation = call["identity_data"]
1232
1239
  identity_hash = call["identity_hash"]
1233
- if operation == "retain": rpc_connection.send(self._retain_identity(identity_hash))
1240
+ if operation == "retain": self.rpc_return(conn, self._retain_identity(identity_hash))
1234
1241
 
1235
- rpc_connection.close()
1242
+ conn.close()
1236
1243
 
1237
1244
  except Exception as e:
1238
1245
  RNS.log("An error ocurred while handling RPC call from local client: "+str(e), RNS.LOG_ERROR)
@@ -1243,8 +1250,8 @@ class Reticulum:
1243
1250
  if self.is_connected_to_shared_instance:
1244
1251
  try:
1245
1252
  rpc_connection = self.get_rpc_client()
1246
- rpc_connection.send({"destination_data": "used", "destination_hash": destination_hash})
1247
- response = rpc_connection.recv()
1253
+ rpc_connection.send_bytes(mp.packb({"destination_data": "used", "destination_hash": destination_hash}))
1254
+ response = mp.unpackb(rpc_connection.recv_bytes())
1248
1255
  return response
1249
1256
 
1250
1257
  except Exception as e:
@@ -1257,8 +1264,8 @@ class Reticulum:
1257
1264
  if self.is_connected_to_shared_instance:
1258
1265
  try:
1259
1266
  rpc_connection = self.get_rpc_client()
1260
- rpc_connection.send({"destination_data": "retain", "destination_hash": destination_hash})
1261
- response = rpc_connection.recv()
1267
+ rpc_connection.send_bytes(mp.packb({"destination_data": "retain", "destination_hash": destination_hash}))
1268
+ response = mp.unpackb(rpc_connection.recv_bytes())
1262
1269
  return response
1263
1270
 
1264
1271
  except Exception as e:
@@ -1271,8 +1278,8 @@ class Reticulum:
1271
1278
  if self.is_connected_to_shared_instance:
1272
1279
  try:
1273
1280
  rpc_connection = self.get_rpc_client()
1274
- rpc_connection.send({"destination_data": "unretain", "destination_hash": destination_hash})
1275
- response = rpc_connection.recv()
1281
+ rpc_connection.send_bytes(mp.packb({"destination_data": "unretain", "destination_hash": destination_hash}))
1282
+ response = mp.unpackb(rpc_connection.recv_bytes())
1276
1283
  return response
1277
1284
 
1278
1285
  except Exception as e:
@@ -1288,8 +1295,8 @@ class Reticulum:
1288
1295
  if self.is_connected_to_shared_instance:
1289
1296
  try:
1290
1297
  rpc_connection = self.get_rpc_client()
1291
- rpc_connection.send({"identity_data": "retain", "identity_hash": identity_hash})
1292
- response = rpc_connection.recv()
1298
+ rpc_connection.send_bytes(mp.packb({"identity_data": "retain", "identity_hash": identity_hash}))
1299
+ response = mp.unpackb(rpc_connection.recv_bytes())
1293
1300
  return response
1294
1301
 
1295
1302
  except Exception as e:
@@ -1301,8 +1308,8 @@ class Reticulum:
1301
1308
  def get_interface_stats(self):
1302
1309
  if self.is_connected_to_shared_instance:
1303
1310
  rpc_connection = self.get_rpc_client()
1304
- rpc_connection.send({"get": "interface_stats"})
1305
- response = rpc_connection.recv()
1311
+ rpc_connection.send_bytes(mp.packb({"get": "interface_stats"}))
1312
+ response = mp.unpackb(rpc_connection.recv_bytes())
1306
1313
  return response
1307
1314
  else:
1308
1315
  interfaces = []
@@ -1491,8 +1498,8 @@ class Reticulum:
1491
1498
  def get_path_table(self, max_hops=None):
1492
1499
  if self.is_connected_to_shared_instance:
1493
1500
  rpc_connection = self.get_rpc_client()
1494
- rpc_connection.send({"get": "path_table", "max_hops": max_hops})
1495
- response = rpc_connection.recv()
1501
+ rpc_connection.send_bytes(mp.packb({"get": "path_table", "max_hops": max_hops}))
1502
+ response = mp.unpackb(rpc_connection.recv_bytes())
1496
1503
  return response
1497
1504
 
1498
1505
  else:
@@ -1515,8 +1522,8 @@ class Reticulum:
1515
1522
  def get_rate_table(self):
1516
1523
  if self.is_connected_to_shared_instance:
1517
1524
  rpc_connection = self.get_rpc_client()
1518
- rpc_connection.send({"get": "rate_table"})
1519
- response = rpc_connection.recv()
1525
+ rpc_connection.send_bytes(mp.packb({"get": "rate_table"}))
1526
+ response = mp.unpackb(rpc_connection.recv_bytes())
1520
1527
  return response
1521
1528
 
1522
1529
  else:
@@ -1536,8 +1543,8 @@ class Reticulum:
1536
1543
  def drop_path(self, destination):
1537
1544
  if self.is_connected_to_shared_instance:
1538
1545
  rpc_connection = self.get_rpc_client()
1539
- rpc_connection.send({"drop": "path", "destination_hash": destination})
1540
- response = rpc_connection.recv()
1546
+ rpc_connection.send_bytes(mp.packb({"drop": "path", "destination_hash": destination}))
1547
+ response = mp.unpackb(rpc_connection.recv_bytes())
1541
1548
  return response
1542
1549
 
1543
1550
  else:
@@ -1546,8 +1553,8 @@ class Reticulum:
1546
1553
  def drop_all_via(self, transport_hash):
1547
1554
  if self.is_connected_to_shared_instance:
1548
1555
  rpc_connection = self.get_rpc_client()
1549
- rpc_connection.send({"drop": "all_via", "destination_hash": transport_hash})
1550
- response = rpc_connection.recv()
1556
+ rpc_connection.send_bytes(mp.packb({"drop": "all_via", "destination_hash": transport_hash}))
1557
+ response = mp.unpackb(rpc_connection.recv_bytes())
1551
1558
  return response
1552
1559
 
1553
1560
  else:
@@ -1562,8 +1569,8 @@ class Reticulum:
1562
1569
  def drop_announce_queues(self):
1563
1570
  if self.is_connected_to_shared_instance:
1564
1571
  rpc_connection = self.get_rpc_client()
1565
- rpc_connection.send({"drop": "announce_queues"})
1566
- response = rpc_connection.recv()
1572
+ rpc_connection.send_bytes(mp.packb({"drop": "announce_queues"}))
1573
+ response = mp.unpackb(rpc_connection.recv_bytes())
1567
1574
  return response
1568
1575
 
1569
1576
  else:
@@ -1572,8 +1579,8 @@ class Reticulum:
1572
1579
  def get_next_hop_if_name(self, destination):
1573
1580
  if self.is_connected_to_shared_instance:
1574
1581
  rpc_connection = self.get_rpc_client()
1575
- rpc_connection.send({"get": "next_hop_if_name", "destination_hash": destination})
1576
- response = rpc_connection.recv()
1582
+ rpc_connection.send_bytes(mp.packb({"get": "next_hop_if_name", "destination_hash": destination}))
1583
+ response = mp.unpackb(rpc_connection.recv_bytes())
1577
1584
  return response
1578
1585
 
1579
1586
  else:
@@ -1583,8 +1590,8 @@ class Reticulum:
1583
1590
  if self.is_connected_to_shared_instance:
1584
1591
  try:
1585
1592
  rpc_connection = self.get_rpc_client()
1586
- rpc_connection.send({"get": "first_hop_timeout", "destination_hash": destination})
1587
- response = rpc_connection.recv()
1593
+ rpc_connection.send_bytes(mp.packb({"get": "first_hop_timeout", "destination_hash": destination}))
1594
+ response = mp.unpackb(rpc_connection.recv_bytes())
1588
1595
 
1589
1596
  if self.is_connected_to_shared_instance and hasattr(self, "_force_shared_instance_bitrate") and self._force_shared_instance_bitrate:
1590
1597
  simulated_latency = ((1/self._force_shared_instance_bitrate)*8)*RNS.Reticulum.MTU
@@ -1602,8 +1609,8 @@ class Reticulum:
1602
1609
  def get_next_hop(self, destination):
1603
1610
  if self.is_connected_to_shared_instance:
1604
1611
  rpc_connection = self.get_rpc_client()
1605
- rpc_connection.send({"get": "next_hop", "destination_hash": destination})
1606
- response = rpc_connection.recv()
1612
+ rpc_connection.send_bytes(mp.packb({"get": "next_hop", "destination_hash": destination}))
1613
+ response = mp.unpackb(rpc_connection.recv_bytes())
1607
1614
 
1608
1615
  return response
1609
1616
 
@@ -1613,8 +1620,8 @@ class Reticulum:
1613
1620
  def get_link_count(self):
1614
1621
  if self.is_connected_to_shared_instance:
1615
1622
  rpc_connection = self.get_rpc_client()
1616
- rpc_connection.send({"get": "link_count"})
1617
- response = rpc_connection.recv()
1623
+ rpc_connection.send_bytes(mp.packb({"get": "link_count"}))
1624
+ response = mp.unpackb(rpc_connection.recv_bytes())
1618
1625
  return response
1619
1626
 
1620
1627
  else:
@@ -1623,8 +1630,8 @@ class Reticulum:
1623
1630
  def get_packet_rssi(self, packet_hash):
1624
1631
  if self.is_connected_to_shared_instance:
1625
1632
  rpc_connection = self.get_rpc_client()
1626
- rpc_connection.send({"get": "packet_rssi", "packet_hash": packet_hash})
1627
- response = rpc_connection.recv()
1633
+ rpc_connection.send_bytes(mp.packb({"get": "packet_rssi", "packet_hash": packet_hash}))
1634
+ response = mp.unpackb(rpc_connection.recv_bytes())
1628
1635
  return response
1629
1636
 
1630
1637
  else:
@@ -1637,8 +1644,8 @@ class Reticulum:
1637
1644
  def get_packet_snr(self, packet_hash):
1638
1645
  if self.is_connected_to_shared_instance:
1639
1646
  rpc_connection = self.get_rpc_client()
1640
- rpc_connection.send({"get": "packet_snr", "packet_hash": packet_hash})
1641
- response = rpc_connection.recv()
1647
+ rpc_connection.send_bytes(mp.packb({"get": "packet_snr", "packet_hash": packet_hash}))
1648
+ response = mp.unpackb(rpc_connection.recv_bytes())
1642
1649
  return response
1643
1650
 
1644
1651
  else:
@@ -1651,8 +1658,8 @@ class Reticulum:
1651
1658
  def get_packet_q(self, packet_hash):
1652
1659
  if self.is_connected_to_shared_instance:
1653
1660
  rpc_connection = self.get_rpc_client()
1654
- rpc_connection.send({"get": "packet_q", "packet_hash": packet_hash})
1655
- response = rpc_connection.recv()
1661
+ rpc_connection.send_bytes(mp.packb({"get": "packet_q", "packet_hash": packet_hash}))
1662
+ response = mp.unpackb(rpc_connection.recv_bytes())
1656
1663
  return response
1657
1664
 
1658
1665
  else:
@@ -1674,8 +1681,8 @@ class Reticulum:
1674
1681
  def get_blackholed_identities(self):
1675
1682
  if self.is_connected_to_shared_instance:
1676
1683
  rpc_connection = self.get_rpc_client()
1677
- rpc_connection.send({"get": "blackholed_identities"})
1678
- response = rpc_connection.recv()
1684
+ rpc_connection.send_bytes(mp.packb({"get": "blackholed_identities"}))
1685
+ response = mp.unpackb(rpc_connection.recv_bytes())
1679
1686
  return response
1680
1687
 
1681
1688
  else: return RNS.Transport.blackholed_identities
@@ -1688,8 +1695,8 @@ class Reticulum:
1688
1695
 
1689
1696
  if self.is_connected_to_shared_instance:
1690
1697
  rpc_connection = self.get_rpc_client()
1691
- rpc_connection.send({"get": "is_blackholed", "identity_hash": identity_hash})
1692
- response = rpc_connection.recv()
1698
+ rpc_connection.send_bytes(mp.packb({"get": "is_blackholed", "identity_hash": identity_hash}))
1699
+ response = mp.unpackb(rpc_connection.recv_bytes())
1693
1700
  return response
1694
1701
 
1695
1702
  else: return identity_hash in RNS.Transport.blackholed_identities
@@ -1699,8 +1706,8 @@ class Reticulum:
1699
1706
  else:
1700
1707
  if self.is_connected_to_shared_instance:
1701
1708
  rpc_connection = self.get_rpc_client()
1702
- rpc_connection.send({"blackhole_identity": identity_hash, "until": until, "reason": reason})
1703
- response = rpc_connection.recv()
1709
+ rpc_connection.send_bytes(mp.packb({"blackhole_identity": identity_hash, "until": until, "reason": reason}))
1710
+ response = mp.unpackb(rpc_connection.recv_bytes())
1704
1711
  return response
1705
1712
 
1706
1713
  else: return RNS.Transport.blackhole_identity(identity_hash, until=until, reason=reason)
@@ -1710,8 +1717,8 @@ class Reticulum:
1710
1717
  else:
1711
1718
  if self.is_connected_to_shared_instance:
1712
1719
  rpc_connection = self.get_rpc_client()
1713
- rpc_connection.send({"unblackhole_identity": identity_hash})
1714
- response = rpc_connection.recv()
1720
+ rpc_connection.send_bytes(mp.packb({"unblackhole_identity": identity_hash}))
1721
+ response = mp.unpackb(rpc_connection.recv_bytes())
1715
1722
  return response
1716
1723
 
1717
1724
  else: return RNS.Transport.unblackhole_identity(identity_hash)
@@ -1755,6 +1755,7 @@ class Transport:
1755
1755
  random_blob = packet.data[RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8:RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8+10]
1756
1756
  random_blobs = []
1757
1757
  with Transport.inbound_announce_lock:
1758
+ announced_destination_known |= packet.destination_hash in Transport.path_table
1758
1759
  if announced_destination_known:
1759
1760
  random_blobs = Transport.path_table[packet.destination_hash][IDX_PT_RANDBLOBS]
1760
1761
 
@@ -1827,7 +1828,6 @@ class Transport:
1827
1828
  else:
1828
1829
  # If this destination is unknown in our table
1829
1830
  # we should add it
1830
- Transport.mark_path_unknown_state(packet.destination_hash)
1831
1831
  should_add = True
1832
1832
 
1833
1833
  if should_add:
@@ -0,0 +1 @@
1
+ __version__ = "1.3.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rns
3
- Version: 1.3.3
3
+ Version: 1.3.4
4
4
  Summary: Self-configuring, encrypted and resilient mesh networking stack for LoRa, packet radio, WiFi and everything in between
5
5
  Home-page: https://reticulum.network/
6
6
  Author: Mark Qvist
rns-1.3.3/RNS/_version.py DELETED
@@ -1 +0,0 @@
1
- __version__ = "1.3.3"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes