Re: MAC address for Ethernet interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 12 Dec 2003, Vamsi Kambhampati wrote:

> 
> On Linux, this would be /sbin/ifconfig (and look for a line which says 
> 'eth0' and a field next to it called 'HWaddr xx:xx:xx:xx:xx:xx').
> 
> On Windows, this would be 'ipconfig' and should have a similar interface.
>
He was actually asking as I understood it how to get it via a kernel 
system call or some api, I believe.  Unfortunately, I don't know exactly
how to do this, but here is how I would find out.   What I would do is 
get the source code for ifconfig and try to determine what it did to get 
that information  I am pretty sure its just a simple ioctl.  A hint I can
give you is that ioctl's to network devices use an fd of a socket rather 
than a device file (just read this in the Linux Journal (-;).  

Cheers...james 
> -- Vamsi
> --------------------------------------------------------
> Vamsi K Kambhampati                Assistant Systems
> vamsi@xxxxxxxxxxxxxxxx            office: 970-491-5305
> 
> On 12 Dec 2003, anil  garrepally wrote:
> 
> > Hi,
> 
> Is there any system call available for getting the MAC address of ethernet interface. I need it in my program.
> 
> Anil.
> 
> 
> _______________________________________________
> Redhat-devel-list mailing list
> Redhat-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/redhat-devel-list
> 


_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux