aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/constants.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/constants.h')
-rw-r--r--include/net/sctp/constants.h53
1 files changed, 51 insertions, 2 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index bb37724495a5..da8354e8e33c 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -64,12 +64,18 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM };
64#define SCTP_CID_MAX SCTP_CID_ASCONF_ACK 64#define SCTP_CID_MAX SCTP_CID_ASCONF_ACK
65 65
66#define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) 66#define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1)
67#define SCTP_NUM_CHUNK_TYPES (SCTP_NUM_BASE_CHUNKTYPES + 2)
68 67
69#define SCTP_NUM_ADDIP_CHUNK_TYPES 2 68#define SCTP_NUM_ADDIP_CHUNK_TYPES 2
70 69
71#define SCTP_NUM_PRSCTP_CHUNK_TYPES 1 70#define SCTP_NUM_PRSCTP_CHUNK_TYPES 1
72 71
72#define SCTP_NUM_AUTH_CHUNK_TYPES 1
73
74#define SCTP_NUM_CHUNK_TYPES (SCTP_NUM_BASE_CHUNK_TYPES + \
75 SCTP_NUM_ADDIP_CHUNK_TYPES +\
76 SCTP_NUM_PRSCTP_CHUNK_TYPES +\
77 SCTP_NUM_AUTH_CHUNK_TYPES)
78
73/* These are the different flavours of event. */ 79/* These are the different flavours of event. */
74typedef enum { 80typedef enum {
75 81
@@ -177,7 +183,9 @@ typedef enum {
177 SCTP_IERROR_NO_DATA, 183 SCTP_IERROR_NO_DATA,
178 SCTP_IERROR_BAD_STREAM, 184 SCTP_IERROR_BAD_STREAM,
179 SCTP_IERROR_BAD_PORTS, 185 SCTP_IERROR_BAD_PORTS,
180 186 SCTP_IERROR_AUTH_BAD_HMAC,
187 SCTP_IERROR_AUTH_BAD_KEYID,
188 SCTP_IERROR_PROTO_VIOLATION,
181} sctp_ierror_t; 189} sctp_ierror_t;
182 190
183 191
@@ -409,4 +417,45 @@ typedef enum {
409 SCTP_LOWER_CWND_INACTIVE, 417 SCTP_LOWER_CWND_INACTIVE,
410} sctp_lower_cwnd_t; 418} sctp_lower_cwnd_t;
411 419
420
421/* SCTP-AUTH Necessary constants */
422
423/* SCTP-AUTH, Section 3.3
424 *
425 * The following Table 2 shows the currently defined values for HMAC
426 * identifiers.
427 *
428 * +-----------------+--------------------------+
429 * | HMAC Identifier | Message Digest Algorithm |
430 * +-----------------+--------------------------+
431 * | 0 | Reserved |
432 * | 1 | SHA-1 defined in [8] |
433 * | 2 | Reserved |
434 * | 3 | SHA-256 defined in [8] |
435 * +-----------------+--------------------------+
436 */
437enum {
438 SCTP_AUTH_HMAC_ID_RESERVED_0,
439 SCTP_AUTH_HMAC_ID_SHA1,
440 SCTP_AUTH_HMAC_ID_RESERVED_2,
441 SCTP_AUTH_HMAC_ID_SHA256
442};
443
444#define SCTP_AUTH_HMAC_ID_MAX SCTP_AUTH_HMAC_ID_SHA256
445#define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1)
446#define SCTP_SHA1_SIG_SIZE 20
447#define SCTP_SHA256_SIG_SIZE 32
448
449/* SCTP-AUTH, Section 3.2
450 * The chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE and AUTH chunks
451 * MUST NOT be listed in the CHUNKS parameter
452 */
453#define SCTP_NUM_NOAUTH_CHUNKS 4
454#define SCTP_AUTH_MAX_CHUNKS (SCTP_NUM_CHUNK_TYPES - SCTP_NUM_NOAUTH_CHUNKS)
455
456/* SCTP-AUTH Section 6.1
457 * The RANDOM parameter MUST contain a 32 byte random number.
458 */
459#define SCTP_AUTH_RANDOM_LENGTH 32
460
412#endif /* __sctp_constants_h__ */ 461#endif /* __sctp_constants_h__ */