Вопрос

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