I need to bring an interface up/down from C++ running on Linux, and set the IP/netmask (And I use Qt in case that helps).

I need to create the equivalent capability of the ifconfig command from within c++. Is there an interface/library available to help me do this?

有帮助吗?

解决方案

You have to do it through ioctls: /usr/include/linux/sockios.h Welcome to Linux!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top