My UBUNTU machine is having two network interface ports. I want to write an application in C/C++ where I can detect changes in network interface and print the result.
e.g. When two network cables are connected then application should print both interfaces are up. When I unplug one cable then application should remove all information of that interface and print which interface is down and up.