sctpconstants.h

来自「TCPDUMP的C语言源代码,是在数据链路层的应用」· C头文件 代码 · 共 572 行 · 第 1/2 页

H
572
字号
/* @(#) $Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.4 2003-06-03 23:49:23 guy Exp $ (LBL) *//* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * * 3. Neither the name of Cisco nor of Motorola may be used *    to endorse or promote products derived from this software without *    specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is part of the SCTP reference Implementation * * * Please send any bug reports or fixes you make to one of the following email * addresses: * * rstewar1@email.mot.com * kmorneau@cisco.com * qxie1@email.mot.com * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorperated into the next SCTP release. */#ifndef __sctpConstants_h__#define __sctpConstants_h__  /* If you wish to use MD5 instead of SLA uncomment the line   * below. Why you would like to do this:   * a) There may be IPR on SHA-1, or so the FIP-180-1 page says,   * b) MD5 is 3 times faster (has coded here).   *   * The disadvantage is, it is thought that MD5 has been   * cracked... see RFC2104.   *//*#define USE_MD5 1*//* the SCTP protocol signature * this includes the version number * encoded in the last 4 bits of the * signature. */#define PROTO_SIGNATURE_A 0x30000000#define SCTP_VERSION_NUMBER 0x3#define MAX_TSN 0xffffffff#define MAX_SEQ 0xffff/* option: * If you comment out the following you will * receive the old behavior of obeying cwnd for * the fast retransmit algorithm. With this defined * a FR happens right away with-out waiting for the * flightsize to drop below the cwnd value (which * is reduced by the FR to 1/2 the inflight packets). */#define SCTP_IGNORE_CWND_ON_FR 1/* default max I can burst out after a fast retransmit */#define SCTP_DEF_MAX_BURST 4/* Packet transmit states in the sent * field in the SCTP_transmitOnQueue struct */#define SCTP_DATAGRAM_UNSENT 		0#define SCTP_DATAGRAM_SENT   		1#define SCTP_DATAGRAM_RESEND1		2 /* not used */#define SCTP_DATAGRAM_RESEND2		3 /* not used */#define SCTP_DATAGRAM_RESEND3		4 /* not used */#define SCTP_DATAGRAM_RESEND		5#define SCTP_DATAGRAM_ACKED		10010#define SCTP_DATAGRAM_INBOUND		10011#define SCTP_READY_TO_TRANSMIT		10012#define SCTP_DATAGRAM_MARKED		20010#define MAX_FSID 64	/* debug 5 ints used for cc dynamic tracking *//* The valid defines for all message * types know to SCTP. 0 is reserved */#define SCTP_MSGTYPE_MASK	0xff#define SCTP_DATA		0x00#define SCTP_INITIATION		0x01#define SCTP_INITIATION_ACK	0x02#define SCTP_SELECTIVE_ACK	0x03#define SCTP_HEARTBEAT_REQUEST	0x04#define SCTP_HEARTBEAT_ACK	0x05#define SCTP_ABORT_ASSOCIATION	0x06#define SCTP_SHUTDOWN		0x07#define SCTP_SHUTDOWN_ACK	0x08#define SCTP_OPERATION_ERR	0x09#define SCTP_COOKIE_ECHO	0x0a#define SCTP_COOKIE_ACK         0x0b#define SCTP_ECN_ECHO		0x0c#define SCTP_ECN_CWR		0x0d#define SCTP_SHUTDOWN_COMPLETE	0x0e#define SCTP_FORWARD_CUM_TSN    0xc0#define SCTP_RELIABLE_CNTL      0xc1#define SCTP_RELIABLE_CNTL_ACK  0xc2/* ABORT and SHUTDOWN COMPLETE FLAG */#define SCTP_HAD_NO_TCB		0x01/* Data Chuck Specific Flags */#define SCTP_DATA_FRAG_MASK	0x03#define SCTP_DATA_MIDDLE_FRAG	0x00#define SCTP_DATA_LAST_FRAG	0x01#define SCTP_DATA_FIRST_FRAG	0x02#define SCTP_DATA_NOT_FRAG	0x03#define SCTP_DATA_UNORDERED	0x04#define SCTP_CRC_ENABLE_BIT	0x01	/* lower bit of reserved */#define isSCTPControl(a) (a->chunkID != SCTP_DATA)#define isSCTPData(a) (a->chunkID == SCTP_DATA)/* sctp parameter types for init/init-ack */#define SCTP_IPV4_PARAM_TYPE    0x0005#define SCTP_IPV6_PARAM_TYPE    0x0006#define SCTP_RESPONDER_COOKIE   0x0007#define SCTP_UNRECOG_PARAM	0x0008#define SCTP_COOKIE_PRESERVE    0x0009#define SCTP_HOSTNAME_VIA_DNS   0x000b#define SCTP_RESTRICT_ADDR_TO	0x000c#define SCTP_ECN_I_CAN_DO_ECN	0x8000#define SCTP_OPERATION_SUCCEED	0x4001#define SCTP_ERROR_NOT_EXECUTED	0x4002#define SCTP_UNRELIABLE_STRM    0xc000#define SCTP_ADD_IP_ADDRESS     0xc001#define SCTP_DEL_IP_ADDRESS     0xc002#define SCTP_STRM_FLOW_LIMIT    0xc003#define SCTP_PARTIAL_CSUM       0xc004#define SCTP_ERROR_CAUSE_TLV	0xc005#define SCTP_MIT_STACK_NAME	0xc006#define SCTP_SETADDRESS_PRIMARY 0xc007/* bits for TOS field */#define SCTP_ECT_BIT		0x02#define SCTP_CE_BIT		0x01/* error codes */#define SCTP_OP_ERROR_NO_ERROR		0x0000#define SCTP_OP_ERROR_INV_STRM		0x0001#define SCTP_OP_ERROR_MISS_PARAM	0x0002#define SCTP_OP_ERROR_STALE_COOKIE	0x0003#define SCTP_OP_ERROR_NO_RESOURCE 	0x0004#define SCTP_OP_ERROR_DNS_FAILED   	0x0005#define SCTP_OP_ERROR_UNK_CHUNK	   	0x0006#define SCTP_OP_ERROR_INV_PARAM		0x0007#define SCTP_OP_ERROR_UNK_PARAM	       	0x0008#define SCTP_OP_ERROR_NO_USERD    	0x0009#define SCTP_OP_ERROR_COOKIE_SHUT	0x000a#define SCTP_OP_ERROR_DELETE_LAST	0x000b#define SCTP_OP_ERROR_RESOURCE_SHORT 	0x000c#define SCTP_MAX_ERROR_CAUSE  12/* empty error causes i.e. nothing but the cause * are SCTP_OP_ERROR_NO_RESOURCE, SCTP_OP_ERROR_INV_PARAM, * SCTP_OP_ERROR_COOKIE_SHUT. *//* parameter for Heart Beat */#define HEART_BEAT_PARAM 0x0001/* send options for SCTP */#define SCTP_ORDERED_DELIVERY		0x01#define SCTP_NON_ORDERED_DELIVERY	0x02#define SCTP_DO_CRC16			0x08#define SCTP_MY_ADDRESS_ONLY		0x10/* below turns off above */#define SCTP_FLEXIBLE_ADDRESS		0x20#define SCTP_NO_HEARTBEAT		0x40/* mask to get sticky */#define SCTP_STICKY_OPTIONS_MASK        0x0c/* MTU discovery flags */#define SCTP_DONT_FRAGMENT		0x0100#define SCTP_FRAGMENT_OK		0x0200/* SCTP state defines for internal state machine */#define SCTP_STATE_EMPTY		0x0000#define SCTP_STATE_INUSE		0x0001#define SCTP_STATE_COOKIE_WAIT		0x0002#define SCTP_STATE_COOKIE_SENT		0x0004#define SCTP_STATE_OPEN			0x0008#define SCTP_STATE_SHUTDOWN		0x0010#define SCTP_STATE_SHUTDOWN_RECV	0x0020#define SCTP_STATE_SHUTDOWN_ACK_SENT	0x0040#define SCTP_STATE_SHUTDOWN_PEND	0x0080#define SCTP_STATE_MASK			0x007f/* SCTP reachability state for each address */#define SCTP_ADDR_NOT_REACHABLE		1#define SCTP_ADDR_REACHABLE		2#define SCTP_ADDR_NOHB			4#define SCTP_ADDR_BEING_DELETED		8/* How long a cookie lives */#define SCTP_DEFAULT_COOKIE_LIFE 60 /* seconds *//* resource limit of streams */#define MAX_SCTP_STREAMS 2048/* guess at how big to make the TSN mapping array */#define SCTP_STARTING_MAPARRAY 10000/* Here we define the timer types used * by the implementation has * arguments in the set/get timer type calls. */#define SCTP_TIMER_INIT 	0#define SCTP_TIMER_RECV 	1#define SCTP_TIMER_SEND 	2#define SCTP_TIMER_SHUTDOWN	3#define SCTP_TIMER_HEARTBEAT	4#define SCTP_TIMER_PMTU		5/* number of timer types in the base SCTP * structure used in the set/get and has * the base default. */#define SCTP_NUM_TMRS 6#define SCTP_IPV4_ADDRESS	2#define SCTP_IPV6_ADDRESS	4/* timer types */#define SctpTimerTypeNone		0#define SctpTimerTypeSend		1#define SctpTimerTypeInit		2#define SctpTimerTypeRecv		3#define SctpTimerTypeShutdown		4#define SctpTimerTypeHeartbeat		5#define SctpTimerTypeCookie		6#define SctpTimerTypeNewCookie		7#define SctpTimerTypePathMtuRaise	8#define SctpTimerTypeShutdownAck	9#define SctpTimerTypeRelReq		10/* Here are the timer directives given to the * user provided function */#define SCTP_TIMER_START	1#define SCTP_TIMER_STOP		2/* running flag states in timer structure */#define SCTP_TIMER_IDLE		0x0#define SCTP_TIMER_EXPIRED	0x1#define SCTP_TIMER_RUNNING	0x2

⌨️ 快捷键说明

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