LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Where is the MAC Number stored? (https://www.linuxquestions.org/questions/linux-networking-3/where-is-the-mac-number-stored-230891/)

shivanu 09-15-2004 08:36 AM

Where is the MAC Number stored?
 
Hello,
I am trying to store the MAC number using a C program. So was wondering where it is stored. Also, though i can see the MAC number on the console by using ifconfig, I cannot store it. Is there a way to store the result of ifconfig or for that matter any system command like that onto a file?

Thanks
Shivanu

ElmPie 09-15-2004 08:40 AM

Hey,

normally the MAC address is stored in the NIC itself. I guess when your NIC provides functionality to replace this MAC address you can do it.

The brand of your NIC should provide you with these tools.

You can store output from programs like this :

ifconfig > yourdetails.txt


Hope I was of any help.

Ps.: if your NIC supports MAC replacing, what brand and type are you using? Thanks.

scowles 09-15-2004 08:51 AM

Can't help you with your C program, but the output of any command can be redirected to a file or even another program (pipe) using the shells redirection capabilites. i.e. >, >> ,etc...

See: man bash

Jump down to the chapter labeled REDIRECTION. i.e. At the first man prompt (colon), type /REDIRECTION
At the next man prompt, type 'n' (without the quotes) to search for the next occurance of REDIRECTION.
You should arrive at your answer on the second search.

mirradric 09-15-2004 09:35 AM

for redirection in c you might want to have a look at the dup2 and popen calls

mirradric 09-15-2004 10:14 AM

I found this on a google search.....


http://www.linuxquestions.org/questi...003/03/3/38217


All times are GMT -5. The time now is 07:52 AM.