diff options
Diffstat (limited to 'include/net/sctp/constants.h')
-rw-r--r-- | include/net/sctp/constants.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index bb37724495a5..777118f06dba 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. */ |
74 | typedef enum { | 80 | typedef enum { |
75 | 81 | ||
@@ -409,4 +415,45 @@ typedef enum { | |||
409 | SCTP_LOWER_CWND_INACTIVE, | 415 | SCTP_LOWER_CWND_INACTIVE, |
410 | } sctp_lower_cwnd_t; | 416 | } sctp_lower_cwnd_t; |
411 | 417 | ||
418 | |||
419 | /* SCTP-AUTH Necessary constants */ | ||
420 | |||
421 | /* SCTP-AUTH, Section 3.3 | ||
422 | * | ||
423 | * The following Table 2 shows the currently defined values for HMAC | ||
424 | * identifiers. | ||
425 | * | ||
426 | * +-----------------+--------------------------+ | ||
427 | * | HMAC Identifier | Message Digest Algorithm | | ||
428 | * +-----------------+--------------------------+ | ||
429 | * | 0 | Reserved | | ||
430 | * | 1 | SHA-1 defined in [8] | | ||
431 | * | 2 | Reserved | | ||
432 | * | 3 | SHA-256 defined in [8] | | ||
433 | * +-----------------+--------------------------+ | ||
434 | */ | ||
435 | enum { | ||
436 | SCTP_AUTH_HMAC_ID_RESERVED_0, | ||
437 | SCTP_AUTH_HMAC_ID_SHA1, | ||
438 | SCTP_AUTH_HMAC_ID_RESERVED_2, | ||
439 | SCTP_AUTH_HMAC_ID_SHA256 | ||
440 | }; | ||
441 | |||
442 | #define SCTP_AUTH_HMAC_ID_MAX SCTP_AUTH_HMAC_ID_SHA256 | ||
443 | #define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1) | ||
444 | #define SCTP_SHA1_SIG_SIZE 20 | ||
445 | #define SCTP_SHA256_SIG_SIZE 32 | ||
446 | |||
447 | /* SCTP-AUTH, Section 3.2 | ||
448 | * The chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE and AUTH chunks | ||
449 | * MUST NOT be listed in the CHUNKS parameter | ||
450 | */ | ||
451 | #define SCTP_NUM_NOAUTH_CHUNKS 4 | ||
452 | #define SCTP_AUTH_MAX_CHUNKS (SCTP_NUM_CHUNK_TYPES - SCTP_NUM_NOAUTH_CHUNKS) | ||
453 | |||
454 | /* SCTP-AUTH Section 6.1 | ||
455 | * The RANDOM parameter MUST contain a 32 byte random number. | ||
456 | */ | ||
457 | #define SCTP_AUTH_RANDOM_LENGTH 32 | ||
458 | |||
412 | #endif /* __sctp_constants_h__ */ | 459 | #endif /* __sctp_constants_h__ */ |