mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Clean up inclusion of <netinet/in.h>
Make all #include <netinet/in.h> conditional upon HAVE_NETINET_IN_H Remove unnecessary #include <netinet/in.h> from source files Reformat include block in "serval.h" for readability
This commit is contained in:
parent
13634f8748
commit
ba0ab14c69
1
lsif.c
1
lsif.c
@ -46,7 +46,6 @@
|
||||
#ifndef SIOCGIFCONF
|
||||
#include <sys/sockio.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#if __MACH__
|
||||
#include <net/if_dl.h>
|
||||
|
1
net.c
1
net.c
@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include <fcntl.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "serval.h"
|
||||
|
2
net.h
2
net.h
@ -21,7 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include <sys/types.h> // for size_t, ssize_t
|
||||
#include <sys/socket.h> // for struct sockaddr, socklen_t
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h> // for struct in_addr
|
||||
#endif
|
||||
#include <arpa/inet.h> // for in_addr_t
|
||||
#include "log.h" // for __WHENCE__ and struct __sourceloc
|
||||
|
||||
|
@ -19,7 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
|
@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
/* Android doesn't have log2(), and we don't really need to do floating point
|
||||
|
69
serval.h
69
serval.h
@ -33,42 +33,41 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include "win32/win32.h"
|
||||
# include "win32/win32.h"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NET_ROUTE_H
|
||||
#include <net/route.h>
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_IF_H
|
||||
#include <linux/if.h>
|
||||
#else
|
||||
#ifdef HAVE_NET_IF_H
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_NETLINK_H
|
||||
#include <linux/netlink.h>
|
||||
#endif
|
||||
#ifdef HAVE_LINUX_RTNETLINK_H
|
||||
#include <linux/rtnetlink.h>
|
||||
#endif
|
||||
#ifdef HAVE_IFADDRS_H
|
||||
#include <ifaddrs.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKIO_H
|
||||
#include <sys/sockio.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_UCRED_H
|
||||
#include <sys/ucred.h>
|
||||
#endif
|
||||
#endif
|
||||
# include <unistd.h>
|
||||
# ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
# endif
|
||||
# ifdef HAVE_NET_ROUTE_H
|
||||
# include <net/route.h>
|
||||
# endif
|
||||
# ifdef HAVE_LINUX_IF_H
|
||||
# include <linux/if.h>
|
||||
# else
|
||||
# ifdef HAVE_NET_IF_H
|
||||
# include <net/if.h>
|
||||
# endif
|
||||
# endif
|
||||
# ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
# endif
|
||||
# ifdef HAVE_LINUX_NETLINK_H
|
||||
# include <linux/netlink.h>
|
||||
# endif
|
||||
# ifdef HAVE_LINUX_RTNETLINK_H
|
||||
# include <linux/rtnetlink.h>
|
||||
# endif
|
||||
# ifdef HAVE_IFADDRS_H
|
||||
# include <ifaddrs.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_SOCKIO_H
|
||||
# include <sys/sockio.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_UCRED_H
|
||||
# include <sys/ucred.h>
|
||||
# endif
|
||||
#endif //!WIN32
|
||||
|
||||
#if !defined(FORASTERISK) && !defined(s_addr)
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user