Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort includes inet #692

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/inet/AsyncDNSResolverSockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
* Asynchronous Domain Name System (DNS) resolution in InetLayer.
*
*/
#include <InetLayer.h>
#include <support/CodeUtils.h>
#include <support/logging/CHIPLogging.h>

#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <support/CodeUtils.h>
#include <support/logging/CHIPLogging.h>
#include <InetLayer.h>

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#if INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
Expand Down
7 changes: 4 additions & 3 deletions src/inet/DNSResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@
*
*/

#include <InetLayer.h>
#include <DNSResolver.h>

#include <InetLayer.h>
#include <InetLayerEvents.h>

#include <support/CodeUtils.h>

#include <string.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/init.h>
#include <lwip/dns.h>
#include <lwip/init.h>
#include <lwip/tcpip.h>

#if LWIP_VERSION_MAJOR < 2
Expand All @@ -42,8 +43,8 @@
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <netdb.h>
#include <errno.h>
#include <netdb.h>
#include <stdlib.h>
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

Expand Down
2 changes: 1 addition & 1 deletion src/inet/DNSResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <inet/IPAddress.h>
#include <inet/InetError.h>
#include "inet/InetLayerBasis.h"
#include <inet/InetLayerBasis.h>

#define NL_DNS_HOSTNAME_MAX_LEN (253)

Expand Down
4 changes: 2 additions & 2 deletions src/inet/EndPointBasis.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@

#include <inet/InetConfig.h>

#include <inet/InetError.h>
#include "inet/IANAConstants.h"
#include "inet/InetLayerBasis.h"
#include <inet/InetLayerEvents.h>
#include <inet/InetError.h>
#include <inet/InetInterface.h>
#include <inet/InetLayerEvents.h>

#include <support/DLLUtil.h>

Expand Down
8 changes: 5 additions & 3 deletions src/inet/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include <stdint.h>
#include <string.h>

#include <IPAddress.h>

#include <core/CHIPEncoding.h>
#include <InetLayer.h>

#include "arpa-inet-compatibility.h"

#include <stdint.h>
#include <string.h>

namespace chip {
namespace Inet {

Expand Down
2 changes: 1 addition & 1 deletion src/inet/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#define NL_INET_IPV6_ADDR_LEN_IN_BYTES (16)
Expand Down
6 changes: 3 additions & 3 deletions src/inet/IPEndPointBasis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <sys/socket.h>
#include <errno.h>
#include <unistd.h>
#include <netinet/in.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
Expand Down
18 changes: 9 additions & 9 deletions src/inet/Inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,36 @@

#include <inet/InetConfig.h>

#include <inet/IPAddress.h>
#include <inet/IPPrefix.h>
#include <inet/InetError.h>
#include <inet/InetInterface.h>
#include <inet/InetLayerEvents.h>
#include <inet/InetLayer.h>
#include <inet/IPAddress.h>
#include "inet/IPPrefix.h"
#include <inet/InetLayerEvents.h>

#if INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
#include "inet/InetBuffer.h"
#include "inet/InetTimer.h"
#include <inet/InetBuffer.h>
#include <inet/InetTimer.h>
#endif // INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES

#if INET_CONFIG_ENABLE_DNS_RESOLVER
#include <inet/DNSResolver.h>
#endif // INET_CONFIG_ENABLE_DNS_RESOLVER

#if INET_CONFIG_ENABLE_RAW_ENDPOINT
#include "inet/RawEndPoint.h"
#include <inet/RawEndPoint.h>
#endif // INET_CONFIG_ENABLE_RAW_ENDPOINT

#if INET_CONFIG_ENABLE_TCP_ENDPOINT
#include "inet/TCPEndPoint.h"
#include <inet/TCPEndPoint.h>
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT

#if INET_CONFIG_ENABLE_UDP_ENDPOINT
#include "inet/UDPEndPoint.h"
#include <inet/UDPEndPoint.h>
#endif // INET_CONFIG_ENABLE_UDP_ENDPOINT

#if INET_CONFIG_ENABLE_TUN_ENDPOINT
#include "inet/TunEndPoint.h"
#include <inet/TunEndPoint.h>
#endif // INET_CONFIG_ENABLE_TUN_ENDPOINT

#endif // !defined(INET_H)
2 changes: 1 addition & 1 deletion src/inet/InetArgParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* Support functions for parsing command-line arguments for Inet types
*
*/

#include <inet/InetArgParser.h>

#include <inet/IPAddress.h>

namespace chip {
Expand Down
1 change: 1 addition & 0 deletions src/inet/InetArgParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#if CHIP_CONFIG_ENABLE_ARG_PARSER

#include <support/CHIPArgParser.hpp>

#include <inet/IPAddress.h>

namespace chip {
Expand Down
3 changes: 2 additions & 1 deletion src/inet/InetFaultInjection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* Implementation of the fault-injection utilities for Inet.
*/

#include <nlassert.h>
#include "InetFaultInjection.h"

#include <nlassert.h>

#if INET_CONFIG_TEST

namespace chip {
Expand Down
21 changes: 11 additions & 10 deletions src/inet/InetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,40 @@
#define __STDC_LIMIT_MACROS
#endif

#include <stdio.h>
#include <string.h>
#include "InetInterface.h"

#include "InetLayer.h"
#include "InetLayerEvents.h"

#include <support/CodeUtils.h>
#include <support/DLLUtil.h>

#include <InetLayer.h>
#include <InetLayerEvents.h>
#include "IPPrefix.h"

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/tcpip.h>
#include <lwip/sys.h>
#include <lwip/netif.h>
#include <lwip/sys.h>
#include <lwip/tcpip.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <unistd.h>
#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif /* HAVE_SYS_SOCKIO_H */
#include <sys/ioctl.h>
#include <net/if.h>
#include <sys/ioctl.h>
#ifdef __ANDROID__
#include "ifaddrs-android.h"
#else // !defined(__ANDROID__)
#include <ifaddrs.h>
#endif // !defined(__ANDROID__)
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#include <stdio.h>
#include <string.h>

namespace chip {
namespace Inet {

Expand Down
9 changes: 5 additions & 4 deletions src/inet/InetInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
#ifndef INETINTERFACE_H
#define INETINTERFACE_H

#include <stddef.h>
#include <stdint.h>

#include <support/DLLUtil.h>
#include <inet/IPAddress.h>
#include <inet/InetError.h>
#include <support/DLLUtil.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/netif.h>
Expand All @@ -42,6 +40,9 @@ struct if_nameindex;
struct ifaddrs;
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#include <stddef.h>
#include <stdint.h>

namespace chip {
namespace Inet {

Expand Down
7 changes: 4 additions & 3 deletions src/inet/InetLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include "InetLayer.h"

#include <InetLayer.h>
#include "InetFaultInjection.h"

#include <system/SystemTimer.h>

#include <support/CodeUtils.h>
Expand All @@ -58,12 +59,12 @@
#include <string.h>

#if CHIP_SYSTEM_CONFIG_USE_LWIP
#include <lwip/sys.h>
#include <lwip/netif.h>
#include <lwip/sys.h>
#else // !CHIP_SYSTEM_CONFIG_USE_LWIP
#include <unistd.h>
#include <fcntl.h>
#include <net/if.h>
#include <unistd.h>
#ifdef __ANDROID__
#include <ifaddrs-android.h>
#else
Expand Down
34 changes: 17 additions & 17 deletions src/inet/InetLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,53 +48,51 @@
#define __STDC_LIMIT_MACROS
#endif

#include <stdint.h>

#include <inet/InetConfig.h>

#include <system/SystemLayer.h>
#include <system/SystemStats.h>

#include <support/DLLUtil.h>

#include "inet/IANAConstants.h"
#include <inet/InetError.h>
#include <inet/IANAConstants.h>
#include <inet/IPAddress.h>
#include "inet/IPPrefix.h"
#include <inet/IPPrefix.h>
#include <inet/InetError.h>
#include <inet/InetInterface.h>
#include "inet/InetLayerBasis.h"
#include <inet/InetLayerBasis.h>
#include <inet/InetLayerEvents.h>

#if INET_CONFIG_ENABLE_DNS_RESOLVER
#include <inet/DNSResolver.h>
#endif // INET_CONFIG_ENABLE_DNS_RESOLVER

#if INET_CONFIG_ENABLE_RAW_ENDPOINT
#include "inet/RawEndPoint.h"
#include <inet/RawEndPoint.h>
#endif // INET_CONFIG_ENABLE_RAW_ENDPOINT

#if INET_CONFIG_ENABLE_TCP_ENDPOINT
#include "inet/TCPEndPoint.h"
#include <inet/TCPEndPoint.h>
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT

#if INET_CONFIG_ENABLE_UDP_ENDPOINT
#include "inet/UDPEndPoint.h"
#include <inet/UDPEndPoint.h>
#endif // INET_CONFIG_ENABLE_UDP_ENDPOINT

#if INET_CONFIG_ENABLE_TUN_ENDPOINT
#include "inet/TunEndPoint.h"
#include <inet/TunEndPoint.h>
#endif // INET_CONFIG_ENABLE_TUN_ENDPOINT

#if INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
#include "vInetBuffer.h"
#include <inet/InetBuffer.h>
#endif // INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#if INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
#include "inet/AsyncDNSResolverSockets.h"
#include <inet/AsyncDNSResolverSockets.h>
#endif // INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS

#include <system/SystemLayer.h>
#include <system/SystemStats.h>

#include <support/DLLUtil.h>

#if INET_CONFIG_MAX_DROPPABLE_EVENTS

#if CHIP_SYSTEM_CONFIG_POSIX_LOCKING
Expand All @@ -109,6 +107,8 @@

#endif // INET_CONFIG_MAX_DROPPABLE_EVENTS

#include <stdint.h>

namespace chip {
namespace Inet {

Expand Down
2 changes: 1 addition & 1 deletion src/inet/InetLayerBasis.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include <support/DLLUtil.h>
#include <system/SystemObject.h>
#include <stdint.h>

#include <stdint.h>
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
#include <sys/select.h>
#endif
Expand Down
Loading