iwyu: Cleanup include headers
Triggered iwyu and add/remove used headers.
Change-Id: Iadbdb459563b3c89baf2d56f90a540342d020cd5
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/subprojects/ncsid/src/ncsi_sockio.cpp b/subprojects/ncsid/src/ncsi_sockio.cpp
index 2158264..259386c 100644
--- a/subprojects/ncsid/src/ncsi_sockio.cpp
+++ b/subprojects/ncsid/src/ncsi_sockio.cpp
@@ -18,13 +18,14 @@
#include "net_iface.h"
#include <linux/filter.h>
+#include <linux/if.h>
+#include <linux/if_ether.h>
#include <netinet/in.h>
#include <poll.h>
#include <sys/socket.h>
-#include <sys/types.h>
-#include <cstdio>
#include <cstring>
+#include <iterator>
namespace ncsi
{
diff --git a/subprojects/ncsid/src/ncsi_sockio.h b/subprojects/ncsid/src/ncsi_sockio.h
index 09c610a..72cc473 100644
--- a/subprojects/ncsid/src/ncsi_sockio.h
+++ b/subprojects/ncsid/src/ncsi_sockio.h
@@ -19,10 +19,9 @@
#include "net_iface.h"
#include "net_sockio.h"
-#include <sys/socket.h>
+#include <linux/if_packet.h>
#include <cstddef>
-#include <cstring>
namespace ncsi
{
diff --git a/subprojects/ncsid/src/net_iface.cpp b/subprojects/ncsid/src/net_iface.cpp
index 0a647b4..f3e0732 100644
--- a/subprojects/ncsid/src/net_iface.cpp
+++ b/subprojects/ncsid/src/net_iface.cpp
@@ -14,12 +14,12 @@
#include "net_iface.h"
+#include <linux/if.h>
#include <linux/if_packet.h>
-#include <net/ethernet.h>
+#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
-#include <cstdio>
#include <cstring>
#include <stdexcept>
diff --git a/subprojects/ncsid/src/net_iface.h b/subprojects/ncsid/src/net_iface.h
index d44f23c..23bcb91 100644
--- a/subprojects/ncsid/src/net_iface.h
+++ b/subprojects/ncsid/src/net_iface.h
@@ -18,12 +18,8 @@
#include <linux/if.h>
#include <linux/if_packet.h>
-#include <net/ethernet.h>
-#include <netinet/in.h>
-#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <functional>
#include <string>
namespace net
diff --git a/subprojects/ncsid/src/normalize_ip.c b/subprojects/ncsid/src/normalize_ip.c
index 77783cc..aeada4f 100644
--- a/subprojects/ncsid/src/normalize_ip.c
+++ b/subprojects/ncsid/src/normalize_ip.c
@@ -15,7 +15,9 @@
*/
#include <arpa/inet.h>
+#include <netinet/in.h>
#include <stdio.h>
+#include <sys/socket.h>
int main(int argc, char* argv[])
{
diff --git a/subprojects/ncsid/src/normalize_mac.c b/subprojects/ncsid/src/normalize_mac.c
index 6c6aa6c..db92cd5 100644
--- a/subprojects/ncsid/src/normalize_mac.c
+++ b/subprojects/ncsid/src/normalize_mac.c
@@ -15,6 +15,7 @@
*/
#include <inttypes.h>
+#include <linux/if_ether.h>
#include <net/ethernet.h>
#include <stdio.h>
diff --git a/subprojects/ncsid/src/platforms/nemora/portable/ncsi_client.c b/subprojects/ncsid/src/platforms/nemora/portable/ncsi_client.c
index 403f0a7..1ce7f5e 100644
--- a/subprojects/ncsid/src/platforms/nemora/portable/ncsi_client.c
+++ b/subprojects/ncsid/src/platforms/nemora/portable/ncsi_client.c
@@ -26,7 +26,7 @@
#include <stdint.h>
#include <string.h>
-#include <arpa/inet.h>
+#include <netinet/in.h>
#include "platforms/nemora/portable/ncsi_client.h"
diff --git a/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.c b/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.c
index 11d34dd..5b5344c 100644
--- a/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.c
+++ b/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.c
@@ -16,7 +16,7 @@
#include <string.h>
-#include <arpa/inet.h>
+#include <netinet/in.h>
#include "platforms/nemora/portable/ncsi.h"
#include "platforms/nemora/portable/ncsi_client.h"
diff --git a/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.h b/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.h
index de71345..350846d 100644
--- a/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.h
+++ b/subprojects/ncsid/src/platforms/nemora/portable/ncsi_fsm.h
@@ -20,6 +20,7 @@
/* Nemora NC-SI (Finite) State Machine implementation */
#include <stdint.h>
+#include <stdbool.h>
#include "platforms/nemora/portable/ncsi.h"
#include "platforms/nemora/portable/net_types.h"
diff --git a/subprojects/ncsid/test/iface_test.cpp b/subprojects/ncsid/test/iface_test.cpp
index 267194c..2ae340a 100644
--- a/subprojects/ncsid/test/iface_test.cpp
+++ b/subprojects/ncsid/test/iface_test.cpp
@@ -14,6 +14,9 @@
#include "net_iface_mock.h"
+#include <memory>
+
+#include "gtest/gtest.h"
#include <gtest/gtest.h>
TEST(TestIFace, TestGetIndex)
diff --git a/subprojects/ncsid/test/net_iface_mock.cpp b/subprojects/ncsid/test/net_iface_mock.cpp
index 4b071ed..5e2d223 100644
--- a/subprojects/ncsid/test/net_iface_mock.cpp
+++ b/subprojects/ncsid/test/net_iface_mock.cpp
@@ -14,6 +14,9 @@
#include "net_iface_mock.h"
+#include <linux/if.h>
+#include <sys/ioctl.h>
+
namespace mock
{
diff --git a/subprojects/ncsid/test/net_iface_mock.h b/subprojects/ncsid/test/net_iface_mock.h
index 0ccf5bf..118ca03 100644
--- a/subprojects/ncsid/test/net_iface_mock.h
+++ b/subprojects/ncsid/test/net_iface_mock.h
@@ -18,6 +18,7 @@
#include <net_iface.h>
+#include <string>
#include <vector>
namespace mock
diff --git a/subprojects/ncsid/test/nic_mock.cpp b/subprojects/ncsid/test/nic_mock.cpp
index c435ffa..20f7f56 100644
--- a/subprojects/ncsid/test/nic_mock.cpp
+++ b/subprojects/ncsid/test/nic_mock.cpp
@@ -15,9 +15,11 @@
#include "nic_mock.h"
#include "platforms/nemora/portable/ncsi.h"
+#include "platforms/nemora/portable/ncsi_server.h"
#include <algorithm>
#include <cstddef>
+#include <cstring>
#include <stdexcept>
namespace mock
diff --git a/subprojects/ncsid/test/nic_mock.h b/subprojects/ncsid/test/nic_mock.h
index 13e5959..be314f8 100644
--- a/subprojects/ncsid/test/nic_mock.h
+++ b/subprojects/ncsid/test/nic_mock.h
@@ -18,12 +18,11 @@
#include "platforms/nemora/portable/ncsi.h"
#include "platforms/nemora/portable/ncsi_fsm.h"
-#include "platforms/nemora/portable/ncsi_server.h"
+#include "platforms/nemora/portable/net_types.h"
#include <netinet/in.h>
#include <cstdint>
-#include <cstring>
#include <vector>
namespace mock
diff --git a/subprojects/ncsid/test/sock_test.cpp b/subprojects/ncsid/test/sock_test.cpp
index 6e034de..463bc6f 100644
--- a/subprojects/ncsid/test/sock_test.cpp
+++ b/subprojects/ncsid/test/sock_test.cpp
@@ -15,7 +15,13 @@
#include "ncsi_sockio.h"
#include "net_iface_mock.h"
-#include <gmock/gmock.h>
+#include <linux/if.h>
+
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include <gtest/gtest.h>
TEST(TestSockIO, TestBind)
{