Enumerating each IP address assigned to network interfaces

后端 未结 4 1357
栀梦
栀梦 2021-01-03 11:10

I think there is no way to enumerate each network interface on my system and their assigned IP address using just sockets. Is this correct?

I mean, in Linux this cou

4条回答
  •  被撕碎了的回忆
    2021-01-03 11:52

    Take a look at the ioctl() function. If I recall correctly, you can use it to obtain information on any interface, as well as obtaining the available interfaces.

    I don't remember the correct invocation though. As with fcntl(), it takes a request argument plus variable parameters that determine its behaviour.

提交回复
热议问题