TCP-IP



         

ICMP- - 3


51-53 , icmp_code , , .

get_type . ( 4.5).

4.5. getjype

1 static char *get_type( unsigned icmptype )

2 {

3 static char *type[] =

4 {

5 "-", /* 0*/

6 "ICMP 1", /* 1*/

7 "ICMP 2", /* 2*/

8 " ", /* 3*/

9 " ", /* 4*/

10 "", /* 5*/

11 "ICMP 6", /* 6*/

12 "ICMP 7", /* 7*/

13 "-", /* 8*/

14 " ", /* 9*/

15 " ", /* 10*/

16 " ", /* 11*/

17 " ", /* 12*/

18 " ", /* 13*/

19 " ", /* 14*/

20 " ", /* 15*/

21 " ", /* 16*/

22 " ", /* 17*/

23 " " /* 18*/

24 }

25 if ( icmptype < ( sizeof( type ) / sizeof ( type[ 0 ]) ) )

26 return type[ icmptype ];

27 return " ";

28 }

- print_unreachable. ICMP- IP- IP-, - . .