I have developed an application that partially replicates the functionality of the builtin ping application, essentially sending an ICMP packet, receiving the response, and parsing the header.
However, I want to report any error messages received. The problem I'm running into is trying to ping a host/address in such a way that I get ICMP type 3 with some type of ICMP code (presumably codes 0-7, but I'm not picky).
I've tried pinging a bogus address on a different, nonexistent, thinking my router will send out this message, but it doesn't happen, it just times out. Windows ping
behaves the same way though.
Aside from setting up a linux box running a service that responds to all pings with type 3 and random codes, is there a way I can test this functionality? Are these codes arcane, obsolete, or otherwise not used?