aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/constants.h
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2007-10-09 04:15:59 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:29 -0400
commit1f485649f52929d9937b346a920a522a7363e202 (patch)
tree663ac69ba7fff641e243306d7aad5b95378e4d6d /include/net/sctp/constants.h
parentf7b0e93ba1a484700bd1b0e36bdaddaf4eb51b0b (diff)
[SCTP]: Implement SCTP-AUTH internals
This patch implements the internals operations of the AUTH, such as key computation and storage. It also adds necessary variables to the SCTP data structures. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/constants.h')
-rw-r--r--include/net/sctp/constants.h49
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. */
74typedef enum { 80typedef 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 */
435enum {
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__ */