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 |
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. |
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. |
for redirection in c you might want to have a look at the dup2 and popen calls
|
|
All times are GMT -5. The time now is 07:52 AM. |