Hi.
Is there any possible way in which i can disable and enable the NIC using C or C++ code?
Where can i get such codes??
Do other languages perform such functionality. If yes, which are they?
Thanks..
Printable View
Hi.
Is there any possible way in which i can disable and enable the NIC using C or C++ code?
Where can i get such codes??
Do other languages perform such functionality. If yes, which are they?
Thanks..
Depends on what you mean by "disable" and "enable". Whatever you wish to do to it is dependent upon the O/S. Check out what your O/S can do to the NIC card. It will be limited to your program's access, as well as other factors.
MSDN for Windows. For *nix systems.... check man pages and probably 100 other areas.
Any language that can directly access O/S APIs.
Moved to Networking/Device Communication.
One way of doing this is to set the Default Gateway to the loopback interface 127.0.0.1
if your are on *nix u could use this command
ssharish20058Code:ifconfig eth0 down
>>One way of doing this is to set the Default Gateway to the loopback interface 127.0.0.1
How do we do this using C?
Any special primitives available?? I'm doing it on the Windows platform.
Here is the link to Network management using WMI http://msdn2.microsoft.com/en-us/library/aa394595.aspx
And this is the link http://msdn2.microsoft.com/en-us/library/aa394558.aspx to C++ samples on using WMI. I don't think it is too hard to modify them into C-code
>>One way of doing this is to set the Default Gateway to the loopback interface 127.0.0.1
How do i enable the network card after doing this??