There are ioctls for this.

For the MAC address:
SIOCGIFHWADDR

For the IP address:
SIOCGIFADDR

For the Sub net mask:
SIOCGIFNETMASK

There are also equivalent set ioctls for the address and mask. (Substitue G with
S in the names).

(Look at the ifconfig source code if unsure how to use them).

Malcolm.

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


--
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