MCPcopy Create free account
hub / github.com/YtFlow/Maple / Encapsulate

Method Encapsulate

Maple.Task/VpnPlugin.cpp:209–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 };

Callers

nothing calls this directly

Calls 3

BufferMethod · 0.80
dataMethod · 0.80
LengthMethod · 0.80

Tested by

no test coverage detected