icmp.h

Go to the documentation of this file.
00001 /**
00002 *
00003 
00004  * INET         An implementation of the TCP/IP protocol suite for the LINUX
00005  *              operating system.  INET is implemented using the  BSD Socket
00006  *              interface as the means of communication with the user level.
00007  *
00008  *              Definitions for the ICMP protocol.
00009  *
00010  * Version:     @(#)icmp.h      1.0.3   04/28/93
00011  *
00012  * Author:      Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
00013  *
00014  *              This program is free software; you can redistribute it and/or
00015  *              modify it under the terms of the GNU General Public License
00016  *              as published by the Free Software Foundation; either version
00017  *              2 of the License, or (at your option) any later version.
00018 
00019 
00020 */
00021 #ifndef _LINUX_ICMP_H
00022 #define _LINUX_ICMP_H
00023 
00024 #define ICMP_ECHOREPLY          0       ///< Echo Reply                 
00025 #define ICMP_DEST_UNREACH       3       ///< Destination Unreachable    
00026 #define ICMP_SOURCE_QUENCH      4       ///< Source Quench              
00027 #define ICMP_REDIRECT           5       ///< Redirect (change route)    
00028 #define ICMP_ECHO               8       ///< Echo Request                       
00029 #define ICMP_TIME_EXCEEDED      11      ///< Time Exceeded              
00030 #define ICMP_PARAMETERPROB      12      ///< Parameter Problem          
00031 #define ICMP_TIMESTAMP          13      ///< Timestamp Request          
00032 #define ICMP_TIMESTAMPREPLY     14      ///< Timestamp Reply            
00033 #define ICMP_INFO_REQUEST       15      ///< Information Request                
00034 #define ICMP_INFO_REPLY         16      ///< Information Reply          
00035 #define ICMP_ADDRESS            17      ///< Address Mask Request               
00036 #define ICMP_ADDRESSREPLY       18      ///< Address Mask Reply         
00037 
00038 
00039 /// Codes for UNREACH. 
00040 #define ICMP_NET_UNREACH        0       ///< Network Unreachable                
00041 #define ICMP_HOST_UNREACH       1       ///< Host Unreachable           
00042 #define ICMP_PROT_UNREACH       2       ///< Protocol Unreachable               
00043 #define ICMP_PORT_UNREACH       3       ///< Port Unreachable           
00044 #define ICMP_FRAG_NEEDED        4       ///< Fragmentation Needed/DF set        
00045 #define ICMP_SR_FAILED          5       ///< Source Route failed                
00046 #define ICMP_NET_UNKNOWN        6
00047 #define ICMP_HOST_UNKNOWN       7
00048 #define ICMP_HOST_ISOLATED      8
00049 #define ICMP_NET_ANO            9
00050 #define ICMP_HOST_ANO           10
00051 #define ICMP_NET_UNR_TOS        11
00052 #define ICMP_HOST_UNR_TOS       12
00053 
00054 /// Codes for REDIRECT. 
00055 #define ICMP_REDIR_NET          0       ///< Redirect Net                       
00056 #define ICMP_REDIR_HOST         1       ///< Redirect Host              
00057 #define ICMP_REDIR_NETTOS       2       ///< Redirect Net for TOS               
00058 #define ICMP_REDIR_HOSTTOS      3       ///< Redirect Host for TOS      
00059 
00060 /// Codes for TIME_EXCEEDED. 
00061 #define ICMP_EXC_TTL            0       ///< TTL count exceeded         
00062 #define ICMP_EXC_FRAGTIME       1       ///< Fragment Reass time exceeded       
00063 
00064 
00065 struct icmphdr {
00066   unsigned char         type;
00067   unsigned char         code;
00068   unsigned short        checksum;
00069   union {
00070         struct {
00071                 unsigned short  id;
00072                 unsigned short  sequence;
00073         } echo;
00074         unsigned long gateway;
00075   } un;
00076 };
00077 
00078 
00079 struct icmp_err {
00080   int           errno;
00081   unsigned      fatal:1;
00082 };
00083 
00084 
00085 #endif  // _LINUX_ICMP_H 

Generated on Mon May 1 21:47:00 2006 for KernelAPI by  doxygen 1.4.6-5