Blame view
net/sctp/debug.c
3.81 KB
47505b8bc treewide: Replace... |
1 |
// SPDX-License-Identifier: GPL-2.0-or-later |
60c778b25 [SCTP]: Stop clai... |
2 |
/* SCTP kernel implementation |
1da177e4c Linux-2.6.12-rc2 |
3 4 5 6 |
* (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. |
d808ad9ab [NET] SCTP: Fix w... |
7 |
* |
60c778b25 [SCTP]: Stop clai... |
8 |
* This file is part of the SCTP kernel implementation |
d808ad9ab [NET] SCTP: Fix w... |
9 |
* |
1da177e4c Linux-2.6.12-rc2 |
10 11 |
* This file converts numerical ID value to alphabetical names for SCTP * terms such as chunk type, parameter time, event type, etc. |
d808ad9ab [NET] SCTP: Fix w... |
12 |
* |
1da177e4c Linux-2.6.12-rc2 |
13 14 |
* Please send any bug reports or fixes you make to the * email address(es): |
91705c61b net: sctp: trivia... |
15 |
* lksctp developers <linux-sctp@vger.kernel.org> |
d808ad9ab [NET] SCTP: Fix w... |
16 |
* |
d808ad9ab [NET] SCTP: Fix w... |
17 |
* Written or modified by: |
1da177e4c Linux-2.6.12-rc2 |
18 19 20 21 22 23 |
* La Monte H.P. Yarroll <piggy@acm.org> * Karl Knutson <karl@athena.chicago.il.us> * Xingang Guo <xingang.guo@intel.com> * Jon Grimm <jgrimm@us.ibm.com> * Daisy Chang <daisyc@us.ibm.com> * Sridhar Samudrala <sri@us.ibm.com> |
1da177e4c Linux-2.6.12-rc2 |
24 25 26 |
*/ #include <net/sctp/sctp.h> |
1da177e4c Linux-2.6.12-rc2 |
27 |
/* These are printable forms of Chunk ID's from section 3.1. */ |
36cbd3dcc net: mark read-on... |
28 |
static const char *const sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = { |
1da177e4c Linux-2.6.12-rc2 |
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
"DATA", "INIT", "INIT_ACK", "SACK", "HEARTBEAT", "HEARTBEAT_ACK", "ABORT", "SHUTDOWN", "SHUTDOWN_ACK", "ERROR", "COOKIE_ECHO", "COOKIE_ACK", "ECN_ECNE", "ECN_CWR", "SHUTDOWN_COMPLETE", }; /* Lookup "chunk type" debug name. */ |
bfc6f8270 sctp: remove the ... |
47 |
const char *sctp_cname(const union sctp_subtype cid) |
1da177e4c Linux-2.6.12-rc2 |
48 |
{ |
1da177e4c Linux-2.6.12-rc2 |
49 50 |
if (cid.chunk <= SCTP_CID_BASE_MAX) return sctp_cid_tbl[cid.chunk]; |
d808ad9ab [NET] SCTP: Fix w... |
51 |
|
1da177e4c Linux-2.6.12-rc2 |
52 53 54 55 56 57 58 59 60 |
switch (cid.chunk) { case SCTP_CID_ASCONF: return "ASCONF"; case SCTP_CID_ASCONF_ACK: return "ASCONF_ACK"; case SCTP_CID_FWD_TSN: return "FWD_TSN"; |
906f8257e sctp: Add some mi... |
61 62 |
case SCTP_CID_AUTH: return "AUTH"; |
d19697590 sctp: add SCTP_CI... |
63 64 |
case SCTP_CID_RECONF: return "RECONF"; |
947820b95 sctp: add SCTP_CI... |
65 66 67 68 69 |
case SCTP_CID_I_DATA: return "I_DATA"; case SCTP_CID_I_FWD_TSN: return "I_FWD_TSN"; |
1da177e4c Linux-2.6.12-rc2 |
70 |
default: |
3ff50b799 [NET]: cleanup ex... |
71 72 |
break; } |
1da177e4c Linux-2.6.12-rc2 |
73 74 75 76 |
return "unknown chunk"; } /* These are printable forms of the states. */ |
36cbd3dcc net: mark read-on... |
77 |
const char *const sctp_state_tbl[SCTP_STATE_NUM_STATES] = { |
1da177e4c Linux-2.6.12-rc2 |
78 79 80 81 82 83 84 85 86 87 88 |
"STATE_CLOSED", "STATE_COOKIE_WAIT", "STATE_COOKIE_ECHOED", "STATE_ESTABLISHED", "STATE_SHUTDOWN_PENDING", "STATE_SHUTDOWN_SENT", "STATE_SHUTDOWN_RECEIVED", "STATE_SHUTDOWN_ACK_SENT", }; /* Events that could change the state of an association. */ |
36cbd3dcc net: mark read-on... |
89 |
const char *const sctp_evttype_tbl[] = { |
1da177e4c Linux-2.6.12-rc2 |
90 91 92 93 94 95 96 97 |
"EVENT_T_unknown", "EVENT_T_CHUNK", "EVENT_T_TIMEOUT", "EVENT_T_OTHER", "EVENT_T_PRIMITIVE" }; /* Return value of a state function */ |
36cbd3dcc net: mark read-on... |
98 |
const char *const sctp_status_tbl[] = { |
1da177e4c Linux-2.6.12-rc2 |
99 100 101 102 103 104 105 106 107 108 109 110 |
"DISPOSITION_DISCARD", "DISPOSITION_CONSUME", "DISPOSITION_NOMEM", "DISPOSITION_DELETE_TCB", "DISPOSITION_ABORT", "DISPOSITION_VIOLATION", "DISPOSITION_NOT_IMPL", "DISPOSITION_ERROR", "DISPOSITION_BUG" }; /* Printable forms of primitives */ |
36cbd3dcc net: mark read-on... |
111 |
static const char *const sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = { |
1da177e4c Linux-2.6.12-rc2 |
112 113 114 115 116 |
"PRIMITIVE_ASSOCIATE", "PRIMITIVE_SHUTDOWN", "PRIMITIVE_ABORT", "PRIMITIVE_SEND", "PRIMITIVE_REQUESTHEARTBEAT", |
906f8257e sctp: Add some mi... |
117 |
"PRIMITIVE_ASCONF", |
1da177e4c Linux-2.6.12-rc2 |
118 119 120 |
}; /* Lookup primitive debug name. */ |
bfc6f8270 sctp: remove the ... |
121 |
const char *sctp_pname(const union sctp_subtype id) |
1da177e4c Linux-2.6.12-rc2 |
122 |
{ |
1da177e4c Linux-2.6.12-rc2 |
123 124 125 126 |
if (id.primitive <= SCTP_EVENT_PRIMITIVE_MAX) return sctp_primitive_tbl[id.primitive]; return "unknown_primitive"; } |
36cbd3dcc net: mark read-on... |
127 |
static const char *const sctp_other_tbl[] = { |
1da177e4c Linux-2.6.12-rc2 |
128 |
"NO_PENDING_TSN", |
d808ad9ab [NET] SCTP: Fix w... |
129 |
"ICMP_PROTO_UNREACH", |
1da177e4c Linux-2.6.12-rc2 |
130 131 132 |
}; /* Lookup "other" debug name. */ |
bfc6f8270 sctp: remove the ... |
133 |
const char *sctp_oname(const union sctp_subtype id) |
1da177e4c Linux-2.6.12-rc2 |
134 |
{ |
1da177e4c Linux-2.6.12-rc2 |
135 136 137 138 |
if (id.other <= SCTP_EVENT_OTHER_MAX) return sctp_other_tbl[id.other]; return "unknown 'other' event"; } |
36cbd3dcc net: mark read-on... |
139 |
static const char *const sctp_timer_tbl[] = { |
1da177e4c Linux-2.6.12-rc2 |
140 141 142 143 144 145 146 147 |
"TIMEOUT_NONE", "TIMEOUT_T1_COOKIE", "TIMEOUT_T1_INIT", "TIMEOUT_T2_SHUTDOWN", "TIMEOUT_T3_RTX", "TIMEOUT_T4_RTO", "TIMEOUT_T5_SHUTDOWN_GUARD", "TIMEOUT_HEARTBEAT", |
146408693 net: sctp: fix ar... |
148 |
"TIMEOUT_RECONF", |
1da177e4c Linux-2.6.12-rc2 |
149 150 151 152 153 |
"TIMEOUT_SACK", "TIMEOUT_AUTOCLOSE", }; /* Lookup timer debug name. */ |
bfc6f8270 sctp: remove the ... |
154 |
const char *sctp_tname(const union sctp_subtype id) |
1da177e4c Linux-2.6.12-rc2 |
155 |
{ |
146408693 net: sctp: fix ar... |
156 157 158 |
BUILD_BUG_ON(SCTP_EVENT_TIMEOUT_MAX + 1 != ARRAY_SIZE(sctp_timer_tbl)); if (id.timeout < ARRAY_SIZE(sctp_timer_tbl)) |
1da177e4c Linux-2.6.12-rc2 |
159 160 161 |
return sctp_timer_tbl[id.timeout]; return "unknown_timer"; } |