For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > December 2004 > Plz Help!!.....ARP-request----arpwhohas()?????









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Plz Help!!.....ARP-request----arpwhohas()?????
ANaiveProgrammer

2004-12-14, 4:08 pm

Hi All
I've been trying to figure out how to send an ARP-Request request
since long, but im stumped. Somebody told me that you have to use
RAW-Sockets for that, but how, and this "How" is beyond my
comprehension. Moreover, i have also seen RAW FAQ's and that is not
very helpful either. I mean i know how to create an ARP-Request Header
and Ethernet Header using structs , and how to avoid byte padding by
assigning these structs to U_char arrays, but this Raw-socket usage in
terms of sending ARP-Request is beyond my comprehension. Would you
please tell me how to send an ARP-Request-broadcast over a LAN( so
that every node attached to my LAN must receive this arp-request) by
using RAW-Sockets?????..please answer this question, any
pointers/comments/guidelines will be highly
appreciated..........................

I was just going through TCP/IP illustrated vol 2. Section 21.5 Page
683, and i found a "arpwhohas()" function that takes two parameters
namely:
struct arpcom *ac;//&
struct in_addr *addr;

furthermore, i found that arpwhohas() function , in turn, calls
arprequest() function. So my question is can we send an ARP-Request on
Ethernet by directly calling this arpwhohas() function , by just
providing the required arguments? if so, then how????
and if we can't send ARP-Request by calling above , why can't??
i will be more than glad if you take some time off and give me some
invaluable suggestions out of your valuable time.
Thanking in anticipation.
Regards
Waqas
Kasper Dupont

2004-12-14, 9:01 pm

ANaiveProgrammer wrote:
>
> Hi All
> I've been trying to figure out how to send an ARP-Request request
> since long, but im stumped. Somebody told me that you have to use
> RAW-Sockets for that, but how, and this "How" is beyond my
> comprehension.


You could take a look at the source code for arping.

> So my question is can we send an ARP-Request on
> Ethernet by directly calling this arpwhohas() function , by just
> providing the required arguments?


Never heard about it.

--
Kasper Dupont
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com