How to find the default Default IP Address if my I am connected to more than one network? I found one link
But In "Sending network layer PDUs" It is written that
PacketSender sender;
IP pkt = IP("192.168.0.1") / TCP(22) / RawPDU("foo"); sender.send(pkt);
Note that no source address was specified in the IP constructor. This uses by default the address 0.0.0.0. However, when sending network layer PDUs, if the source address is 0.0.0.0, the PDU will perform a lookup on the routing table to find out which should be the source address and automatically sets it.
So, Is there any way to find the source address using c++?