Commit 6d85e68f authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: remove the typedef sctp_cid_t

This patch is to remove the typedef sctp_cid_t, and replace
with struct sctp_cid in the places where it's using this
typedef.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 922dbc5b
...@@ -82,7 +82,7 @@ struct sctp_chunkhdr { ...@@ -82,7 +82,7 @@ struct sctp_chunkhdr {
* Value field. It takes a value from 0 to 254. The value of 255 is * Value field. It takes a value from 0 to 254. The value of 255 is
* reserved for future use as an extension field. * reserved for future use as an extension field.
*/ */
typedef enum { enum sctp_cid {
SCTP_CID_DATA = 0, SCTP_CID_DATA = 0,
SCTP_CID_INIT = 1, SCTP_CID_INIT = 1,
SCTP_CID_INIT_ACK = 2, SCTP_CID_INIT_ACK = 2,
...@@ -109,7 +109,7 @@ typedef enum { ...@@ -109,7 +109,7 @@ typedef enum {
SCTP_CID_ASCONF = 0xC1, SCTP_CID_ASCONF = 0xC1,
SCTP_CID_ASCONF_ACK = 0x80, SCTP_CID_ASCONF_ACK = 0x80,
SCTP_CID_RECONF = 0x82, SCTP_CID_RECONF = 0x82,
} sctp_cid_t; /* enum */ }; /* enum */
/* Section 3.2 /* Section 3.2
......
...@@ -97,8 +97,10 @@ void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, ...@@ -97,8 +97,10 @@ void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc,
struct sctp_hmac_algo_param *hmacs); struct sctp_hmac_algo_param *hmacs);
int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
__be16 hmac_id); __be16 hmac_id);
int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc); int sctp_auth_send_cid(enum sctp_cid chunk,
int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc); const struct sctp_association *asoc);
int sctp_auth_recv_cid(enum sctp_cid chunk,
const struct sctp_association *asoc);
void sctp_auth_calculate_hmac(const struct sctp_association *asoc, void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
struct sk_buff *skb, struct sk_buff *skb,
struct sctp_auth_chunk *auth, gfp_t gfp); struct sctp_auth_chunk *auth, gfp_t gfp);
......
...@@ -130,7 +130,7 @@ typedef enum { ...@@ -130,7 +130,7 @@ typedef enum {
*/ */
typedef union { typedef union {
sctp_cid_t chunk; enum sctp_cid chunk;
sctp_event_timeout_t timeout; sctp_event_timeout_t timeout;
sctp_event_other_t other; sctp_event_other_t other;
sctp_event_primitive_t primitive; sctp_event_primitive_t primitive;
...@@ -141,7 +141,7 @@ static inline sctp_subtype_t \ ...@@ -141,7 +141,7 @@ static inline sctp_subtype_t \
SCTP_ST_## _name (_type _arg) \ SCTP_ST_## _name (_type _arg) \
{ sctp_subtype_t _retval; _retval._elt = _arg; return _retval; } { sctp_subtype_t _retval; _retval._elt = _arg; return _retval; }
SCTP_SUBTYPE_CONSTRUCTOR(CHUNK, sctp_cid_t, chunk) SCTP_SUBTYPE_CONSTRUCTOR(CHUNK, enum sctp_cid, chunk)
SCTP_SUBTYPE_CONSTRUCTOR(TIMEOUT, sctp_event_timeout_t, timeout) SCTP_SUBTYPE_CONSTRUCTOR(TIMEOUT, sctp_event_timeout_t, timeout)
SCTP_SUBTYPE_CONSTRUCTOR(OTHER, sctp_event_other_t, other) SCTP_SUBTYPE_CONSTRUCTOR(OTHER, sctp_event_other_t, other)
SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive)
......
...@@ -1297,7 +1297,7 @@ int sctp_has_association(struct net *net, const union sctp_addr *laddr, ...@@ -1297,7 +1297,7 @@ int sctp_has_association(struct net *net, const union sctp_addr *laddr,
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_cid_t, sctp_init_chunk_t *peer_init, enum sctp_cid cid, sctp_init_chunk_t *peer_init,
struct sctp_chunk *chunk, struct sctp_chunk **err_chunk); struct sctp_chunk *chunk, struct sctp_chunk **err_chunk);
int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk,
const union sctp_addr *peer, const union sctp_addr *peer,
......
...@@ -632,7 +632,7 @@ void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, ...@@ -632,7 +632,7 @@ void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc,
/* Check to see if the given chunk is supposed to be authenticated */ /* Check to see if the given chunk is supposed to be authenticated */
static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param) static int __sctp_auth_cid(enum sctp_cid chunk, struct sctp_chunks_param *param)
{ {
unsigned short len; unsigned short len;
int found = 0; int found = 0;
...@@ -668,7 +668,7 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param) ...@@ -668,7 +668,7 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param)
} }
/* Check if peer requested that this chunk is authenticated */ /* Check if peer requested that this chunk is authenticated */
int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc) int sctp_auth_send_cid(enum sctp_cid chunk, const struct sctp_association *asoc)
{ {
if (!asoc) if (!asoc)
return 0; return 0;
...@@ -680,7 +680,7 @@ int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc) ...@@ -680,7 +680,7 @@ int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc)
} }
/* Check if we requested that peer authenticate this chunk. */ /* Check if we requested that peer authenticate this chunk. */
int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc) int sctp_auth_recv_cid(enum sctp_cid chunk, const struct sctp_association *asoc)
{ {
if (!asoc) if (!asoc)
return 0; return 0;
......
...@@ -2123,7 +2123,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net, ...@@ -2123,7 +2123,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
const struct sctp_endpoint *ep, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
union sctp_params param, union sctp_params param,
sctp_cid_t cid, enum sctp_cid cid,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
struct sctp_chunk **err_chunk) struct sctp_chunk **err_chunk)
{ {
...@@ -2240,7 +2240,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net, ...@@ -2240,7 +2240,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
/* Verify the INIT packet before we process it. */ /* Verify the INIT packet before we process it. */
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, sctp_cid_t cid, const struct sctp_association *asoc, enum sctp_cid cid,
sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk,
struct sctp_chunk **errp) struct sctp_chunk **errp)
{ {
......
...@@ -53,7 +53,7 @@ static const sctp_sm_table_entry_t ...@@ -53,7 +53,7 @@ static const sctp_sm_table_entry_t
timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][SCTP_STATE_NUM_STATES]; timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][SCTP_STATE_NUM_STATES];
static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(struct net *net, static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(struct net *net,
sctp_cid_t cid, enum sctp_cid cid,
sctp_state_t state); sctp_state_t state);
...@@ -968,7 +968,7 @@ static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][S ...@@ -968,7 +968,7 @@ static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][S
}; };
static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(struct net *net, static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(struct net *net,
sctp_cid_t cid, enum sctp_cid cid,
sctp_state_t state) sctp_state_t state)
{ {
if (state > SCTP_STATE_MAX) if (state > SCTP_STATE_MAX)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment