| 207 | { |
| 208 | } |
| 209 | void VpnPlugin::Encapsulate([[maybe_unused]] VpnChannel const& channel, VpnPacketBufferList const& packets, VpnPacketBufferList const&) |
| 210 | { |
| 211 | auto packetCount = packets.Size(); |
| 212 | while (packetCount-- > 0) { |
| 213 | const auto packet = packets.RemoveAtBegin(); |
| 214 | const auto buffer = packet.Buffer(); |
| 215 | netstack_send(m_netStackHandle, buffer.data(), static_cast<size_t>(buffer.Length())); |
| 216 | packets.Append(packet); |
| 217 | } |
| 218 | } |
| 219 | void VpnPlugin::Decapsulate(VpnChannel const& channel, [[maybe_unused]] VpnPacketBuffer const& encapBuffer, VpnPacketBufferList const& decapsulatedPackets, VpnPacketBufferList const&) |
| 220 | { |
| 221 | std::lock_guard _guard{ VpnPluginInstance->m_decapQueueLock }; |