constants.h
来自「linux 内核源代码」· C头文件 代码 · 共 468 行 · 第 1/2 页
H
468 行
} sctp_sock_state_t;/* These functions map various type to printable names. */const char *sctp_cname(const sctp_subtype_t); /* chunk types */const char *sctp_oname(const sctp_subtype_t); /* other events */const char *sctp_tname(const sctp_subtype_t); /* timeouts */const char *sctp_pname(const sctp_subtype_t); /* primitives *//* This is a table of printable names of sctp_state_t's. */extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[];/* Maximum chunk length considering padding requirements. */enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) };/* Encourage Cookie-Echo bundling by pre-fragmenting chunks a little * harder (until reaching ESTABLISHED state). */enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 };/* Guess at how big to make the TSN mapping array. * We guarantee that we can handle at least this big a gap between the * cumulative ACK and the highest TSN. In practice, we can often * handle up to twice this value. * * NEVER make this more than 32767 (2^15-1). The Gap Ack Blocks in a * SACK (see section 3.3.4) are only 16 bits, so 2*SCTP_TSN_MAP_SIZE * must be less than 65535 (2^16 - 1), or we will have overflow * problems creating SACK's. */#define SCTP_TSN_MAP_SIZE 2048#define SCTP_TSN_MAX_GAP 65535/* We will not record more than this many duplicate TSNs between two * SACKs. The minimum PMTU is 576. Remove all the headers and there * is enough room for 131 duplicate reports. Round down to the * nearest power of 2. */enum { SCTP_MIN_PMTU = 576 };enum { SCTP_MAX_DUP_TSNS = 16 };enum { SCTP_MAX_GABS = 16 };/* Heartbeat interval - 30 secs */#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30*1000)/* Delayed sack timer - 200ms */#define SCTP_DEFAULT_TIMEOUT_SACK (200)/* RTO.Initial - 3 seconds * RTO.Min - 1 second * RTO.Max - 60 seconds * RTO.Alpha - 1/8 * RTO.Beta - 1/4 */#define SCTP_RTO_INITIAL (3 * 1000)#define SCTP_RTO_MIN (1 * 1000)#define SCTP_RTO_MAX (60 * 1000)#define SCTP_RTO_ALPHA 3 /* 1/8 when converted to right shifts. */#define SCTP_RTO_BETA 2 /* 1/4 when converted to right shifts. *//* Maximum number of new data packets that can be sent in a burst. */#define SCTP_DEFAULT_MAX_BURST 4#define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */#define SCTP_DEF_MAX_INIT 6#define SCTP_DEF_MAX_SEND 10#define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit * to which we will raise the P-MTU. */#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */#define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */#define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* How many seconds the current * secret will live? */#define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */#define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */#define SCTP_COOKIE_MULTIPLE 32 /* Pad out our cookie to make our hash * functions simpler to write. */#if defined (CONFIG_SCTP_HMAC_MD5)#define SCTP_COOKIE_HMAC_ALG "hmac(md5)"#elif defined (CONFIG_SCTP_HMAC_SHA1)#define SCTP_COOKIE_HMAC_ALG "hmac(sha1)"#else#define SCTP_COOKIE_HMAC_ALG NULL#endif/* These return values describe the success or failure of a number of * routines which form the lower interface to SCTP_outqueue. */typedef enum { SCTP_XMIT_OK, SCTP_XMIT_PMTU_FULL, SCTP_XMIT_RWND_FULL, SCTP_XMIT_NAGLE_DELAY,} sctp_xmit_t;/* These are the commands for manipulating transports. */typedef enum { SCTP_TRANSPORT_UP, SCTP_TRANSPORT_DOWN,} sctp_transport_cmd_t;/* These are the address scopes defined mainly for IPv4 addresses * based on draft of SCTP IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>. * These scopes are hopefully generic enough to be used on scoping both * IPv4 and IPv6 addresses in SCTP. * At this point, the IPv6 scopes will be mapped to these internal scopes * as much as possible. */typedef enum { SCTP_SCOPE_GLOBAL, /* IPv4 global addresses */ SCTP_SCOPE_PRIVATE, /* IPv4 private addresses */ SCTP_SCOPE_LINK, /* IPv4 link local address */ SCTP_SCOPE_LOOPBACK, /* IPv4 loopback address */ SCTP_SCOPE_UNUSABLE, /* IPv4 unusable addresses */} sctp_scope_t;/* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>, * SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24, * 192.88.99.0/24. * Also, RFC 8.4, non-unicast addresses are not considered valid SCTP * addresses. */#define IS_IPV4_UNUSABLE_ADDRESS(a) \ ((htonl(INADDR_BROADCAST) == *a) || \ (MULTICAST(*a)) || \ (((unsigned char *)(a))[0] == 0) || \ ((((unsigned char *)(a))[0] == 198) && \ (((unsigned char *)(a))[1] == 18) && \ (((unsigned char *)(a))[2] == 0)) || \ ((((unsigned char *)(a))[0] == 192) && \ (((unsigned char *)(a))[1] == 88) && \ (((unsigned char *)(a))[2] == 99)))/* IPv4 Link-local addresses: 169.254.0.0/16. */#define IS_IPV4_LINK_ADDRESS(a) \ ((((unsigned char *)(a))[0] == 169) && \ (((unsigned char *)(a))[1] == 254))/* RFC 1918 "Address Allocation for Private Internets" defines the IPv4 * private address space as the following: * * 10.0.0.0 - 10.255.255.255 (10/8 prefix) * 172.16.0.0.0 - 172.31.255.255 (172.16/12 prefix) * 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) */#define IS_IPV4_PRIVATE_ADDRESS(a) \ ((((unsigned char *)(a))[0] == 10) || \ ((((unsigned char *)(a))[0] == 172) && \ (((unsigned char *)(a))[1] >= 16) && \ (((unsigned char *)(a))[1] < 32)) || \ ((((unsigned char *)(a))[0] == 192) && \ (((unsigned char *)(a))[1] == 168)))/* Flags used for the bind address copy functions. */#define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by local sock family */#define SCTP_ADDR4_PEERSUPP 0x00000002 /* IPv4 address is supported by peer */#define SCTP_ADDR6_PEERSUPP 0x00000004 /* IPv6 address is supported by peer *//* Reasons to retransmit. */typedef enum { SCTP_RTXR_T3_RTX, SCTP_RTXR_FAST_RTX, SCTP_RTXR_PMTUD, SCTP_RTXR_T1_RTX,} sctp_retransmit_reason_t;/* Reasons to lower cwnd. */typedef enum { SCTP_LOWER_CWND_T3_RTX, SCTP_LOWER_CWND_FAST_RTX, SCTP_LOWER_CWND_ECNE, SCTP_LOWER_CWND_INACTIVE,} sctp_lower_cwnd_t;/* SCTP-AUTH Necessary constants *//* SCTP-AUTH, Section 3.3 * * The following Table 2 shows the currently defined values for HMAC * identifiers. * * +-----------------+--------------------------+ * | HMAC Identifier | Message Digest Algorithm | * +-----------------+--------------------------+ * | 0 | Reserved | * | 1 | SHA-1 defined in [8] | * | 2 | Reserved | * | 3 | SHA-256 defined in [8] | * +-----------------+--------------------------+ */enum { SCTP_AUTH_HMAC_ID_RESERVED_0, SCTP_AUTH_HMAC_ID_SHA1, SCTP_AUTH_HMAC_ID_RESERVED_2,#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE) SCTP_AUTH_HMAC_ID_SHA256,#endif __SCTP_AUTH_HMAC_MAX};#define SCTP_AUTH_HMAC_ID_MAX __SCTP_AUTH_HMAC_MAX - 1#define SCTP_AUTH_NUM_HMACS __SCTP_AUTH_HMAC_MAX#define SCTP_SHA1_SIG_SIZE 20#define SCTP_SHA256_SIG_SIZE 32/* SCTP-AUTH, Section 3.2 * The chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE and AUTH chunks * MUST NOT be listed in the CHUNKS parameter */#define SCTP_NUM_NOAUTH_CHUNKS 4#define SCTP_AUTH_MAX_CHUNKS (SCTP_NUM_CHUNK_TYPES - SCTP_NUM_NOAUTH_CHUNKS)/* SCTP-AUTH Section 6.1 * The RANDOM parameter MUST contain a 32 byte random number. */#define SCTP_AUTH_RANDOM_LENGTH 32#endif /* __sctp_constants_h__ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?