summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.pp.se>2003-06-02 08:23:47 +0000
committerThomas Habets <thomas@habets.pp.se>2003-06-02 08:23:47 +0000
commitf572d086358b63311031abc3e53c49d4fce7e01b (patch)
treea9682a009b150b5e0b919f3c8ff95362c61ed583
parentf1fab84137d1203fe4e6c9b3dca7e134830fdab8 (diff)
downloadarping-f572d086358b63311031abc3e53c49d4fce7e01b.tar.gz
fix raw mode for arping2
-rw-r--r--README37
-rw-r--r--arping-2/arping.c6
-rwxr-xr-xarping-scan-net.sh6
-rw-r--r--arping.82
-rw-r--r--arping.yodl2
5 files changed, 32 insertions, 21 deletions
diff --git a/README b/README
index ab1e086..6934408 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-$Id: README 793 2003-02-04 20:22:23Z marvin $
+$Id: README 902 2003-06-02 08:23:47Z marvin $
ARP Ping
@@ -49,19 +49,19 @@ FAQ
---
Q: It doesn't compile!
-A: Arping won't work with libnet 1.1.x. This is due to a libnet 1.1.x
+A: Arping 1.x won't work with libnet 1.1.x. This is due to libnet 1.1.x
being completely different from 1.0.x. There is no real way to
write code that works on both 1.0.x and 1.1.x.
Since I wanted to do some other things a bit differently, I wrote
- arping 2.x. It doesn't support as many architectures yet, but I'm
- working on it.
+ arping 2.x. It doesn't support as many architectures or features yet, but
+ I'm slowly working on it.
Arping 2.x (BETA) is included in this release and can be created
with "make arping2". If it doesn't compile, check the Makefile and
adjust paths.
- Once I get Arping2 working on all architectures I'll setup so that
+ Once I get Arping 2.x working on all architectures I'll setup so that
the right version is compiled automatically.
---
Q: After compiling arping without any problem, i test it first with
@@ -131,7 +131,7 @@ A: Argh! Why would you want to? Anyway, this one is due to libnets resolving,
and my unwillingness to reimplement it (in a portable manner, ugh).
-S 255.255.255.255 can be replaced with -b, and pinging broadcast (why you
- would eludes me) -B.
+ would do that eludes me) -B.
To be extra perverted, try:
# ./arping -b -B
@@ -177,6 +177,17 @@ A: Be my guest, but if care about security *at all* you will have to restrict
If you think I'm wrong, tell me why.
---
+Q: What's this -A switch all about, I don't understand it.
+
+A: Normally arping packets are sent out to some kind of broadcast (MAC or IPv4
+ broadcast) and hosts reply with source address == their address.
+
+ If -A is given, only packets coming in with a *source* address equal
+ to the *destination* address in the query is accepted.
+
+ If you don't understand, don't worry. You won't need it. But for an
+ example use, see the arping-scan-net.sh script.
+---
Q: Arping used to work (0.97 and down) for pinging MACs, but not with 0.98 and
up. What did you screw up?
@@ -208,6 +219,8 @@ Ok, two more were thought of. Both of which are non-trivially-portable.
opened device.
Arping 2.x solves the second one. Still working on the first.
+But don't use arping 2.x unless you have to. Arping 1.x has more features
+and has been tested a *lot* more.
License
-------
@@ -273,12 +286,10 @@ For pinging MAC addresses:
Note that this script will take 1 second per IP since that is how long arping
waits, so scanning a C-class net will take 256 seconds. If you have a bigger
net, then write a program that will run several arpings at the same time to
- go through more in less time.
- arping-scan-net.sh is a more capable script for scanning, but you need to
- edit it since the address range it searches is hard-coded.
- If you like this feature, mail me and I may put it into the main arping.
- But no need wasting my time if no-one wants it.
- (I'll probably add it anyway some day, but not soon)
+ go through more in less time, or check out arping-scan-net.sh, which is a
+ more capable script for scanning, but you need to edit it since the address
+ range it searches is hard-coded.
+ I may add this to arping some day, but don't hold your breath.
----------------------------------------------------------------------------
-Send questions/suggestions/patches/rants/money/sparcs to thomas@habets.pp.se
+Send questions/suggestions/patches/rants/money/alphas to thomas@habets.pp.se
diff --git a/arping-2/arping.c b/arping-2/arping.c
index 29e5a05..504fedc 100644
--- a/arping-2/arping.c
+++ b/arping-2/arping.c
@@ -12,7 +12,7 @@
*
* Also finds out IP of specified MAC
*
- * $Id: arping.c 738 2002-11-03 19:58:21Z marvin $
+ * $Id: arping.c 902 2003-06-02 08:23:47Z marvin $
*/
/*
* Copyright (C) 2000-2002 Thomas Habets <thomas@habets.pp.se>
@@ -332,10 +332,10 @@ static void pingip_recv(const char *unused, struct pcap_pkthdr *h,
}
printf("%s\n", libnet_addr2name4(ip,0));
break;
- case RAW:
+ case RRAW:
printf("%s\n", libnet_addr2name4(ip,0));
break;
- case RRAW:
+ case RAW:
for (c = 0; c < 6; c++) {
printf("%.2x%c", heth->_802_3_shost[c],
(c<5)?':':'\n');
diff --git a/arping-scan-net.sh b/arping-scan-net.sh
index 0908eb7..08114c0 100755
--- a/arping-scan-net.sh
+++ b/arping-scan-net.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: arping-scan-net.sh 859 2003-04-07 17:38:44Z marvin $
+# $Id: arping-scan-net.sh 902 2003-06-02 08:23:47Z marvin $
#
# Copyright (C) 2002 Thomas Habets <thomas@habets.pp.se>
#
@@ -40,9 +40,9 @@ TARGET_MAC="$1"
#
for a in $(seq 192 192); do
for b in $(seq 168 168); do
- for c in $(seq 42 42); do
+ for c in $(seq 0 0); do
for d in $(seq 0 255); do
- sh -c "arping -q -c 1 -T $a.$b.$c.$d $TARGET_MAC -A
+ sh -c "arping -A -q -c 1 -T $a.$b.$c.$d $TARGET_MAC
if [ \$? == 0 ]; then
echo Got answer with address: $a.$b.$c.$d
fi" &
diff --git a/arping.8 b/arping.8
index 7e85fee..e6134cf 100644
--- a/arping.8
+++ b/arping.8
@@ -13,7 +13,7 @@ One request is sent each second\&.
.PP
When pinging an IP an ARP who-has query is sent\&. When pinging a MAC
address a directed broadcast ICMP Echo request is sent\&. For more
-technical explaination, see the README file\&.
+technical explaination and an FAQ, see the README file\&.
.PP
\fIImportant note on timing\fP
.PP
diff --git a/arping.yodl b/arping.yodl
index ca62e42..43f5d52 100644
--- a/arping.yodl
+++ b/arping.yodl
@@ -13,7 +13,7 @@ manpagedescription()
When pinging an IP an ARP who-has query is sent. When pinging a MAC
address a directed broadcast ICMP Echo request is sent. For more
- technical explaination, see the README file.
+ technical explaination and an FAQ, see the README file.
em(Important note on timing)