Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make arping compile on Windows again #10

Open
ThomasHabets opened this issue Feb 29, 2012 · 1 comment
Open

Make arping compile on Windows again #10

ThomasHabets opened this issue Feb 29, 2012 · 1 comment

Comments

@ThomasHabets
Copy link
Owner

I (Thomas) will probably not be doing this. I'm adding this issue in case someone else wants to take it on.

It shouldn't be that much work. Arping 2.05 compiled on Windows (not by me and I don't know how, but I have the .exe so I know it worked) and there haven't been that many changes since then.

@ThomasHabets
Copy link
Owner Author

Backup of an old patch:

--- ../../download/arping-2.06/arping-2/arping.c    2007-09-13 12:43:38.000000000 -0400
+++ arping.c    2007-09-15 15:02:36.031250000 -0400
@@ -49,14 +49,20 @@
 #endif

 #ifdef WIN32
-#include <win32/libnet.h>
+#include <libnet.h>
+#ifndef HAVE_GETGID
+#define getgid() 0
+#endif
+#ifndef HAVE_GETUID
+#define getuid() 0
+#endif
 #endif
 #include <pcap.h>

 #if defined(WIN32)
 #define HAVE_ESIZE_TYPES 1
-#include "win32.h"
-#include "win32/getopt.h"
+//#include "win32.h"
+#include <getopt.h>
 #endif

 #if !defined(linux)
@@ -762,7 +768,7 @@
               tv.tv_sec--;
               tv.tv_usec += 1000000;
           }
-          usleep(10);
+          Sleep(10);
           if (tv.tv_sec < 0) {
               done=1;
           }
@@ -844,7 +850,7 @@
               break;
           default: {
 #else
-          usleep(10);
+          Sleep(10);
           {{
 #endif
               int ret;
@@ -852,8 +858,8 @@
                             func,
                             NULL))) {
                   // rest, so we don't take 100% CPU... mostly
-                  // hmm... does usleep() exist everywhere?
-                  usleep(10);
+                  // hmm... does Sleep() exist everywhere?
+                  Sleep(10);
 #ifndef HAVE_WEIRD_BSD
                   // weird is normal on bsd :)
                   if (verbose) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant