Kenneth Johansson wrote:
> 
> Andy Angrick wrote:
> 
> > Does anyone know of a more elegant way to retrieve the IP address and MAC
> > address of a network adapter other than parsing the output from ifconfig. Is
> > there a proc file where you can get this info or some other place?
> >
> > -Andy
> >
> 

unsigned char MAC[8];
    if (getHWaddr("eth0", MAC)<0) 
    {   printf("\nError reading eht0 HWaddress\n");
        return 0;
    }
    for  (i=0; i<8; ++i)        printf(".%d", MAC[i]);

Best Regards,
Luc
<http://www.dobit.com/emblin>


--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.

Reply via email to