ncsid: Import from gBMC
This is the initial code drop from gBMC.
Google-Bug-Id: 179618516
Upstream: 1e71af914bc8c54d8b91d0a1cf377e2696713c2f
Change-Id: Ic653e8271dacd205e04f2bc713071ef2ec5936a4
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/ncsid/test/net_iface_mock.h b/ncsid/test/net_iface_mock.h
new file mode 100644
index 0000000..5fcbcc9
--- /dev/null
+++ b/ncsid/test/net_iface_mock.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <net_iface.h>
+
+#include <vector>
+
+namespace mock
+{
+
+class IFace : public net::IFaceBase
+{
+ public:
+ IFace() : net::IFaceBase("mock0")
+ {}
+ explicit IFace(const std::string& name) : net::IFaceBase(name)
+ {}
+ int bind_sock(int sockfd, struct sockaddr_ll* saddr) const override;
+
+ mutable std::vector<int> bound_socks;
+ int index;
+ mutable short flags = 0;
+
+ private:
+ int ioctl_sock(int sockfd, int request, struct ifreq* ifr) const override;
+ int ioctl(int request, struct ifreq* ifr) const override;
+};
+
+} // namespace mock