[netemul] RAII Explanation on EthertapClient
Add comment to EthertapClient class explicitly stating RAII nature of
tap devices and lifecycle of EthertapClient objects.
TEST: CQ
Change-Id: I55688b0a6723772bda2c2258a4ce435e45944d73
diff --git a/public/lib/netemul/network/ethertap_client.h b/public/lib/netemul/network/ethertap_client.h
index 871403d..c1a47fc 100644
--- a/public/lib/netemul/network/ethertap_client.h
+++ b/public/lib/netemul/network/ethertap_client.h
@@ -31,6 +31,10 @@
explicit EthertapConfig(const Mac& mac) : mac(mac) {}
};
+// Helper class to create and operate Ethertap Devices.
+// Existence of the tap device is tied to object lifecycle (RAII), so if you
+// intend to connect to the ethernet device you must keep the EthertapClient
+// instance in scope.
class EthertapClient {
public:
using PacketCallback = fit::function<void(const void* buf, size_t len)>;