icmpcode_v4.c

来自「unix network ,unix network unix networ」· C语言 代码 · 共 28 行

C
28
字号
#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;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?