📄 sctp_constants.h
字号:
/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ *//* Copyright 2005 Wind River Systems, Inc. *//*modification history--------------------01b,30aug05,sar limit memory for timewait tags01a,29jul05,kch ported from Kame*/#ifndef __sctp_constants_h__#define __sctp_constants_h__/* * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. * All rights reserved. * * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Cisco Systems, Inc. * 4. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CISCO SYSTEMS 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 CISCO SYSTEMS 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. */#ifdef __cplusplusextern "C" {#endif/* wrs: added */extern int hz; /* tick rate */#define SCTP_VERSION_STRING "KAME-BSD 1.1"/*#define SCTP_AUDITING_ENABLED 1 used for debug/auditing */#define SCTP_AUDIT_SIZE 256#define SCTP_STAT_LOG_SIZE 80000/* Places that CWND log can happen from */#define SCTP_CWND_LOG_FROM_FR 1#define SCTP_CWND_LOG_FROM_RTX 2#define SCTP_CWND_LOG_FROM_BRST 3#define SCTP_CWND_LOG_FROM_SS 4#define SCTP_CWND_LOG_FROM_CA 5#define SCTP_CWND_LOG_FROM_SAT 6#define SCTP_BLOCK_LOG_INTO_BLK 7#define SCTP_BLOCK_LOG_OUTOF_BLK 8#define SCTP_BLOCK_LOG_CHECK 9#define SCTP_STR_LOG_FROM_INTO_STRD 10#define SCTP_STR_LOG_FROM_IMMED_DEL 11#define SCTP_STR_LOG_FROM_INSERT_HD 12#define SCTP_STR_LOG_FROM_INSERT_MD 13#define SCTP_STR_LOG_FROM_INSERT_TL 14#define SCTP_STR_LOG_FROM_MARK_TSN 15#define SCTP_STR_LOG_FROM_EXPRS_DEL 16#define SCTP_FR_LOG_BIGGEST_TSNS 17#define SCTP_FR_LOG_STRIKE_TEST 18#define SCTP_FR_LOG_STRIKE_CHUNK 19#define SCTP_FR_T3_TIMEOUT 20#define SCTP_MAP_PREPARE_SLIDE 21#define SCTP_MAP_SLIDE_FROM 22#define SCTP_MAP_SLIDE_RESULT 23#define SCTP_MAP_SLIDE_CLEARED 24#define SCTP_MAP_SLIDE_NONE 25#define SCTP_FR_T3_MARK_TIME 26#define SCTP_FR_T3_MARKED 27#define SCTP_FR_T3_STOPPED 28#define SCTP_FR_MARKED 30#define SCTP_CWND_LOG_NOADV_SS 31#define SCTP_CWND_LOG_NOADV_CA 32#define SCTP_MAX_BURST_APPLIED 33#define SCTP_MAX_IFP_APPLIED 34#define SCTP_MAX_BURST_ERROR_STOP 35#define SCTP_INCREASE_PEER_RWND 36#define SCTP_DECREASE_PEER_RWND 37#define SCTP_SET_PEER_RWND_VIA_SACK 38#define SCTP_LOG_MBCNT_INCREASE 39#define SCTP_LOG_MBCNT_DECREASE 40#define SCTP_LOG_MBCNT_CHKSET 41/* * To turn on various logging, you must first define SCTP_STAT_LOGGING. * Then to get something to log you define one of the logging defines i.e. * * SCTP_CWND_LOGGING * SCTP_BLK_LOGGING * SCTP_STR_LOGGING * SCTP_FR_LOGGING * * Any one or a combination of the logging can be turned on. */#define SCTP_LOG_EVENT_CWND 1#define SCTP_LOG_EVENT_BLOCK 2#define SCTP_LOG_EVENT_STRM 3#define SCTP_LOG_EVENT_FR 4#define SCTP_LOG_EVENT_MAP 5#define SCTP_LOG_EVENT_MAXBURST 6#define SCTP_LOG_EVENT_RWND 7#define SCTP_LOG_EVENT_MBCNT 8/* number of associations by default for zone allocation */#define SCTP_MAX_NUM_OF_ASOC 40000/* how many addresses per assoc remote and local */#define SCTP_SCALE_FOR_ADDR 2/* default AUTO_ASCONF mode enable(1)/disable(0) value (sysctl) */#define SCTP_DEFAULT_AUTO_ASCONF 0/* * 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 *//* * Note: I can't seem to get this to compile now for some reason- the * kernel can't link in the md5 crypto *//* DEFINE HERE WHAT CRC YOU WANT TO USE */#define SCTP_USECRC_RFC2960 1/*#define SCTP_USECRC_FLETCHER 1*//*#define SCTP_USECRC_SSHCRC32 1*//*#define SCTP_USECRC_FASTCRC32 1*//*#define SCTP_USECRC_CRC32 1*//*#define SCTP_USECRC_TCP32 1*//*#define SCTP_USECRC_CRC16SMAL 1*//*#define SCTP_USECRC_CRC16 1 *//*#define SCTP_USECRC_MODADLER 1*/#ifndef SCTP_ADLER32_BASE#define SCTP_ADLER32_BASE 65521#endif#define SCTP_CWND_POSTS_LIST 256/* * 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/* how many executions every N tick's */#define SCTP_MAX_ITERATOR_AT_ONCE 20/* number of clock ticks between iterator executions */#define SCTP_ITERATOR_TICKS 1/* 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/* * Adds implementors guide behavior to only use newest highest * update in SACK gap ack's to figure out if you need to stroke * a chunk for FR. */#define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1/* default max I can burst out after a fast retransmit */#define SCTP_DEF_MAX_BURST 8/* Packet transmit states in the sent field */#define SCTP_DATAGRAM_UNSENT 0#define SCTP_DATAGRAM_SENT 1#define SCTP_DATAGRAM_RESEND1 2 /* not used (in code, but may hit this value) */#define SCTP_DATAGRAM_RESEND2 3 /* not used (in code, but may hit this value) */#define SCTP_DATAGRAM_RESEND3 4 /* not used (in code, but may hit this value) */#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 SCTP_FORWARD_TSN_SKIP 30010/* SCTP chunk types *//* Moved to sctp.h so f/w and natd * boxes can find the chunk types. *//* align to 32-bit sizes */#define SCTP_SIZE32(x) ((((x)+3) >> 2) << 2)#define IS_SCTP_CONTROL(a) ((a)->chunk_type != SCTP_DATA)#define IS_SCTP_DATA(a) ((a)->chunk_type == SCTP_DATA)/* SCTP parameter types */#define SCTP_HEARTBEAT_INFO 0x0001#define SCTP_IPV4_ADDRESS 0x0005#define SCTP_IPV6_ADDRESS 0x0006#define SCTP_STATE_COOKIE 0x0007#define SCTP_UNRECOG_PARAM 0x0008#define SCTP_COOKIE_PRESERVE 0x0009#define SCTP_HOSTNAME_ADDRESS 0x000b#define SCTP_SUPPORTED_ADDRTYPE 0x000c#define SCTP_ECN_CAPABLE 0x8000/* draft-ietf-stewart-strreset-xxx */#define SCTP_STR_RESET_REQUEST 0x000d#define SCTP_STR_RESET_RESPONSE 0x000e/* ECN Nonce: draft-ladha-sctp-ecn-nonce */#define SCTP_ECN_NONCE_SUPPORTED 0x8001/* * draft-ietf-stewart-strreset-xxx * param=0x8001 len=0xNNNN * Byte | Byte | Byte | Byte * Byte | Byte ... * * Where each Byte is a chunk type * extension supported so for example * to support all chunks one would have (in hex): * * 80 01 00 09 * C0 C1 80 81 * 82 00 00 00 * * Has the parameter. * C0 = PR-SCTP (RFC3758) * C1, 80 = ASCONF (addip draft) * 81 = Packet Drop * 82 = Stream Reset *//* draft-ietf-tsvwg-prsctp */#define SCTP_SUPPORTED_CHUNK_EXT 0x8008/* number of extensions we support */#define SCTP_EXT_COUNT 5 /* num of extensions we support chunk wise */#define SCTP_PAD_EXT_COUNT 3 /* num of pad bytes needed to get to 32 bit boundary */#define SCTP_PRSCTP_SUPPORTED 0xc000/* draft-ietf-tsvwg-addip-sctp */#define SCTP_ADD_IP_ADDRESS 0xc001#define SCTP_DEL_IP_ADDRESS 0xc002#define SCTP_ERROR_CAUSE_IND 0xc003#define SCTP_SET_PRIM_ADDR 0xc004#define SCTP_SUCCESS_REPORT 0xc005#define SCTP_ULP_ADAPTION 0xc006/* Notification error codes */#define SCTP_NOTIFY_DATAGRAM_UNSENT 0x0001#define SCTP_NOTIFY_DATAGRAM_SENT 0x0002#define SCTP_FAILED_THRESHOLD 0x0004#define SCTP_HEARTBEAT_SUCCESS 0x0008#define SCTP_RESPONSE_TO_USER_REQ 0x000f#define SCTP_INTERNAL_ERROR 0x0010#define SCTP_SHUTDOWN_GUARD_EXPIRES 0x0020#define SCTP_RECEIVED_SACK 0x0040#define SCTP_PEER_FAULTY 0x0080/* Error causes used in SCTP op-err's and aborts */#define SCTP_CAUSE_INV_STRM 0x001#define SCTP_CAUSE_MISS_PARAM 0x002#define SCTP_CAUSE_STALE_COOKIE 0x003#define SCTP_CAUSE_OUT_OF_RESC 0x004#define SCTP_CAUSE_UNRESOLV_ADDR 0x005#define SCTP_CAUSE_UNRECOG_CHUNK 0x006#define SCTP_CAUSE_INVALID_PARAM 0x007/* This one is also the same as SCTP_UNRECOG_PARAM above */#define SCTP_CAUSE_UNRECOG_PARAM 0x008#define SCTP_CAUSE_NOUSER_DATA 0x009#define SCTP_CAUSE_COOKIE_IN_SHUTDOWN 0x00a#define SCTP_CAUSE_RESTART_W_NEWADDR 0x00b#define SCTP_CAUSE_USER_INITIATED_ABT 0x00c#define SCTP_CAUSE_PROTOCOL_VIOLATION 0x00d/* Error's from add ip */#define SCTP_CAUSE_DELETEING_LAST_ADDR 0x100#define SCTP_CAUSE_OPERATION_REFUSED 0x101#define SCTP_CAUSE_DELETING_SRC_ADDR 0x102#define SCTP_CAUSE_ILLEGAL_ASCONF 0x103/* bits for TOS field */#define SCTP_ECT0_BIT 0x02#define SCTP_ECT1_BIT 0x01#define SCTP_CE_BITS 0x03/* 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#define SCTP_PR_SCTP_ENABLED 0x0400#define SCTP_PR_SCTP_BUFFER 0x0800/* Chunk flags */#define SCTP_WINDOW_PROBE 0x01/* * SCTP states for internal state machine * XXX (should match "user" values) */#define SCTP_STATE_EMPTY 0x0000#define SCTP_STATE_INUSE 0x0001#define SCTP_STATE_COOKIE_WAIT 0x0002#define SCTP_STATE_COOKIE_ECHOED 0x0004#define SCTP_STATE_OPEN 0x0008#define SCTP_STATE_SHUTDOWN_SENT 0x0010#define SCTP_STATE_SHUTDOWN_RECEIVED 0x0020#define SCTP_STATE_SHUTDOWN_ACK_SENT 0x0040#define SCTP_STATE_SHUTDOWN_PENDING 0x0080#define SCTP_STATE_CLOSED_SOCKET 0x0100#define SCTP_STATE_MASK 0x007f#define SCTP_GET_STATE(asoc) ((asoc)->state & SCTP_STATE_MASK)/* SCTP reachability state for each address */#define SCTP_ADDR_REACHABLE 0x001#define SCTP_ADDR_NOT_REACHABLE 0x002#define SCTP_ADDR_NOHB 0x004#define SCTP_ADDR_BEING_DELETED 0x008#define SCTP_ADDR_NOT_IN_ASSOC 0x010#define SCTP_ADDR_WAS_PRIMARY 0x020#define SCTP_ADDR_SWITCH_PRIMARY 0x040#define SCTP_ADDR_OUT_OF_SCOPE 0x080#define SCTP_ADDR_DOUBLE_SWITCH 0x100#define SCTP_ADDR_UNCONFIRMED 0x200#define SCTP_REACHABLE_MASK 0x203/* bound address types (e.g. valid address types to allow) */#define SCTP_BOUND_V6 0x01#define SCTP_BOUND_V4 0x02/* How long a cookie lives in seconds */#define SCTP_DEFAULT_COOKIE_LIFE 60/* resource limit of streams */#define MAX_SCTP_STREAMS 2048/* Maximum the mapping array will grow to (TSN mapping array) */#define SCTP_MAPPING_ARRAY 512/* size of the inital malloc on the mapping array */#define SCTP_INITIAL_MAPPING_ARRAY 16/* how much we grow the mapping array each call */#define SCTP_MAPPING_ARRAY_INCR 32/* * Here we define the timer types used by the implementation * as 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_HEARTBEAT 3#define SCTP_TIMER_PMTU 4#define SCTP_TIMER_MAXSHUTDOWN 5#define SCTP_TIMER_SIGNATURE 6/* * number of timer types in the base SCTP structure used in * the set/get and has the base default. */#define SCTP_NUM_TMRS 7/* timer types */#define SCTP_TIMER_TYPE_NONE 0#define SCTP_TIMER_TYPE_SEND 1#define SCTP_TIMER_TYPE_INIT 2#define SCTP_TIMER_TYPE_RECV 3#define SCTP_TIMER_TYPE_SHUTDOWN 4#define SCTP_TIMER_TYPE_HEARTBEAT 5#define SCTP_TIMER_TYPE_COOKIE 6#define SCTP_TIMER_TYPE_NEWCOOKIE 7#define SCTP_TIMER_TYPE_PATHMTURAISE 8#define SCTP_TIMER_TYPE_SHUTDOWNACK 9#define SCTP_TIMER_TYPE_ASCONF 10#define SCTP_TIMER_TYPE_SHUTDOWNGUARD 11#define SCTP_TIMER_TYPE_AUTOCLOSE 12#define SCTP_TIMER_TYPE_EVENTWAKE 13#define SCTP_TIMER_TYPE_STRRESET 14#define SCTP_TIMER_TYPE_INPKILL 15/* * Number of ticks before the soxwakeup() event that * is delayed is sent AFTER the accept() call */#define SCTP_EVENTWAKEUP_WAIT_TICKS 3000/* * Of course we really don't collect stale cookies, being folks * of discerning taste. However we do count them, if we get too * many before the association comes up.. we give up. Below is * the constant that dictates when we give it up...this is a * implemenation dependent treatment. In ours we do not ask for * a extension of time, but just retry this many times... */#define SCTP_MAX_STALE_COOKIES_I_COLLECT 10/* max number of TSN's dup'd that I will hold */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -