Re: function to get mac address in kernel

From: Amit Kucheria (amitk@ittc.ukans.edu)
Date: Fri May 25 2001 - 13:07:26 EST


What is the way to read the /proc filesystem from the kernel ?

I cannot "ping" the machine since i am writing this code in the kernel. It
should just look for the mac address of an ethernet device and return it.

Regards,
Amit

On Fri, 25 May 2001, raghu arni wrote:

> you can get the list of addresses the system "knows" from /proc/net/arp.
>
> If you do not find it then ping the machine which will add an entry to the
> arp table and then re-read /proc/net/arp.
>
> This is kind of cleaner because even if the method names change your code
> need not change..
>
> hth,
> A
>
>
> > Hi all,
> >
> > Is there a function in the kernel which will return the mac address when
> > passed an IP address of a ethernet device ?
> >
> > I didnt understand what arp_bind_neighbour does.
> >
> > Regards,
> > Amit
> > --

-- 
^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^
                  Amit Kucheria
          EECS Grad. Research Assistant
           Team Niehaus || Room # 245E
         University of Kansas @ Lawrence
   (R)+1-(785)-830 8521 ||| (O)+1-(785)-864 7774
____________________________________________________

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org



This archive was generated by hypermail 2b29 : Thu May 31 2001 - 21:00:57 EST