diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-10-03 20:51:34 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:31 -0400 |
commit | bbd0d59809f923ea2b540cbd781b32110e249f6e (patch) | |
tree | 8a278cfa0e7bcc7b415e93baf6d1a93536efe17a /net/sctp/sm_statetable.c | |
parent | 4cd57c8078fae0a4b1bf421191e94626d0cba92a (diff) |
[SCTP]: Implement the receive and verification of AUTH chunk
This patch implements the receive path needed to process authenticated
chunks. Add ability to process the AUTH chunk and handle edge cases
for authenticated COOKIE-ECHO as well.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_statetable.c')
-rw-r--r-- | net/sctp/sm_statetable.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c index ddb0ba3974b0..a93a4bc8f68f 100644 --- a/net/sctp/sm_statetable.c +++ b/net/sctp/sm_statetable.c | |||
@@ -523,6 +523,34 @@ static const sctp_sm_table_entry_t prsctp_chunk_event_table[SCTP_NUM_PRSCTP_CHUN | |||
523 | TYPE_SCTP_FWD_TSN, | 523 | TYPE_SCTP_FWD_TSN, |
524 | }; /*state_fn_t prsctp_chunk_event_table[][] */ | 524 | }; /*state_fn_t prsctp_chunk_event_table[][] */ |
525 | 525 | ||
526 | #define TYPE_SCTP_AUTH { \ | ||
527 | /* SCTP_STATE_EMPTY */ \ | ||
528 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ | ||
529 | /* SCTP_STATE_CLOSED */ \ | ||
530 | TYPE_SCTP_FUNC(sctp_sf_ootb), \ | ||
531 | /* SCTP_STATE_COOKIE_WAIT */ \ | ||
532 | TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ | ||
533 | /* SCTP_STATE_COOKIE_ECHOED */ \ | ||
534 | TYPE_SCTP_FUNC(sctp_sf_eat_auth), \ | ||
535 | /* SCTP_STATE_ESTABLISHED */ \ | ||
536 | TYPE_SCTP_FUNC(sctp_sf_eat_auth), \ | ||
537 | /* SCTP_STATE_SHUTDOWN_PENDING */ \ | ||
538 | TYPE_SCTP_FUNC(sctp_sf_eat_auth), \ | ||
539 | /* SCTP_STATE_SHUTDOWN_SENT */ \ | ||
540 | TYPE_SCTP_FUNC(sctp_sf_eat_auth), \ | ||
541 | /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ | ||
542 | TYPE_SCTP_FUNC(sctp_sf_eat_auth), \ | ||
543 | /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ | ||
544 | TYPE_SCTP_FUNC(sctp_sf_eat_auth), \ | ||
545 | } /* TYPE_SCTP_AUTH */ | ||
546 | |||
547 | /* The primary index for this table is the chunk type. | ||
548 | * The secondary index for this table is the state. | ||
549 | */ | ||
550 | static const sctp_sm_table_entry_t auth_chunk_event_table[SCTP_NUM_AUTH_CHUNK_TYPES][SCTP_STATE_NUM_STATES] = { | ||
551 | TYPE_SCTP_AUTH, | ||
552 | }; /*state_fn_t auth_chunk_event_table[][] */ | ||
553 | |||
526 | static const sctp_sm_table_entry_t | 554 | static const sctp_sm_table_entry_t |
527 | chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = { | 555 | chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = { |
528 | /* SCTP_STATE_EMPTY */ | 556 | /* SCTP_STATE_EMPTY */ |
@@ -976,5 +1004,10 @@ static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid, | |||
976 | return &addip_chunk_event_table[1][state]; | 1004 | return &addip_chunk_event_table[1][state]; |
977 | } | 1005 | } |
978 | 1006 | ||
1007 | if (sctp_auth_enable) { | ||
1008 | if (cid == SCTP_CID_AUTH) | ||
1009 | return &auth_chunk_event_table[0][state]; | ||
1010 | } | ||
1011 | |||
979 | return &chunk_event_table_unknown[state]; | 1012 | return &chunk_event_table_unknown[state]; |
980 | } | 1013 | } |