mirror of
https://github.com/ratspeak/microReticulum
synced 2026-11-22 23:10:38 +00:00
transport: discover paths for roaming interfaces
This commit is contained in:
1 parent
3ddf3c362b
commit
83b88146f4
2 files changed
+23
-1
No files matched your search
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
using namespace RNS;
|
using namespace RNS;
|
||||||
using namespace RNS::Type::Interface;
|
using namespace RNS::Type::Interface;
|
||||||
|
|
||||||
/*static*/ uint8_t Interface::DISCOVER_PATHS_FOR = MODE_ACCESS_POINT | MODE_GATEWAY;
|
/*static*/ uint8_t Interface::DISCOVER_PATHS_FOR = MODE_ACCESS_POINT | MODE_GATEWAY | MODE_ROAMING;
|
||||||
|
|
||||||
void InterfaceImpl::handle_outgoing(const Bytes& data) {
|
void InterfaceImpl::handle_outgoing(const Bytes& data) {
|
||||||
//TRACEF("InterfaceImpl.handle_outgoing: data: %s", data.toHex().c_str());
|
//TRACEF("InterfaceImpl.handle_outgoing: data: %s", data.toHex().c_str());
|
||||||
|
|||||||
@@ -226,6 +226,26 @@ void test_receipt_timeout_callback() {
|
|||||||
// Transport hashlist tests
|
// Transport hashlist tests
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
void test_discover_paths_for_matches_upstream_modes() {
|
||||||
|
uint8_t discover_modes = RNS::Interface::DISCOVER_PATHS_FOR;
|
||||||
|
|
||||||
|
TEST_ASSERT_TRUE_MESSAGE(
|
||||||
|
(discover_modes & RNS::Type::Interface::MODE_ACCESS_POINT) > 0,
|
||||||
|
"Access point interfaces should discover unknown paths");
|
||||||
|
TEST_ASSERT_TRUE_MESSAGE(
|
||||||
|
(discover_modes & RNS::Type::Interface::MODE_GATEWAY) > 0,
|
||||||
|
"Gateway interfaces should discover unknown paths");
|
||||||
|
TEST_ASSERT_TRUE_MESSAGE(
|
||||||
|
(discover_modes & RNS::Type::Interface::MODE_ROAMING) > 0,
|
||||||
|
"Roaming interfaces should discover unknown paths");
|
||||||
|
TEST_ASSERT_FALSE_MESSAGE(
|
||||||
|
(discover_modes & RNS::Type::Interface::MODE_FULL) > 0,
|
||||||
|
"Full interfaces should not discover paths on behalf of peers");
|
||||||
|
TEST_ASSERT_FALSE_MESSAGE(
|
||||||
|
(discover_modes & RNS::Type::Interface::MODE_BOUNDARY) > 0,
|
||||||
|
"Boundary interfaces should not discover paths on behalf of peers");
|
||||||
|
}
|
||||||
|
|
||||||
void test_hashlist_basic() {
|
void test_hashlist_basic() {
|
||||||
// Send enough packets that the hashlist should grow
|
// Send enough packets that the hashlist should grow
|
||||||
initRNS();
|
initRNS();
|
||||||
@@ -580,6 +600,8 @@ void tearDown(void) {}
|
|||||||
int runUnityTests(void) {
|
int runUnityTests(void) {
|
||||||
UNITY_BEGIN();
|
UNITY_BEGIN();
|
||||||
|
|
||||||
|
RUN_TEST(test_discover_paths_for_matches_upstream_modes);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Transport receipt lifecycle
|
// Transport receipt lifecycle
|
||||||
RUN_TEST(test_receipt_creation_and_culling);
|
RUN_TEST(test_receipt_creation_and_culling);
|
||||||
|
|||||||
Reference in new issue
Block a user