///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
| 1146 | |
| 1147 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 1148 | FSecure::C3::Core::Profiler::Agent* FSecure::C3::Core::Profiler::Gateway::ReAddRemoteAgent(RouteId childRouteId, BuildId buildId, FSecure::Crypto::PublicKey encryptionKey, RouteId ridOfConectionPlace, HashT childGrcHash, int32_t firstSeen, int32_t lastSeen, HostInfo hostInfo) |
| 1149 | { |
| 1150 | // add agent |
| 1151 | auto newAgent = ReAddAgent(childRouteId.GetAgentId(), buildId, encryptionKey, false, firstSeen, lastSeen, std::move(hostInfo)); // TODO check if is banned |
| 1152 | |
| 1153 | // add routes |
| 1154 | Relay* current = this; |
| 1155 | while (current->m_Id != ridOfConectionPlace.GetAgentId()) |
| 1156 | { |
| 1157 | DeviceId outDevice = current->FindDirectionDevice(ridOfConectionPlace.GetAgentId()); |
| 1158 | current->ReAddRoute(childRouteId, outDevice, false); |
| 1159 | current = FindNeighborOnDevice(*current, outDevice); |
| 1160 | } |
| 1161 | |
| 1162 | // add route to neighboring device |
| 1163 | current->ReAddRoute(childRouteId, ridOfConectionPlace.GetInterfaceId(), true); |
| 1164 | |
| 1165 | // add return channel to new agent |
| 1166 | newAgent->ReAddChannel(childRouteId.GetInterfaceId(), childGrcHash, true); |
| 1167 | return newAgent; |
| 1168 | } |
| 1169 | |
| 1170 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 1171 | void FSecure::C3::Core::Profiler::Relay::UpdateFromNegotiationChannel(DeviceId negotiationDid, DeviceId newDeviceId, std::string newInputId, std::string newOutputId) |
no test coverage detected