I need to check the connectivity of a host over a local network using C program, I do not wish to use system commands such as ping.
To check my ethernet I used gethostbyname() which depends on DNS server to resolving IP as per my knowledge.
I am building a simple c program to check my ethernet functionality where the connection is pair to pair and I have assigned the IP statically on both the devices. Is there any C library such as netdb.h available, which I can use to validate simple ethernet functionality.

  • Why bother with DNS? Why not just ping? – Mawg says reinstate Monica Feb 14 '19 at 15:22
  • I do not wish to use system default commands(customized rootfs-commands removed), rather I would like to create a custom application similar to ping. – Abhinandan Tantri Feb 15 '19 at 9:11
  • Life is too short to go reinveting the wheel. Don't you have other stuff to do? Reuse as much as you can, up to 90% of your app, if you can, and concentrate on the stuff which is new & unique to your app. – Mawg says reinstate Monica Feb 16 '19 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.