#include "trace.h" const char * icmpcode_v4(int code) { static char errbuf[100]; switch (code) { case 0: return("network unreachable"); case 1: return("host unreachable"); case 2: return("protocol unreachable"); case 3: return("port unreachable"); case 4: return("fragmentation required but DF bit set"); case 5: return("source route failed"); case 6: return("destination network unknown"); case 7: return("destination host unknown"); case 8: return("source host isolated (obsolete)"); case 9: return("destination network administratively prohibited"); case 10: return("destination host administratively prohibited"); case 11: return("network unreachable for TOS"); case 12: return("host unreachable for TOS"); case 13: return("communication administratively prohibited by filtering"); case 14: return("host recedence violation"); case 15: return("precedence cutoff in effect"); default: sprintf(errbuf, "[unknown code %d]", code); return errbuf; } }