* 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.9 2002/08/28 21:00:06 jmayer Exp $
*/
/*
# 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"
* of a word spanning between this chunk and the
* last chunk.
*
- * s_util.c[0] is already saved when scanning previous
+ * s_util.c[0] is already saved when scanning previous
* chunk.
*/
s_util.c[1] = *(const guint8 *)w;
* 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;