⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icmp.h

📁 用于嵌入式系统的TCP/IP协议栈及若干服务
💻 H
字号:
/**            Copyright (c) 1998-2001 by NETsilicon Inc.**  This software is copyrighted by and is the sole property of*  NETsilicon.  All rights, title, ownership, or other interests*  in the software remain the property of NETsilicon.  This*  software may only be used in accordance with the corresponding*  license agreement.  Any unauthorized use, duplication, transmission,*  distribution, or disclosure of this software is expressly forbidden.**  This Copyright notice may not be removed or modified without prior*  written consent of NETsilicon.**  NETsilicon, reserves the right to modify this software*  without notice.**  NETsilicon*  411 Waverley Oaks Road                  USA 781.647.1234*  Suite 227                               http://www.netsilicon.com*  Waltham, MA 02452                       AmericaSales@netsilicon.com***************************************************************************  $Name: Fusion 6.52 Fusion 6.51 $*  $Date: 2002/01/03 17:40:45 $*  $Source: M:/psisrc/stack/incl/rcs/icmp.h $*  $Revision: 1.10 $***************************************************************************  File Description:  ICMP (Internet Control Message Protocol) defines***************************************************************************/#ifndef _ICMP_#define _ICMP_#include "config.h"#include "ccdep.h"/* ICMP fixed header */typedef u8 ICMP_T;#define ICMP_TYPE       0                     /* message type, 1 byte */#define ICMP_CODE       (ICMP_TYPE + 1)       /* error code, 1 byte */#define ICMP_CHECKSUM   (ICMP_CODE + 1)       /* checksum, 2 bytes *//* The next 32 bits of the ICMP header depend on the message type */#define ICMP_UNUSED     (ICMP_CHECKSUM + 2)   /* area may be unused, 4 bytes */#define SIZEOF_ICMP_T   (ICMP_UNUSED + 4)     /* size of ICMP header *//* Parameter Problem Message */#define ICMP_POINTER    ICMP_UNUSED         /* 1 byte *//* Redirect Message */#define ICMP_RM         ICMP_UNUSED         /* 4 bytes */#define ICMP_GIA        ICMP_UNUSED         /* 4 bytes *//* Timestamp/Echo, Timestamp/Echo Reply,    Address Mask, or Address Mask Reply Message */#define ICMP_ID         ICMP_UNUSED           /* Identifier, 2 bytes */#define ICMP_SN         (ICMP_ID+2)           /* Sequence Number, 2 bytes *//* Destination unreachable, needs fragmentation */#define ICMP_NXTMTU		(ICMP_UNUSED+2)		  /* For DUR with DF - MTU of next hop *//* ICMP type values */#define ICMP_DUR    3   /* destination unreachable message */#define ICMP_TE     11  /* time exceeded message */#define ICMP_PP     12  /* parameter problem message */#define ICMP_SQ     4   /* source quench message */#define ICMP_RED    5   /* redirect message */#define ICMP_ECH    8   /* echo message */#define ICMP_ECR    0   /* echo reply message */#define ICMP_TIM    13  /* timestamp message */#define ICMP_TMR    14  /* timestamp reply */#define ICMP_IN     15  /* information request */#define ICMP_INR    16  /* information reply */#define ICMP_AM     17  /* address mask request */#define ICMP_AMR    18  /* address mask reply */#define ICMP_RTRDISC_ADV 9	/* router discovery advertisement */#define ICMP_RTRDISC_REQ 10	/* router discovery solicitation *//* Router Discovery constants */#define ICMP_RDISC_PREF 0	/* preference value */#define ICMP_RDISC_ADV_INT  600 /* advertize every 10 minutes *//* ICMP code values */#define DUR_NET         0   /* network unreachable */#define DUR_HOST        1   /* host unreachable */#define DUR_PROTO       2   /* protocol unreachable */#define DUR_PORT        3   /* port unreachable */#define DUR_FRAG        4   /* fragmentation needed & DF set */#define DUR_ROUTE       5   /* source route failed */#define TE_TRANSIT      0   /* time to live exceeded in transit */#define TE_REASSEMBLY   1   /* fragment reassembly time exceeded */#define PP_PERR         0   /* pointer indicates the error */#define RED_NET         0   /* redirect datagrams for the network */#define RED_HOST        1   /* redirect datagrams for the host */#define RED_NTOS        2   /* redirect datagrams for the tos & network */#define RED_HTOS        3   /* redirect datagrams for the tos & host */#define ICMP_PSIZE      2048#define icmp_er(mp, type, code, x, y) ((mp)->m_p0 = (type), (mp)->m_p1 = (code), (mp)->m_p2 = (x), (mp)->m_p3 = (y), icmp_msg)#ifndef ICMP_RQ_MAX#define ICMP_RQ_MAX	    4096#endif#ifndef ICMP_SQ_MAX#define ICMP_SQ_MAX	    4096#endif#define PING_MAXPLEN	min(ICMP_RQ_MAX,ICMP_SQ_MAX) /* Maximum PING packet len */#define PING_DEFPLEN	56	/* Default PING packet len 64 - sizeof(icmp_t) */#define PING_NPACKETS	1	/* Default PING number of packets to transmit */#endif /* _ICMP_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -