1 namespace System.Net.NetworkInformation
2 {
3     //these are used for the status fields in icmpsendecho and its variants
4     //the problem is that some of these are icmp errors that we care about and would
5     //be returned in the reply structure.  Others are something we should throw on.
6 
7     internal enum IcmpV4Type
8     {
9         //can map these
10         ICMP4_ECHO_REPLY        =  0, // Echo Reply.
11         ICMP4_DST_UNREACH       =  3, // Destination Unreachable.
12         ICMP4_SOURCE_QUENCH     =  4, // Source Quench.
13         ICMP4_TIME_EXCEEDED     = 11, // Time Exceeded.
14         ICMP4_PARAM_PROB        = 12, // Parameter Problem.
15 
16         //unmappable
17         ICMP4_REDIRECT          =  5, // Redirect.
18         ICMP4_ECHO_REQUEST      =  8, // Echo Request.
19         ICMP4_ROUTER_ADVERT     =  9, // Router Advertisement.
20         ICMP4_ROUTER_SOLICIT    = 10, // Router Solicitation.
21         ICMP4_TIMESTAMP_REQUEST = 13, // Timestamp Request.
22         ICMP4_TIMESTAMP_REPLY   = 14, // Timestamp Reply.
23         ICMP4_MASK_REQUEST      = 17, // Address Mask Request.
24         ICMP4_MASK_REPLY        = 18, // Address Mask Reply.
25     }
26 
27     internal enum IcmpV4Code{
28         ICMP4_UNREACH_NET                =  0,
29         ICMP4_UNREACH_HOST               =  1,
30         ICMP4_UNREACH_PROTOCOL           =  2,
31         ICMP4_UNREACH_PORT               =  3,
32         ICMP4_UNREACH_FRAG_NEEDED        =  4,
33         ICMP4_UNREACH_SOURCEROUTE_FAILED =  5,
34         ICMP4_UNREACH_NET_UNKNOWN        =  6,
35         ICMP4_UNREACH_HOST_UNKNOWN       =  7,
36         ICMP4_UNREACH_ISOLATED           =  8,
37         ICMP4_UNREACH_NET_ADMIN          =  9,
38         ICMP4_UNREACH_HOST_ADMIN         = 10,
39         ICMP4_UNREACH_NET_TOS            = 11,
40         ICMP4_UNREACH_HOST_TOS           = 12,
41         ICMP4_UNREACH_ADMIN              = 13,
42     }
43 
44 
45     public enum IPStatus
46     {
47         Success = 0,
48         //BufferTooSmall = 11000 + 1,
49 
50         DestinationNetworkUnreachable = 11000 + 2,
51         DestinationHostUnreachable = 11000 + 3,
52         DestinationProtocolUnreachable = 11000 + 4,
53         DestinationPortUnreachable = 11000 + 5,
54         DestinationProhibited = 11000 + 4,
55 
56         NoResources = 11000 + 6,
57         BadOption = 11000 + 7,
58         HardwareError = 11000 + 8,
59         PacketTooBig = 11000 + 9,
60         TimedOut = 11000 + 10,
61       //  BadRequest = 11000 + 11,
62         BadRoute = 11000 + 12,
63 
64         TtlExpired = 11000 + 13,
65         TtlReassemblyTimeExceeded = 11000 + 14,
66 
67         ParameterProblem = 11000 + 15,
68         SourceQuench = 11000 + 16,
69         //OptionTooBig = 11000 + 17,
70         BadDestination = 11000 + 18,
71 
72         DestinationUnreachable = 11000 + 40,
73         TimeExceeded = 11000 + 41,
74         BadHeader = 11000 + 42,
75         UnrecognizedNextHeader = 11000 + 43,
76         IcmpError = 11000 + 44,
77         DestinationScopeMismatch = 11000 + 45,
78         Unknown = -1,
79     }
80 }
81