]> The Tcpdump Group git mirrors - libpcap/blobdiff - sockutils.h
Clean up sockutils.h.
[libpcap] / sockutils.h
index 654e174c62cba73a9df12a57f25ff2fec3126d93..f2c56ac6cc5f21ff1e607cf8dfb836b75051c876 100644 (file)
 
 #include "pcap/socket.h"
 
-#ifdef _WIN32
-#else
+#ifndef _WIN32
   /* UN*X */
-  #include <stdio.h>
-  #include <string.h>  /* for memset() */
-  #include <sys/types.h>
-  #include <sys/socket.h>
-  #include <netdb.h>   /* DNS lookup */
   #include <unistd.h>  /* close() */
-  #include <errno.h>   /* errno() */
-  #include <netinet/in.h> /* for sockaddr_in, in BSD at least */
-  #include <arpa/inet.h>
-  #include <net/if.h>
-
-  /*!
-   * \brief In Winsock, a socket handle is of type SOCKET; in UN*X, it's
-   * a file descriptor, and therefore a signed integer.
-   * We define SOCKET to be a signed integer on UN*X, so that it can
-   * be used on both platforms.
-   */
-  #ifndef SOCKET
-    #define SOCKET int
-  #endif
-
-  /*!
-   * \brief In Winsock, the error return if socket() fails is INVALID_SOCKET;
-   * in UN*X, it's -1.
-   * We define INVALID_SOCKET to be -1 on UN*X, so that it can be used on
-   * both platforms.
-   */
-  #ifndef INVALID_SOCKET
-    #define INVALID_SOCKET -1
-  #endif
 
   /*!
    * \brief In Winsock, the close() call cannot be used on a socket;