aboutsummaryrefslogtreecommitdiffstats
path: root/in_cksum.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2002-08-02 23:36:07 +0000
committerJörg Mayer <jmayer@loplof.de>2002-08-02 23:36:07 +0000
commit173fe5aef4167b9ad35fe514d05ef25fb66c076f (patch)
tree21967e4c27ac5e02aa39319022dd2858682fc5f4 /in_cksum.c
parentff72b97ee01caee4dff97d07195d802086c65f38 (diff)
Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
Diffstat (limited to 'in_cksum.c')
-rw-r--r--in_cksum.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/in_cksum.c b/in_cksum.c
index ff07a0ad2c..66ee16a843 100644
--- a/in_cksum.c
+++ b/in_cksum.c
@@ -2,7 +2,7 @@
* 4.4-Lite-2 Internet checksum routine, modified to take a vector of
* pointers/lengths giving the pieces to be checksummed.
*
- * $Id: in_cksum.c,v 1.6 2002/07/21 20:31:21 guy Exp $
+ * $Id: in_cksum.c,v 1.7 2002/08/02 23:35:46 jmayer Exp $
*/
/*
@@ -40,22 +40,10 @@
# include "config.h"
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
#include <glib.h>
#include "in_cksum.h"
@@ -210,7 +198,7 @@ in_cksum_shouldbe(guint16 sum, guint16 computed_sum)
* will be in host byte order, which is what we'll return.
*/
shouldbe = sum;
- shouldbe += ntohs(computed_sum);
+ shouldbe += g_ntohs(computed_sum);
shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
return shouldbe;