| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* SCTP kernel implementation |
|---|
| 2 | 3 | * (C) Copyright IBM Corp. 2001, 2004 |
|---|
| 3 | 4 | * Copyright (c) 1999-2000 Cisco, Inc. |
|---|
| .. | .. |
|---|
| 8 | 9 | * This file is part of the SCTP kernel implementation |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * These are the state tables for the SCTP state machine. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This SCTP implementation is free software; |
|---|
| 13 | | - * you can redistribute it and/or modify it under the terms of |
|---|
| 14 | | - * the GNU General Public License as published by |
|---|
| 15 | | - * the Free Software Foundation; either version 2, or (at your option) |
|---|
| 16 | | - * any later version. |
|---|
| 17 | | - * |
|---|
| 18 | | - * This SCTP implementation is distributed in the hope that it |
|---|
| 19 | | - * will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|---|
| 20 | | - * ************************ |
|---|
| 21 | | - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 22 | | - * See the GNU General Public License for more details. |
|---|
| 23 | | - * |
|---|
| 24 | | - * You should have received a copy of the GNU General Public License |
|---|
| 25 | | - * along with GNU CC; see the file COPYING. If not, see |
|---|
| 26 | | - * <http://www.gnu.org/licenses/>. |
|---|
| 27 | 12 | * |
|---|
| 28 | 13 | * Please send any bug reports or fixes you make to the |
|---|
| 29 | 14 | * email address(es): |
|---|
| .. | .. |
|---|
| 79 | 64 | |
|---|
| 80 | 65 | const struct sctp_sm_table_entry *sctp_sm_lookup_event( |
|---|
| 81 | 66 | struct net *net, |
|---|
| 82 | | - enum sctp_event event_type, |
|---|
| 67 | + enum sctp_event_type event_type, |
|---|
| 83 | 68 | enum sctp_state state, |
|---|
| 84 | 69 | union sctp_subtype event_subtype) |
|---|
| 85 | 70 | { |
|---|
| .. | .. |
|---|
| 991 | 976 | if (cid <= SCTP_CID_BASE_MAX) |
|---|
| 992 | 977 | return &chunk_event_table[cid][state]; |
|---|
| 993 | 978 | |
|---|
| 994 | | - if (net->sctp.prsctp_enable) { |
|---|
| 995 | | - if (cid == SCTP_CID_FWD_TSN || cid == SCTP_CID_I_FWD_TSN) |
|---|
| 996 | | - return &prsctp_chunk_event_table[0][state]; |
|---|
| 997 | | - } |
|---|
| 979 | + switch ((u16)cid) { |
|---|
| 980 | + case SCTP_CID_FWD_TSN: |
|---|
| 981 | + case SCTP_CID_I_FWD_TSN: |
|---|
| 982 | + return &prsctp_chunk_event_table[0][state]; |
|---|
| 998 | 983 | |
|---|
| 999 | | - if (net->sctp.addip_enable) { |
|---|
| 1000 | | - if (cid == SCTP_CID_ASCONF) |
|---|
| 1001 | | - return &addip_chunk_event_table[0][state]; |
|---|
| 984 | + case SCTP_CID_ASCONF: |
|---|
| 985 | + return &addip_chunk_event_table[0][state]; |
|---|
| 1002 | 986 | |
|---|
| 1003 | | - if (cid == SCTP_CID_ASCONF_ACK) |
|---|
| 1004 | | - return &addip_chunk_event_table[1][state]; |
|---|
| 1005 | | - } |
|---|
| 987 | + case SCTP_CID_ASCONF_ACK: |
|---|
| 988 | + return &addip_chunk_event_table[1][state]; |
|---|
| 1006 | 989 | |
|---|
| 1007 | | - if (net->sctp.reconf_enable) |
|---|
| 1008 | | - if (cid == SCTP_CID_RECONF) |
|---|
| 1009 | | - return &reconf_chunk_event_table[0][state]; |
|---|
| 990 | + case SCTP_CID_RECONF: |
|---|
| 991 | + return &reconf_chunk_event_table[0][state]; |
|---|
| 1010 | 992 | |
|---|
| 1011 | | - if (net->sctp.auth_enable) { |
|---|
| 1012 | | - if (cid == SCTP_CID_AUTH) |
|---|
| 1013 | | - return &auth_chunk_event_table[0][state]; |
|---|
| 993 | + case SCTP_CID_AUTH: |
|---|
| 994 | + return &auth_chunk_event_table[0][state]; |
|---|
| 1014 | 995 | } |
|---|
| 1015 | 996 | |
|---|
| 1016 | 997 | return &chunk_event_table_unknown[state]; |
|---|