MSH
MSH

Reputation: 429

How to get all network interface name and information in c++

Is it possible to get all network interfaces(whether up or down) name and available information in Linux using c++? I mean a program that only uses API to get interface's name. Does "ioctl" print down interfaces?

Upvotes: 4

Views: 14840

Answers (1)

PherricOxide
PherricOxide

Reputation: 15909

Not specially for C++, but you can use the C API and the 'getifaddrs' function to do so: http://man7.org/linux/man-pages/man3/getifaddrs.3.html

Upvotes: 4

Related Questions