开发者

Checking whether Network IF can access Internet in C Linux?

I'm writing a simple library for checki开发者_运维知识库ng the internet access status of network interfaces by C on Linux.

  • Checking the status for all network interfaces (configured or not configured)

Would you please give me where i can refer ( such as documents, example code ...) or any hints?


The simplest method is probably to check for the existence of a default route through that interface. You could call out to /bin/ip route to do this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜