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/iface_test.cpp b/ncsid/test/iface_test.cpp
new file mode 100644
index 0000000..70eef05
--- /dev/null
+++ b/ncsid/test/iface_test.cpp
@@ -0,0 +1,24 @@
+#include "net_iface_mock.h"
+
+#include <gtest/gtest.h>
+
+TEST(TestIFace, TestGetIndex)
+{
+    mock::IFace iface_mock;
+
+    constexpr int test_index = 5;
+    iface_mock.index = test_index;
+
+    EXPECT_EQ(test_index, iface_mock.get_index());
+}
+
+TEST(TestIFace, TestSetClearFlags)
+{
+    mock::IFace iface_mock;
+
+    const short new_flags = 0xab;
+    iface_mock.set_sock_flags(0, new_flags);
+    EXPECT_EQ(new_flags, new_flags & iface_mock.flags);
+    iface_mock.clear_sock_flags(0, 0xa0);
+    EXPECT_EQ(0xb, new_flags & iface_mock.flags);
+}