📄 sctp_constants.h
字号:
#define SCTP_MAX_DUP_TSNS 20#define SCTP_TIMER_TYPE_ITERATOR 16/* * Here we define the types used when setting the retry amounts. *//* constants for type of set */#define SCTP_MAXATTEMPT_INIT 2#define SCTP_MAXATTEMPT_SEND 3/* Maximum TSN's we will summarize in a drop report */#define SCTP_MAX_DROP_REPORT 16/* How many drop re-attempts we make on INIT/COOKIE-ECHO */#define SCTP_RETRY_DROPPED_THRESH 4/* And the max we will keep a history of in the tcb * which MUST be lower than 256. */#define SCTP_MAX_DROP_SAVE_REPORT 16/* * Here we define the default timers and the default number * of attemts we make for each respective side (send/init). *//* Maxmium number of chunks a single association can have * on it. Note that this is a squishy number since * the count can run over this if the user sends a large * message down .. the fragmented chunks don't count until * AFTER the message is on queue.. it would be the next * send that blocks things. This number will get tuned * up at boot in the sctp_init and use the number * of clusters as a base. This way high bandwidth * environments will not get impacted by the lower * bandwidth sending a bunch of 1 byte chunks */#define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512#define MSEC_TO_TICKS(x) (((x) * hz) / 1000)#define TICKS_TO_MSEC(x) (((x) * 1000) / hz)#define SEC_TO_TICKS(x) ((x) * hz)/* init timer def = 1 sec */#define SCTP_INIT_SEC 1/* send timer def = 1 seconds */#define SCTP_SEND_SEC 1/* recv timer def = 200ms */#define SCTP_RECV_MSEC 200/* 30 seconds + RTO (in ms) */#define SCTP_HB_DEFAULT_MSEC 30000/* Max time I will wait for Shutdown to complete */#define SCTP_DEF_MAX_SHUTDOWN_SEC 180/* This is how long a secret lives, NOT how long a cookie lives * how many ticks the current secret will live. */#define SCTP_DEFAULT_SECRET_LIFE_SEC 3600#define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */#define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec in ms */#define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */#define SCTP_INP_KILL_TIMEOUT 1000 /* number of ms to retry kill of inpcb*/#define SCTP_DEF_MAX_INIT 8#define SCTP_DEF_MAX_SEND 10#define SCTP_DEF_PMTU_RAISE_SEC 600 /* 10 min between raise attempts */#define SCTP_DEF_PMTU_MIN 600#define SCTP_MSEC_IN_A_SEC 1000#define SCTP_USEC_IN_A_SEC 1000000#define SCTP_NSEC_IN_A_SEC 1000000000#define SCTP_MAX_OUTSTANDING_DG 10000/* How many streams I request initally by default */#define SCTP_OSTREAM_INITIAL 10#define SCTP_SEG_TO_RWND_UPD 32 /* How many smallest_mtu's need to increase before * a window update sack is sent (should be a * power of 2). */#define SCTP_SCALE_OF_RWND_TO_UPD 4 /* Incr * this > hiwat, send * window update. Should be a * power of 2. */#define SCTP_MINIMAL_RWND (4096) /* minimal rwnd */#define SCTP_ADDRMAX 20/* SCTP DEBUG Switch parameters */#define SCTP_DEBUG_TIMER1 0x00000001#define SCTP_DEBUG_TIMER2 0x00000002#define SCTP_DEBUG_TIMER3 0x00000004#define SCTP_DEBUG_TIMER4 0x00000008#define SCTP_DEBUG_OUTPUT1 0x00000010#define SCTP_DEBUG_OUTPUT2 0x00000020#define SCTP_DEBUG_OUTPUT3 0x00000040#define SCTP_DEBUG_OUTPUT4 0x00000080#define SCTP_DEBUG_UTIL1 0x00000100#define SCTP_DEBUG_UTIL2 0x00000200#define SCTP_DEBUG_INPUT1 0x00001000#define SCTP_DEBUG_INPUT2 0x00002000#define SCTP_DEBUG_INPUT3 0x00004000#define SCTP_DEBUG_INPUT4 0x00008000#define SCTP_DEBUG_ASCONF1 0x00010000#define SCTP_DEBUG_ASCONF2 0x00020000#define SCTP_DEBUG_OUTPUT5 0x00040000#define SCTP_DEBUG_PCB1 0x00100000#define SCTP_DEBUG_PCB2 0x00200000#define SCTP_DEBUG_PCB3 0x00400000#define SCTP_DEBUG_PCB4 0x00800000#define SCTP_DEBUG_INDATA1 0x01000000#define SCTP_DEBUG_INDATA2 0x02000000#define SCTP_DEBUG_INDATA3 0x04000000#define SCTP_DEBUG_INDATA4 0x08000000#define SCTP_DEBUG_USRREQ1 0x10000000#define SCTP_DEBUG_USRREQ2 0x20000000#define SCTP_DEBUG_PEEL1 0x40000000#define SCTP_DEBUG_ALL 0x7ff3f3ff#define SCTP_DEBUG_NOISY 0x00040000/* What sender needs to see to avoid SWS or we consider peers rwnd 0 */#define SCTP_SWS_SENDER_DEF 1420/* * SWS is scaled to the sb_hiwat of the socket. * A value of 2 is hiwat/4, 1 would be hiwat/2 etc. *//* What receiver needs to see in sockbuf or we tell peer its 1 */#define SCTP_SWS_RECEIVER_DEF 3000#define SCTP_INITIAL_CWND 4380/* amount peer is obligated to have in rwnd or I will abort */#define SCTP_MIN_RWND 1500#define SCTP_WINDOW_MIN 1500 /* smallest rwnd can be */#define SCTP_WINDOW_MAX 1048576 /* biggest I can grow rwnd to * My playing around suggests a * value greater than 64k does not * do much, I guess via the kernel * limitations on the stream/socket. */#define SCTP_MAX_BUNDLE_UP 256 /* max number of chunks to bundle *//* I can handle a 1meg re-assembly */#define SCTP_DEFAULT_MAXMSGREASM 1048576#define SCTP_DEFAULT_MAXSEGMENT 65535#define DEFAULT_CHUNK_BUFFER 2048#define DEFAULT_PARAM_BUFFER 512#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */#define SCTP_HOW_MANY_SECRETS 2 /* how many secrets I keep */#define SCTP_NUMBER_OF_SECRETS 8 /* or 8 * 4 = 32 octets */#define SCTP_SECRET_SIZE 32 /* number of octets in a 256 bits */#ifdef USE_MD5#define SCTP_SIGNATURE_SIZE 16 /* size of a MD5 signature */#else#define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */#endif /* USE_MD5 */#define SCTP_SIGNATURE_ALOC_SIZE 20/* * SCTP upper layer notifications */#define SCTP_NOTIFY_ASSOC_UP 1#define SCTP_NOTIFY_ASSOC_DOWN 2#define SCTP_NOTIFY_INTERFACE_DOWN 3#define SCTP_NOTIFY_INTERFACE_UP 4#define SCTP_NOTIFY_DG_FAIL 5#define SCTP_NOTIFY_STRDATA_ERR 6#define SCTP_NOTIFY_ASSOC_ABORTED 7#define SCTP_NOTIFY_PEER_OPENED_STREAM 8#define SCTP_NOTIFY_STREAM_OPENED_OK 9#define SCTP_NOTIFY_ASSOC_RESTART 10#define SCTP_NOTIFY_HB_RESP 11#define SCTP_NOTIFY_ASCONF_SUCCESS 12#define SCTP_NOTIFY_ASCONF_FAILED 13#define SCTP_NOTIFY_PEER_SHUTDOWN 14#define SCTP_NOTIFY_ASCONF_ADD_IP 15#define SCTP_NOTIFY_ASCONF_DELETE_IP 16#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 17#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 18#define SCTP_NOTIFY_ADAPTION_INDICATION 19#define SCTP_NOTIFY_INTERFACE_CONFIRMED 20#define SCTP_NOTIFY_STR_RESET_RECV 21#define SCTP_NOTIFY_STR_RESET_SEND 22#define SCTP_NOTIFY_MAX 22/* clock variance is 10ms */#define SCTP_CLOCK_GRANULARITY 10#define IP_HDR_SIZE 40 /* we use the size of a IP6 header here * this detracts a small amount for ipv4 * but it simplifies the ipv6 addition */#ifndef IPPROTO_SCTP#define IPPROTO_SCTP 132 /* the Official IANA number :-) */#endif /* !IPPROTO_SCTP */#define SCTP_MAX_DATA_BUNDLING 256#define SCTP_MAX_CONTROL_BUNDLING 20/* modular comparison *//* True if a > b (mod = M) */#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \ ((b > a) && ((b - a) > ((M >> 1) + 1))))/* Mapping array manipulation routines */#define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01)#define SCTP_SET_TSN_PRESENT(arry, gap) (arry[(gap >> 3)] |= (0x01 << ((gap & 0x07))))#define SCTP_UNSET_TSN_PRESENT(arry, gap) (arry[(gap >> 3)] &= ((~(0x01 << ((gap & 0x07)))) & 0xff))/* pegs */#define SCTP_NUMBER_OF_PEGS 96/* peg index's */#define SCTP_PEG_SACKS_SEEN 0#define SCTP_PEG_SACKS_SENT 1#define SCTP_PEG_TSNS_SENT 2#define SCTP_PEG_TSNS_RCVD 3#define SCTP_DATAGRAMS_SENT 4#define SCTP_DATAGRAMS_RCVD 5#define SCTP_RETRANTSN_SENT 6#define SCTP_DUPTSN_RECVD 7#define SCTP_HB_RECV 8#define SCTP_HB_ACK_RECV 9#define SCTP_HB_SENT 10#define SCTP_WINDOW_PROBES 11#define SCTP_DATA_DG_RECV 12#define SCTP_TMIT_TIMER 13#define SCTP_RECV_TIMER 14#define SCTP_HB_TIMER 15#define SCTP_FAST_RETRAN 16#define SCTP_TIMERS_EXP 17#define SCTP_FR_INAWINDOW 18#define SCTP_RWND_BLOCKED 19#define SCTP_CWND_BLOCKED 20#define SCTP_RWND_DROPS 21#define SCTP_BAD_STRMNO 22#define SCTP_BAD_SSN_WRAP 23#define SCTP_DROP_NOMEMORY 24#define SCTP_DROP_FRAG 25#define SCTP_BAD_VTAGS 26#define SCTP_BAD_CSUM 27#define SCTP_INPKTS 28#define SCTP_IN_MCAST 29#define SCTP_HDR_DROPS 30#define SCTP_NOPORTS 31#define SCTP_CWND_NOFILL 32#define SCTP_CALLS_TO_CO 33#define SCTP_CO_NODATASNT 34#define SCTP_CWND_NOUSE_SS 35#define SCTP_MAX_BURST_APL 36#define SCTP_EXPRESS_ROUTE 37#define SCTP_NO_COPY_IN 38#define SCTP_CACHED_SRC 39#define SCTP_CWND_NOCUM 40#define SCTP_CWND_SS 41#define SCTP_CWND_CA 42#define SCTP_CWND_SKIP 43#define SCTP_CWND_NOUSE_CA 44#define SCTP_MAX_CWND 45#define SCTP_CWND_DIFF_CA 46#define SCTP_CWND_DIFF_SA 47#define SCTP_OQS_AT_SS 48#define SCTP_SQQ_AT_SS 49#define SCTP_OQS_AT_CA 50#define SCTP_SQQ_AT_CA 51#define SCTP_MOVED_MTU 52#define SCTP_MOVED_QMAX 53#define SCTP_SQC_AT_SS 54#define SCTP_SQC_AT_CA 55#define SCTP_MOVED_MAX 56#define SCTP_MOVED_NLEF 57#define SCTP_NAGLE_NOQ 58#define SCTP_NAGLE_OFF 59#define SCTP_OUTPUT_FRM_SND 60#define SCTP_SOS_NOSNT 61#define SCTP_NOS_NOSNT 62#define SCTP_SOSE_NOSNT 63#define SCTP_NOSE_NOSNT 64#define SCTP_DATA_OUT_ERR 65#define SCTP_DUP_SSN_RCVD 66#define SCTP_DUP_FR 67#define SCTP_VTAG_EXPR 68#define SCTP_VTAG_BOGUS 69#define SCTP_T3_SAFEGRD 70#define SCTP_PDRP_FMBOX 71#define SCTP_PDRP_FEHOS 72#define SCTP_PDRP_MB_DA 73#define SCTP_PDRP_MB_CT 74#define SCTP_PDRP_BWRPT 75#define SCTP_PDRP_CRUPT 76#define SCTP_PDRP_NEDAT 77#define SCTP_PDRP_PDBRK 78#define SCTP_PDRP_TSNNF 79#define SCTP_PDRP_DNFND 80#define SCTP_PDRP_DIWNP 81#define SCTP_PDRP_DIZRW 82#define SCTP_PDRP_BADD 83#define SCTP_PDRP_MARK 84#define SCTP_ECNE_RCVD 85#define SCTP_CWR_PERFO 86#define SCTP_ECNE_SENT 87#define SCTP_MSGC_DROP 88#define SCTP_SEND_QUEUE_POP 89#define SCTP_ERROUT_FRM_USR 90#define SCTP_SENDTO_FULL_CWND 91#define SCTP_QUEONLY_BURSTLMT 92#define SCTP_IFP_QUEUE_FULL 93#define SCTP_RESV2 94#define SCTP_RESV3 95/* * This value defines the number of vtag block time wait entry's * per list element. Each entry will take 2 4 byte ints (and of * course the overhead of the next pointer as well). Using 15 as * an example will yield * ((8 * 15) + 8) or 128 bytes of overhead * for each timewait block that gets initialized. Increasing it to * 31 would yeild 256 bytes per block. *//* Undef the following turns on per EP behavior */#define SCTP_VTAG_TIMEWAIT_PER_STACK 1#ifdef SCTP_VTAG_TIMEWAIT_PER_STACK#define SCTP_NUMBER_IN_VTAG_BLOCK 15#else/* The hash list is smaller if we are on a ep basis */#define SCTP_NUMBER_IN_VTAG_BLOCK 3#endif/* * If we use the STACK option, we have an array of this size head * pointers. This array is mod'd the with the size to find which * bucket and then all entries must be searched to see if the tag * is in timed wait. If so we reject it. */#define SCTP_STACK_VTAG_HASH_SIZE 31/* Limit the number of blocks we can chain onto each hash entry */#define SCTP_MAX_VTAG_TIMEWAIT_BLOCKS 2/* * If we use the per-endpoint model than we do not have a hash * table of entries but instead have a single head pointer and * we must crawl through the entire list. *//* * Number of seconds of time wait, tied to MSL value (2 minutes), * so 2 * MSL = 4 minutes or 480 seconds. */#define SCTP_TIME_WAIT 480#define IN4_ISPRIVATE_ADDRESS(a) \ ((((u_char *)&(a)->s_addr)[0] == 10) || \ ((((u_char *)&(a)->s_addr)[0] == 172) && \ (((u_char *)&(a)->s_addr)[1] >= 16) && \ (((u_char *)&(a)->s_addr)[1] <= 32)) || \ ((((u_char *)&(a)->s_addr)[0] == 192) && \ (((u_char *)&(a)->s_addr)[1] == 168)))#define IN4_ISLOOPBACK_ADDRESS(a) \ ((((u_char *)&(a)->s_addr)[0] == 127) && \ (((u_char *)&(a)->s_addr)[1] == 0) && \ (((u_char *)&(a)->s_addr)[2] == 0) && \ (((u_char *)&(a)->s_addr)[3] == 1))#if defined(_WRS_KERNEL)#define SCTP_GETTIME_TIMEVAL(x) (microtime(x))#if 0 /* wrs unsupported, not used by sctp anyway */#define SCTP_GETTIME_TIMESPEC(x) (nanotime(x))#endif#define sctp_sowwakeup(inp, so) \do { \ if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { \ inp->sctp_flags |= SCTP_PCB_FLAGS_WAKEOUTPUT; \ } else { \ sowwakeup(so); \ } \} while (0)#define sctp_sorwakeup(inp, so) \do { \ if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { \ inp->sctp_flags |= SCTP_PCB_FLAGS_WAKEINPUT; \ } else { \ sorwakeup(so); \ } \} while (0)#endif /* _WRS_KERNEL */#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -