lkml.org 
[lkml]   [1999]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Userlevel ARP request
Date
Mike Panetta wrote:
>
> Does the socket code in the kernel allow one to do a userlevel
> arp? I want to create a user level "arp ping" type program
> that if given an IP will report wether or not a machine is on that address
> given an arp reply on the IP. Is this possible? This is to work around
> a windows TCP/IP "bug"...
>
> --
> Mike Panetta
>
Hi,

yes this can be done with a PF_PACKET socket. You have a choice of
SOCK_RAW (with datalink headers) or SOCK_DGRAM (a slightly more cooked
mode of operation). Probably you would do something like:

s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ARP));

You can restrict this to a single device with bind() too if you want to.
man 4 packet has more information,

Steve.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.211 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site