Milos RTOS v0.3.4a
Real Time Operating System
icmp.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  * icmp.h
00003  * (C) 2011 Ivan Meleca
00004  * www.milos.it
00005  *
00006 
00007 #   This program is free software; you can redistribute it and/or modify
00008 #   it under the terms of the GNU General Public License as published by
00009 #   the Free Software Foundation; either version 2 of the License, or
00010 #   (at your option) any later version.
00011 #
00012 #   This program is distributed in the hope that it will be useful,
00013 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 #   GNU General Public License for more details.
00016 #
00017 #   You should have received a copy of the GNU General Public License
00018 #   along with this program; if not, write to the Free Software
00019 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 
00021 ***************************************************************************/
00022 
00023 #ifndef __ICMP_H__
00024 #define __ICMP_H__
00025 
00026 #include "netif.h"
00027 
00028 #if __CONFIG_COMPILE_NET
00029 
00055 #define __ICMP_TYPE_ECHOREPLY                   0   
00056 #define __ICMP_TYPE_UNREACH                     3   
00057 #define     __ICMP_CODE_UNREACH_NET             0   
00058 #define     __ICMP_CODE_UNREACH_HOST            1   
00059 #define     __ICMP_CODE_UNREACH_PROTOCOL        2   
00060 #define     __ICMP_CODE_UNREACH_PORT            3   
00061 #define     __ICMP_CODE_UNREACH_NEEDFRAG        4   
00062 #define     __ICMP_CODE_UNREACH_SRCFAIL         5   
00063 #define     __ICMP_CODE_UNREACH_NET_UNKNOWN     6   
00064 #define     __ICMP_CODE_UNREACH_HOST_UNKNOWN    7   
00065 #define     __ICMP_CODE_UNREACH_ISOLATED        8   
00066 #define     __ICMP_CODE_UNREACH_NET_PROHIB      9   
00067 #define     __ICMP_CODE_UNREACH_HOST_PROHIB     10  
00068 #define     __ICMP_CODE_UNREACH_TOSNET          11  
00069 #define     __ICMP_CODE_UNREACH_TOSHOST         12  
00070 #define __ICMP_TYPE_SOURCEQUENCH                4   
00071 #define __ICMP_TYPE_REDIRECT                    5   
00072 #define     __ICMP_CODE_REDIRECT_NET            0   
00073 #define     __ICMP_CODE_REDIRECT_HOST           1   
00074 #define     __ICMP_CODE_REDIRECT_TOSNET         2   
00075 #define     __ICMP_CODE_REDIRECT_TOSHOST        3   
00076 #define __ICMP_TYPE_ECHO                        8   
00077 #define __ICMP_TYPE_ROUTERADVERT                9   
00078 #define __ICMP_TYPE_ROUTERSOLICIT               10  
00079 #define __ICMP_TYPE_TIMXCEED                    11  
00080 #define     __ICMP_CODE_TIMXCEED_INTRANS        0   
00081 #define     __ICMP_CODE_TIMXCEED_REASS          1   
00082 #define __ICMP_TYPE_PARAMPROB                   12  
00083 #define     __ICMP_CODE_PARAMPROB_OPTABSENT     1   
00084 #define __ICMP_TYPE_TSTAMP                      13  
00085 #define __ICMP_TYPE_TSTAMPREPLY                 14  
00086 #define __ICMP_TYPE_IREQ                        15  
00087 #define __ICMP_TYPE_IREQREPLY                   16  
00088 #define __ICMP_TYPE_MASKREQ                     17  
00089 #define __ICMP_TYPE_MASKREPLY                   18  
00107 typedef __TYPEDEF_PRE struct __icmpHdrTag
00108 {
00109     u8 type;        
00110     u8 code;        
00111     u16 cksum;      
00112 } __TYPEDEF_POST __ICMP_HDR;
00113 
00117 typedef __TYPEDEF_PRE struct __icmpEchoTag
00118 {
00119     u16 id;         
00120     u16 seq_num;    
00122 } __TYPEDEF_POST __ICMP_ECHO;
00123 
00128 i32 __icmpIn(__PNETIF netif, __PNET_BUFFER nb);
00129 i32 __icmpOut(__PNET_BUFFER nb, u8 type, u32 dest);
00130 i32 __icmpPing(__PSTRING dest, u16 size, u8 qty, u32 timeout);
00131 
00144 #endif /* __CONFIG_COMPILE_NET */
00145 
00146 #endif /* __ICMP_H__ */
 All Data Structures Files Functions Variables Typedefs Defines