![]() |
|
![]() | ||
|
Subject:
need source code for unix-style ICMP ping for windows
Category: Computers > Programming Asked by: hl_slaughter-ga List Price: $25.00 |
Posted:
05 Jul 2002 19:04 PDT
Expires: 22 Jul 2002 17:01 PDT Question ID: 36921 |
i've been searching for and have not found the source code for a commandline based ping program for winNT that meets the following criteria: - written in C (not C++ C# but *C*) - no use of any windows API garbage (except for winsock or maybe ICMP.dll) - compiles with gcc (not MS Visual crap or Borland) on windows. should compile under the Cygwin environment or something similar (ie unix for windows) i am looking for something that demonstrates a simple ICMP echo request i'm attempting to port a network scanning app to windows. i've gotten everything to compile but the ping module because i am not familiar with how to fake berkeley style sockets and ICMP under Winblows. tks |
![]() | ||
|
There is no answer at this time. |
The following answer was rejected by the asker (they received a refund for the question). | |
Subject:
Re: need source code for unix-style ICMP ping for windows
Answered By: blader-ga on 11 Jul 2002 14:34 PDT Rated: ![]() |
Dear hl_slaughter: I have found two pieces of source code that may fit your needs. One is the original ping source code by Mike Muuss, and the other is a modification of it to receive time stamps (rather than time delay). Both are purported to work uunder GCC, but I don't have GCC on my system to test it. If you have any problems with them, let me know: Here is the original source code by Mike Muuss: http://www.programmersheaven.com/zone15/cat241/2417.htm This is the source code on which all other ping programs are based upon. Here is the icmpquery.c modification: http://www.angio.net/security/icmpquery.c The comments from the above source code: * Verified to work on: * FreeBSD (2.x, 3.x) * Linux 2.0.x, 2.2.0-pre1 * NetBSD 1.3 * * Should work on Solaris and other platforms with BSD-ish stacks. * * If you compile it somewhere else, or it doesn't work somewhere, * please let me know. * * Compilation: gcc icmpquery.c -o icmpquery * * One usage note: In order to receive accurate time information, * the time on your computer must be correct; the * ICMP timestamp reply is a relative time figure. Google Search Terms: icmp ping source code gcc ://www.google.com/search?q=icmp+ping+source+code+gcc&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&start=10&sa=N I hope this was what you were looking for! If you have any problems or need any clarifications, please don't hesitate to ask. I would be more than happy to assist you further. Best Regards, blader-ga | |
|
![]() | ||
|
Subject:
Re: need source code for unix-style ICMP ping for windows
From: donq-ga on 05 Jul 2002 20:26 PDT |
Hello hl_slaughter, In this link (http://www.sockaddr.com/ExampleSourceCode.html) you can find a file named Ping.zip which is described as a Ping program using ICMP and RAW sockets. I looked over the source code in the zip file, and it was written in regular C (not CPP or C#). The source uses winsock.h. I am presently unable to verify if the file(s) compile with gcc. Hope this comment was useful to you. |
Subject:
Re: need source code for unix-style ICMP ping for windows
From: hl_slaughter-ga on 07 Jul 2002 23:58 PDT |
thanks for the link. i'm checking it out. it may be what i need. it doesn't compile under cygwin, but the errors may be minor. if i can make this work, you can claim the answer : ) |
Subject:
Re: need source code for unix-style ICMP ping for windows
From: hl_slaughter-ga on 08 Jul 2002 11:29 PDT |
see, this is what i hate about trying to work with windows. not sure if this is an issue with cygwin or winsock, but i get conflicting definitions. Administrator@HARRYS-VM /cygdrive/h/ant/src/ws2_ping $ gcc ping.c In file included from ping.c:7: /usr/include/w32api/winsock.h:82: warning: #warning "fd_set and associated macro s have been defined in sys/types. This can cause runtime problems with W32 sockets" ping.c: In function `main': ping.c:24: warning: return type of `main' is not `int' ping.c: In function `WaitForEchoReply': ping.c:221: structure has no member named `fd_count' ping.c:222: structure has no member named `fd_array' Administrator@HARRYS-VM /cygdrive/h/ant/src/ws2_ping there's a good thread on this topic here: http://sources.redhat.com/ml/newlib/2001/msg00124.html unfortunately there's no mention of what a humble, lowly guy like myself is supposed to do about this (other than wait for patches). there's no way i'm going to try to hunt down definition conflicts within multi-nested includes (and have anything that works afterwards). i know someone has suffered through this before me in order that i may live in freedom from compile errors. where is the mythical ping program that compiles under cygwin? |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |