MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / OnProtocolS2G

Method OnProtocolS2G

Src/Core/NodeRelay.cpp:46–60  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

44
45////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
46void FSecure::C3::Core::NodeRelay::OnProtocolS2G(ByteView packet0, std::shared_ptr<DeviceBridge> sender)
47{
48 auto grc = GetGatewayReturnChannel();
49 if (!grc)
50 std::runtime_error{ OBF("No GRC.") };
51
52 if (grc == sender)
53 throw std::runtime_error{ OBF("S2G packet received from GRC.") };
54
55 // Expensive search on NodeRelay.
56 if (sender->IsChannel() && !FindRouteByOutgoingChannel(sender->GetDid()))
57 throw std::runtime_error{ OBF("S2G packet received from device that has no route attached.") };
58
59 LockAndSendPacket(packet0, grc);
60}
61
62////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
63void FSecure::C3::Core::NodeRelay::OnProtocolG2A(ByteView packet0, std::shared_ptr<DeviceBridge> sender)

Callers

nothing calls this directly

Calls 2

GetDidMethod · 0.80
IsChannelMethod · 0.45

Tested by

no test coverage detected