cvs updates from Wed Dec 15 17:45:22 EST 2010
[tridge/bind9.git] / bin / check / check-tool.c
index 09fd2c9900606a6c65e44a20dd7447563900170c..422d9b1cde98f59555340a7ed9c8ba2718934360 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2009  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000-2002  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: check-tool.c,v 1.39 2009/09/01 00:22:24 jinmei Exp $ */
+/* $Id: check-tool.c,v 1.41 2010/09/07 23:46:59 tbox Exp $ */
 
 /*! \file */
 
 
 #include <stdio.h>
 
+#ifdef _WIN32
+#include <Winsock2.h>
+#endif
+
 #include "check-tool.h"
 #include <isc/buffer.h>
 #include <isc/log.h>
@@ -661,3 +665,26 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
 
        return (result);
 }
+
+#ifdef _WIN32
+void
+InitSockets(void) {
+       WORD wVersionRequested;
+       WSADATA wsaData;
+       int err;
+
+       wVersionRequested = MAKEWORD(2, 0);
+
+       err = WSAStartup( wVersionRequested, &wsaData );
+       if (err != 0) {
+               fprintf(stderr, "WSAStartup() failed: %d\n", err);
+               exit(1);
+       }
+}
+
+void
+DestroySockets(void) {
+       WSACleanup();
+}
+#endif
+