Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/act365/net/icmp/ICMP.java


1   /*
2     * JSocket Wrench
3     * 
4     * Copyright (C) act365.com October 2003
5     * 
6     * Web site: http://www.act365.com/wrench
7     * E-mail: developers@act365.com
8     * 
9     * The JSocket Wrench library adds support for low-level Internet protocols
10    * to the Java programming language.
11    * 
12    * This program is free software; you can redistribute it and/or modify it 
13    * under the terms of the GNU General Public License as published by the Free 
14    * Software Foundation; either version 2 of the License, or (at your option) 
15    * any later version.
16    *  
17    * This program is distributed in the hope that it will be useful, 
18    * but WITHOUT ANY WARRANTY; without even the implied warranty of 
19    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
20    * Public License for more details.
21    * 
22    * You should have received a copy of the GNU General Public License along with 
23    * this program; if not, write to the Free Software Foundation, Inc., 
24    * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25    */
26  
27  package com.act365.net.icmp ;
28  
29  /**
30   The ICMP interface defines the constants associated with the ICMP protocol.
31  */
32  
33  public interface ICMP {
34  
35    /**
36     ICMP types
37    */
38  
39    public static byte ICMP_ECHOREPLY      = 0 ,
40                       ICMP_DEST_UNREACH   = 3 ,
41                       ICMP_SOURCE_QUENCH  = 4 ,
42                       ICMP_REDIRECT       = 5 ,
43                       ICMP_ECHO           = 8 ,
44                       ICMP_ROUTERADVERT   = 9 ,
45                       ICMP_ROUTERSOLICIT  = 10 ,
46                       ICMP_TIME_EXCEEDED  = 11 ,
47                       ICMP_PARAMETERPROB  = 12 ,
48                       ICMP_TIMESTAMP      = 13 ,
49                       ICMP_TIMESTAMPREPLY = 14 ,
50                       ICMP_INFO_REQUEST   = 15 ,
51                       ICMP_INFO_REPLY     = 16 ,
52                       ICMP_ADDRESS        = 17 ,
53                       ICMP_ADDRESSREPLY   = 18 ;
54  
55    /**
56     Labels associated with ICMP types
57    */
58  
59    public static String[] typelabels = { "Echo Reply" ,
60                                          "" ,
61                                          "" ,
62                                          "Destination Unreachable" ,
63                                          "Source Quench" ,
64                                          "Redirect" ,
65                                          "" ,
66                                          "" ,
67                                          "Echo Request" ,
68                                          "Router Advertisment" ,
69                                          "Router Solicitation" ,
70                                          "Time Exceeded" ,
71                                          "Parameter Problem" ,
72                                          "Timestamp Request" ,
73                                          "Timestamp Reply" ,
74                                          "Information Request" ,
75                                          "Information Reply" ,
76                                          "Address Mask Request",
77                                          "Address Mask Reply" };
78  
79    /**
80     Codes for the ICMP_DEST_UNREACH type
81    */ 
82  
83    public static byte ICMP_NET_UNREACH    = 0 ,
84                       ICMP_HOST_UNREACH   = 1 ,
85                       ICMP_PROT_UNREACH   = 2 ,
86                       ICMP_PORT_UNREACH   = 3 ,
87                       ICMP_FRAG_NEEDED    = 4 ,
88                       ICMP_SR_FAILED      = 5 ,
89                       ICMP_NET_UNKNOWN    = 6 ,
90                       ICMP_HOST_UNKNOWN   = 7 ,
91                       ICMP_HOST_ISOLATED  = 8 ,
92                       ICMP_NET_ANO        = 9 ,
93                       ICMP_HOST_ANO       = 10 ,
94                       ICMP_NET_UNR_TOS    = 11 ,
95                       ICMP_HOST_UNR_TOS   = 12 ,
96                       ICMP_PKT_FILTERED   = 13 ,
97                       ICMP_PREC_VIOLATION = 14 ,
98                       ICMP_PREC_CUTOFF    = 15 ;
99  
100   /**
101    Labels associated with the ICMP_DEST_UNREACH type
102   */
103 
104   public static String[] unreachlabels = { "Network Unreachable" ,
105                                            "Host Unreachable" ,
106                                            "Protocol Unreachable" ,
107                                            "Port Unreachable" ,
108                                            "Fragmentation necessary but DF bit set" ,
109                                            "Source Route failed" ,
110                                            "Destination Network Unknown" ,
111                                            "Destination Host Unknown" ,
112                                            "Source Host Isolated (obsolete)" ,
113                                            "Destination Network Administratively Prohibited" ,
114                                            "Destination Host Administratively Prohibited" ,
115                                            "Network Unreachable for TOS" ,
116                                            "Host Unreachable for TOS" ,
117                                            "Communication Administratively Prohibited by Filtering" ,
118                                            "Host Precedence Violation" ,
119                                            "Precedence Cutoff in effect" };
120 
121   /**
122    Codes associated with the ICMP_REDIRECT type
123   */
124 
125   public static int ICMP_REDIR_NET     = 0 ,
126                     ICMP_REDIR_HOST    = 1 ,
127                     ICMP_REDIR_NETTOS  = 2 ,
128                     ICMP_REDIR_HOSTTOS = 3 ;
129 
130   /**
131    Labels associated with the ICMP_REDIRECT type
132   */
133 
134   public static String[] redirectlabels = { "Redirect for Network" ,
135                                             "Redirect for Host" ,
136                                             "Redirect for Type-of-Service and Network" ,
137                                             "Redirect for Type-of-Service and Host" };
138 
139   /**
140    Codes associated with the ICMP_TIME_EXCEEDED type
141   */
142 
143   public static int ICMP_EXC_TTL      = 0 ,
144                     ICMP_EXC_FRAGTIME = 1 ;
145 
146   /**
147    Labels associated with the ICMP_TIME_EXCEEDED type
148   */
149 
150   public static String[] timeexceededlabels = { "TTL count exceeded during transit" ,
151                                                 "TTL count exceeded during reassembly" };
152 
153 }
154