Marco Zecchini
/
Example_RTOS
Rtos API example
Embed:
(wiki syntax)
Show/hide line numbers
icmp.h
Go to the documentation of this file.
00001 /** 00002 * @file 00003 * ICMP protocol definitions 00004 */ 00005 00006 /* 00007 * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 00008 * All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without modification, 00011 * are permitted provided that the following conditions are met: 00012 * 00013 * 1. Redistributions of source code must retain the above copyright notice, 00014 * this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright notice, 00016 * this list of conditions and the following disclaimer in the documentation 00017 * and/or other materials provided with the distribution. 00018 * 3. The name of the author may not be used to endorse or promote products 00019 * derived from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00022 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 00024 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00026 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00027 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00028 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00029 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00030 * OF SUCH DAMAGE. 00031 * 00032 * This file is part of the lwIP TCP/IP stack. 00033 * 00034 * Author: Adam Dunkels <adam@sics.se> 00035 * 00036 */ 00037 #ifndef LWIP_HDR_PROT_ICMP_H 00038 #define LWIP_HDR_PROT_ICMP_H 00039 00040 #include "lwip/arch.h" 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 #define ICMP_ER 0 /* echo reply */ 00047 #define ICMP_DUR 3 /* destination unreachable */ 00048 #define ICMP_SQ 4 /* source quench */ 00049 #define ICMP_RD 5 /* redirect */ 00050 #define ICMP_ECHO 8 /* echo */ 00051 #define ICMP_TE 11 /* time exceeded */ 00052 #define ICMP_PP 12 /* parameter problem */ 00053 #define ICMP_TS 13 /* timestamp */ 00054 #define ICMP_TSR 14 /* timestamp reply */ 00055 #define ICMP_IRQ 15 /* information request */ 00056 #define ICMP_IR 16 /* information reply */ 00057 #define ICMP_AM 17 /* address mask request */ 00058 #define ICMP_AMR 18 /* address mask reply */ 00059 00060 #ifdef PACK_STRUCT_USE_INCLUDES 00061 # include "arch/bpstruct.h" 00062 #endif 00063 /** This is the standard ICMP header only that the u32_t data 00064 * is split to two u16_t like ICMP echo needs it. 00065 * This header is also used for other ICMP types that do not 00066 * use the data part. 00067 */ 00068 PACK_STRUCT_BEGIN 00069 struct icmp_echo_hdr { 00070 PACK_STRUCT_FLD_8(u8_t type); 00071 PACK_STRUCT_FLD_8(u8_t code); 00072 PACK_STRUCT_FIELD(u16_t chksum); 00073 PACK_STRUCT_FIELD(u16_t id); 00074 PACK_STRUCT_FIELD(u16_t seqno); 00075 } PACK_STRUCT_STRUCT; 00076 PACK_STRUCT_END 00077 #ifdef PACK_STRUCT_USE_INCLUDES 00078 # include "arch/epstruct.h" 00079 #endif 00080 00081 /* Compatibility defines, old versions used to combine type and code to an u16_t */ 00082 #define ICMPH_TYPE(hdr) ((hdr)->type) 00083 #define ICMPH_CODE(hdr) ((hdr)->code) 00084 #define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) 00085 #define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) 00086 00087 #ifdef __cplusplus 00088 } 00089 #endif 00090 00091 #endif /* LWIP_HDR_PROT_ICMP_H */
Generated on Sun Jul 17 2022 08:25:23 by 1.7.2