在C/C ++中找到可用的网络接口? [英] Find available network interfaces in C/C++?

查看:70
本文介绍了在C/C ++中找到可用的网络接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道用于查找可用网络接口的C/C ++代码吗?

Does anyone know a C/C++ code for finding the network interfaces available?

我一直在寻找一些代码,但是大多数时候它们都很复杂.有没有简单的方法可以做到这一点?

I've been looking for some code, but most times they are quite complex. Is there a simple way to do this?

推荐答案

请参见

See the getifaddrs man page. There is an example program towards the end.

这篇关于在C/C ++中找到可用的网络接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆