Reputation: 13
I'm writing a simple library for checking the internet access status of network interfaces by C on Linux.
Would you please give me where i can refer ( such as documents, example code ...) or any hints?
Upvotes: 1
Views: 1121
Reputation: 239041
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.
Upvotes: 1