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

Method PostCommandToConnector

Src/Core/NodeRelay.cpp:126–135  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

124
125////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
126void FSecure::C3::Core::NodeRelay::PostCommandToConnector(ByteView command, std::shared_ptr<DeviceBridge> senderPeripheral)
127{
128 auto grc = GetGatewayReturnChannel();
129 if (!grc)
130 throw std::runtime_error{ OBF("No GRC set while trying to send a S2G packet.") };
131
132 auto connectorHash = InterfaceFactory::Instance().Find<AbstractPeripheral>(senderPeripheral->GetTypeNameHash())->second.m_ClousureConnectorHash;
133 auto query = ProceduresS2G::DeliverToBinder::Create(RouteId{ GetAgentId(), grc->GetDid() }, FSecure::Utils::TimeSinceEpoch(), senderPeripheral->GetDid(), connectorHash, command, m_GatewayEncryptionKey);
134 LockAndSendPacket(query->ComposeQueryPacket(), grc);
135}
136
137////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
138void FSecure::C3::Core::NodeRelay::SetGatewayReturnChannel(std::shared_ptr<DeviceBridge> const& gatewayReturnChannel)

Callers 1

OnReceiveMethod · 0.45

Calls 4

TimeSinceEpochFunction · 0.85
GetTypeNameHashMethod · 0.80
GetDidMethod · 0.80
ComposeQueryPacketMethod · 0.45

Tested by

no test coverage detected