[Ilugc] query about the kernel function arp_send

  • From: cyborg4k@xxxxxxxxx (Shakthi Kannan)
  • Date: Tue Jan 31 22:30:57 2006

Dear Muneer and others,

--- Muneer <muneerch@xxxxxxxxx> wrote:

    I was writing a code in kernel space to send an
arp reply, upon

Any particular reason to do it in kernel space?

receiving a request which is not intended to me (I
want to "fake :-) "

I would set eth0 to promiscuous mode so it will
capture all packets, and then write a simple
application code using libpcap, libnet libraries. You
will need to be root to run your application.

http://www.packetfactory.net/libnet/

http://www.tcpdump.org/

 the requester). I came across a function arp_send
in
src/linux-2.4.18-14/net/ipv4/arp.c which I felt very
straight forward
for my requirement.

You have to keep re-compiling it and testing it. If
your target system is on a different system and you
can boot via NFS, its an idea environment for
development.

If you are compiling and testing on the same machine
(host and target), then its time consuming. You are
better off in doing it in user-space.

I wanted to know whether this function is available
on all versions of
linux? 

Should be. It implements the ARP protocol (RFC 826).

http://lxr.linux.no/source/

HTH,

SK

--
Shakthi Kannan, MS
Software Engineer, Hexaware Technologies
[E]: cyborg4k@xxxxxxxxx              [M]: (91) 98407-87007
[W]: http://www.shakthimaan.com      [L]: Chennai, India

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ;

Other related posts: