Commit 127dbff1 authored by Jon Grimm's avatar Jon Grimm Committed by Sridhar Samudrala

[SCTP] Various code cleanup.

More typedef removals and naming consistency.
Remove sctp_association_t, sctp_endpoint_t, & sctp_endpoint_common_t.
parent c99bec6e
...@@ -182,7 +182,7 @@ typedef struct { ...@@ -182,7 +182,7 @@ typedef struct {
/* Create a new sctp_command_sequence. /* Create a new sctp_command_sequence.
* Return NULL if creating a new sequence fails. * Return NULL if creating a new sequence fails.
*/ */
sctp_cmd_seq_t *sctp_new_cmd_seq(int priority); sctp_cmd_seq_t *sctp_new_cmd_seq(int gfp);
/* Initialize a block of memory as a command sequence. /* Initialize a block of memory as a command sequence.
* Return 0 if the initialization fails. * Return 0 if the initialization fails.
......
...@@ -125,7 +125,7 @@ extern struct sctp_protocol sctp_proto; ...@@ -125,7 +125,7 @@ extern struct sctp_protocol sctp_proto;
extern struct sock *sctp_get_ctl_sock(void); extern struct sock *sctp_get_ctl_sock(void);
extern int sctp_copy_local_addr_list(struct sctp_protocol *, extern int sctp_copy_local_addr_list(struct sctp_protocol *,
struct sctp_bind_addr *, struct sctp_bind_addr *,
sctp_scope_t, int priority, int flags); sctp_scope_t, int gfp, int flags);
extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
extern int sctp_register_pf(struct sctp_pf *, sa_family_t); extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
...@@ -141,11 +141,11 @@ extern unsigned int sctp_poll(struct file *file, struct socket *sock, ...@@ -141,11 +141,11 @@ extern unsigned int sctp_poll(struct file *file, struct socket *sock,
/* /*
* sctp/primitive.c * sctp/primitive.c
*/ */
extern int sctp_primitive_ASSOCIATE(sctp_association_t *, void *arg); extern int sctp_primitive_ASSOCIATE(struct sctp_association *, void *arg);
extern int sctp_primitive_SHUTDOWN(sctp_association_t *, void *arg); extern int sctp_primitive_SHUTDOWN(struct sctp_association *, void *arg);
extern int sctp_primitive_ABORT(sctp_association_t *, void *arg); extern int sctp_primitive_ABORT(struct sctp_association *, void *arg);
extern int sctp_primitive_SEND(sctp_association_t *, void *arg); extern int sctp_primitive_SEND(struct sctp_association *, void *arg);
extern int sctp_primitive_REQUESTHEARTBEAT(sctp_association_t *, void *arg); extern int sctp_primitive_REQUESTHEARTBEAT(struct sctp_association *, void *arg);
/* /*
* sctp/crc32c.c * sctp/crc32c.c
...@@ -159,22 +159,23 @@ extern __u32 sctp_end_cksum(__u32 cksum); ...@@ -159,22 +159,23 @@ extern __u32 sctp_end_cksum(__u32 cksum);
*/ */
extern int sctp_rcv(struct sk_buff *skb); extern int sctp_rcv(struct sk_buff *skb);
extern void sctp_v4_err(struct sk_buff *skb, u32 info); extern void sctp_v4_err(struct sk_buff *skb, u32 info);
extern void sctp_hash_established(sctp_association_t *); extern void sctp_hash_established(struct sctp_association *);
extern void __sctp_hash_established(sctp_association_t *); extern void __sctp_hash_established(struct sctp_association *);
extern void sctp_unhash_established(sctp_association_t *); extern void sctp_unhash_established(struct sctp_association *);
extern void __sctp_unhash_established(sctp_association_t *); extern void __sctp_unhash_established(struct sctp_association *);
extern void sctp_hash_endpoint(sctp_endpoint_t *); extern void sctp_hash_endpoint(struct sctp_endpoint *);
extern void __sctp_hash_endpoint(sctp_endpoint_t *); extern void __sctp_hash_endpoint(struct sctp_endpoint *);
extern void sctp_unhash_endpoint(sctp_endpoint_t *); extern void sctp_unhash_endpoint(struct sctp_endpoint *);
extern void __sctp_unhash_endpoint(sctp_endpoint_t *); extern void __sctp_unhash_endpoint(struct sctp_endpoint *);
extern sctp_association_t *__sctp_lookup_association(const union sctp_addr *, extern struct sctp_association *__sctp_lookup_association(
const union sctp_addr *, const union sctp_addr *,
struct sctp_transport **); const union sctp_addr *,
struct sctp_transport **);
extern struct sock *sctp_err_lookup(int family, struct sk_buff *, extern struct sock *sctp_err_lookup(int family, struct sk_buff *,
struct sctphdr *, struct sctp_endpoint **, struct sctphdr *, struct sctp_endpoint **,
struct sctp_association **, struct sctp_association **,
struct sctp_transport **); struct sctp_transport **);
extern void sctp_err_finish(struct sock *, struct sctp_endpoint *, extern void sctp_err_finish(struct sock *, struct sctp_endpoint *,
struct sctp_association *); struct sctp_association *);
extern void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, extern void sctp_icmp_frag_needed(struct sock *, struct sctp_association *,
struct sctp_transport *t, __u32 pmtu); struct sctp_transport *t, __u32 pmtu);
...@@ -335,20 +336,20 @@ static inline void sctp_v6_exit(void) { return; } ...@@ -335,20 +336,20 @@ static inline void sctp_v6_exit(void) { return; }
#define sctp_crypto_hmac crypto_hmac #define sctp_crypto_hmac crypto_hmac
#else #else
#define sctp_crypto_alloc_tfm(x...) NULL #define sctp_crypto_alloc_tfm(x...) NULL
#define sctp_crypto_free_tfm(x...) #define sctp_crypto_free_tfm(x...)
#define sctp_crypto_hmac(x...) #define sctp_crypto_hmac(x...)
#endif #endif
/* Map an association to an assoc_id. */ /* Map an association to an assoc_id. */
static inline sctp_assoc_t sctp_assoc2id(const sctp_association_t *asoc) static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc)
{ {
return (sctp_assoc_t) asoc; return (sctp_assoc_t) asoc;
} }
/* Look up the association by its id. */ /* Look up the association by its id. */
sctp_association_t *sctp_id2assoc(struct sock *sk, sctp_assoc_t id); struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id);
/* A macro to walk a list of skbs. */ /* A macro to walk a list of skbs. */
...@@ -507,10 +508,10 @@ static inline int ipver2af(__u8 ipver) ...@@ -507,10 +508,10 @@ static inline int ipver2af(__u8 ipver)
/* Perform some sanity checks. */ /* Perform some sanity checks. */
static inline int sctp_sanity_check(void) static inline int sctp_sanity_check(void)
{ {
SCTP_ASSERT(sizeof(struct sctp_ulpevent) <= SCTP_ASSERT(sizeof(struct sctp_ulpevent) <=
sizeof(((struct sk_buff *)0)->cb), sizeof(((struct sk_buff *)0)->cb),
"SCTP: ulpevent does not fit in skb!\n", return 0); "SCTP: ulpevent does not fit in skb!\n", return 0);
return 1; return 1;
} }
......
...@@ -81,8 +81,8 @@ typedef struct { ...@@ -81,8 +81,8 @@ typedef struct {
int action; int action;
} sctp_sm_command_t; } sctp_sm_command_t;
typedef sctp_disposition_t (sctp_state_fn_t) (const sctp_endpoint_t *, typedef sctp_disposition_t (sctp_state_fn_t) (const struct sctp_endpoint *,
const sctp_association_t *, const struct sctp_association *,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *); sctp_cmd_seq_t *);
...@@ -209,67 +209,67 @@ __u32 sctp_generate_verification_tag(void); ...@@ -209,67 +209,67 @@ __u32 sctp_generate_verification_tag(void);
void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
/* Prototypes for chunk-building functions. */ /* Prototypes for chunk-building functions. */
sctp_chunk_t *sctp_make_init(const sctp_association_t *, sctp_chunk_t *sctp_make_init(const struct sctp_association *,
const sctp_bind_addr_t *, const sctp_bind_addr_t *,
int priority, int vparam_len); int gfp, int vparam_len);
sctp_chunk_t *sctp_make_init_ack(const sctp_association_t *, sctp_chunk_t *sctp_make_init_ack(const struct sctp_association *,
const sctp_chunk_t *, const sctp_chunk_t *,
const int priority, const int gfp,
const int unkparam_len); const int unkparam_len);
sctp_chunk_t *sctp_make_cookie_echo(const sctp_association_t *, sctp_chunk_t *sctp_make_cookie_echo(const struct sctp_association *,
const sctp_chunk_t *); const sctp_chunk_t *);
sctp_chunk_t *sctp_make_cookie_ack(const sctp_association_t *, sctp_chunk_t *sctp_make_cookie_ack(const struct sctp_association *,
const sctp_chunk_t *); const sctp_chunk_t *);
sctp_chunk_t *sctp_make_cwr(const sctp_association_t *, sctp_chunk_t *sctp_make_cwr(const struct sctp_association *,
const __u32 lowest_tsn, const __u32 lowest_tsn,
const sctp_chunk_t *); const sctp_chunk_t *);
sctp_chunk_t *sctp_make_datafrag(sctp_association_t *, sctp_chunk_t *sctp_make_datafrag(struct sctp_association *,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int len, const __u8 *data, int len, const __u8 *data,
__u8 flags, __u16 ssn); __u8 flags, __u16 ssn);
sctp_chunk_t * sctp_make_datafrag_empty(sctp_association_t *, sctp_chunk_t * sctp_make_datafrag_empty(struct sctp_association *,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int len, const __u8 flags, int len, const __u8 flags,
__u16 ssn); __u16 ssn);
sctp_chunk_t *sctp_make_data(sctp_association_t *, sctp_chunk_t *sctp_make_data(struct sctp_association *,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int len, const __u8 *data); int len, const __u8 *data);
sctp_chunk_t *sctp_make_data_empty(sctp_association_t *, sctp_chunk_t *sctp_make_data_empty(struct sctp_association *,
const struct sctp_sndrcvinfo *, int len); const struct sctp_sndrcvinfo *, int len);
sctp_chunk_t *sctp_make_ecne(const sctp_association_t *, sctp_chunk_t *sctp_make_ecne(const struct sctp_association *,
const __u32); const __u32);
sctp_chunk_t *sctp_make_sack(const sctp_association_t *); sctp_chunk_t *sctp_make_sack(const struct sctp_association *);
sctp_chunk_t *sctp_make_shutdown(const sctp_association_t *asoc); sctp_chunk_t *sctp_make_shutdown(const struct sctp_association *asoc);
sctp_chunk_t *sctp_make_shutdown_ack(const sctp_association_t *asoc, sctp_chunk_t *sctp_make_shutdown_ack(const struct sctp_association *asoc,
const sctp_chunk_t *); const sctp_chunk_t *);
sctp_chunk_t *sctp_make_shutdown_complete(const sctp_association_t *, sctp_chunk_t *sctp_make_shutdown_complete(const struct sctp_association *,
const sctp_chunk_t *); const sctp_chunk_t *);
void sctp_init_cause(sctp_chunk_t *, __u16 cause, const void *, size_t); void sctp_init_cause(sctp_chunk_t *, __u16 cause, const void *, size_t);
sctp_chunk_t *sctp_make_abort(const sctp_association_t *, sctp_chunk_t *sctp_make_abort(const struct sctp_association *,
const sctp_chunk_t *, const sctp_chunk_t *,
const size_t hint); const size_t hint);
sctp_chunk_t *sctp_make_abort_no_data(const sctp_association_t *, sctp_chunk_t *sctp_make_abort_no_data(const struct sctp_association *,
const sctp_chunk_t *, const sctp_chunk_t *,
__u32 tsn); __u32 tsn);
sctp_chunk_t *sctp_make_abort_user(const sctp_association_t *, sctp_chunk_t *sctp_make_abort_user(const struct sctp_association *,
const sctp_chunk_t *, const sctp_chunk_t *,
const struct msghdr *); const struct msghdr *);
sctp_chunk_t *sctp_make_heartbeat(const sctp_association_t *, sctp_chunk_t *sctp_make_heartbeat(const struct sctp_association *,
const struct sctp_transport *, const struct sctp_transport *,
const void *payload, const void *payload,
const size_t paylen); const size_t paylen);
sctp_chunk_t *sctp_make_heartbeat_ack(const sctp_association_t *, sctp_chunk_t *sctp_make_heartbeat_ack(const struct sctp_association *,
const sctp_chunk_t *, const sctp_chunk_t *,
const void *payload, const void *payload,
const size_t paylen); const size_t paylen);
sctp_chunk_t *sctp_make_op_error(const sctp_association_t *, sctp_chunk_t *sctp_make_op_error(const struct sctp_association *,
const sctp_chunk_t *chunk, const sctp_chunk_t *chunk,
__u16 cause_code, __u16 cause_code,
const void *payload, const void *payload,
size_t paylen); size_t paylen);
void sctp_chunk_assign_tsn(sctp_chunk_t *); void sctp_chunk_assign_tsn(sctp_chunk_t *);
void sctp_chunk_assign_ssn(sctp_chunk_t *); void sctp_chunk_assign_ssn(sctp_chunk_t *);
int sctp_datachunks_from_user(sctp_association_t *, int sctp_datachunks_from_user(struct sctp_association *,
const struct sctp_sndrcvinfo *, const struct sctp_sndrcvinfo *,
struct msghdr *, int len, struct msghdr *, int len,
struct sk_buff_head *); struct sk_buff_head *);
...@@ -279,34 +279,34 @@ int sctp_datachunks_from_user(sctp_association_t *, ...@@ -279,34 +279,34 @@ int sctp_datachunks_from_user(sctp_association_t *,
int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_state_t state,
sctp_endpoint_t *, struct sctp_endpoint *,
sctp_association_t *asoc, struct sctp_association *asoc,
void *event_arg, void *event_arg,
int priority); int gfp);
int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_state_t state,
sctp_endpoint_t *, struct sctp_endpoint *,
sctp_association_t *asoc, struct sctp_association *asoc,
void *event_arg, void *event_arg,
sctp_disposition_t status, sctp_disposition_t status,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
int priority); int gfp);
/* 2nd level prototypes */ /* 2nd level prototypes */
int int
sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_state_t state,
sctp_endpoint_t *ep, struct sctp_endpoint *ep,
sctp_association_t *asoc, struct sctp_association *asoc,
void *event_arg, void *event_arg,
sctp_disposition_t status, sctp_disposition_t status,
sctp_cmd_seq_t *retval, sctp_cmd_seq_t *retval,
int priority); int gfp);
int sctp_gen_sack(sctp_association_t *, int force, sctp_cmd_seq_t *); int sctp_gen_sack(struct sctp_association *, int force, sctp_cmd_seq_t *);
void sctp_do_TSNdup(sctp_association_t *, sctp_chunk_t *, long gap); void sctp_do_TSNdup(struct sctp_association *, sctp_chunk_t *, long gap);
void sctp_generate_t3_rtx_event(unsigned long peer); void sctp_generate_t3_rtx_event(unsigned long peer);
void sctp_generate_heartbeat_event(unsigned long peer); void sctp_generate_heartbeat_event(unsigned long peer);
...@@ -325,21 +325,21 @@ sctp_cookie_param_t * ...@@ -325,21 +325,21 @@ sctp_cookie_param_t *
sctp_pack_cookie(const struct sctp_endpoint *, const struct sctp_association *, sctp_pack_cookie(const struct sctp_endpoint *, const struct sctp_association *,
const struct sctp_chunk *, int *cookie_len, const struct sctp_chunk *, int *cookie_len,
const __u8 *, int addrs_len); const __u8 *, int addrs_len);
sctp_association_t *sctp_unpack_cookie(const sctp_endpoint_t *, struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *,
const sctp_association_t *, const struct sctp_association *,
sctp_chunk_t *, int priority, int *err, sctp_chunk_t *, int gfp, int *err,
sctp_chunk_t **err_chk_p); sctp_chunk_t **err_chk_p);
int sctp_addip_addr_config(sctp_association_t *, sctp_param_t, int sctp_addip_addr_config(struct sctp_association *, sctp_param_t,
struct sockaddr_storage*, int); struct sockaddr_storage*, int);
void sctp_send_stale_cookie_err(const sctp_endpoint_t *ep, void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_chunk_t *err_chunk); sctp_chunk_t *err_chunk);
/* 3rd level prototypes */ /* 3rd level prototypes */
__u32 sctp_generate_tag(const sctp_endpoint_t *); __u32 sctp_generate_tag(const struct sctp_endpoint *);
__u32 sctp_generate_tsn(const sctp_endpoint_t *); __u32 sctp_generate_tsn(const struct sctp_endpoint *);
/* 4th level prototypes */ /* 4th level prototypes */
void sctp_param2sockaddr(union sctp_addr *addr, sctp_addr_param_t *, void sctp_param2sockaddr(union sctp_addr *addr, sctp_addr_param_t *,
...@@ -450,7 +450,7 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a ...@@ -450,7 +450,7 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a
*/ */
static inline int static inline int
sctp_vtag_verify_either(const sctp_chunk_t *chunk, sctp_vtag_verify_either(const sctp_chunk_t *chunk,
const sctp_association_t *asoc) const struct sctp_association *asoc)
{ {
/* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2
* *
......
...@@ -83,14 +83,11 @@ struct sctp_outq; ...@@ -83,14 +83,11 @@ struct sctp_outq;
struct sctp_bind_addr; struct sctp_bind_addr;
struct sctp_ulpq; struct sctp_ulpq;
struct sctp_opt; struct sctp_opt;
struct sctp_endpoint_common; struct sctp_ep_common;
struct sctp_ssnmap; struct sctp_ssnmap;
typedef struct sctp_endpoint sctp_endpoint_t;
typedef struct sctp_association sctp_association_t;
typedef struct sctp_chunk sctp_chunk_t; typedef struct sctp_chunk sctp_chunk_t;
typedef struct sctp_bind_addr sctp_bind_addr_t; typedef struct sctp_bind_addr sctp_bind_addr_t;
typedef struct sctp_endpoint_common sctp_endpoint_common_t;
#include <net/sctp/tsnmap.h> #include <net/sctp/tsnmap.h>
#include <net/sctp/ulpevent.h> #include <net/sctp/ulpevent.h>
...@@ -114,7 +111,7 @@ typedef struct sctp_bind_hashbucket { ...@@ -114,7 +111,7 @@ typedef struct sctp_bind_hashbucket {
/* Used for hashing all associations. */ /* Used for hashing all associations. */
typedef struct sctp_hashbucket { typedef struct sctp_hashbucket {
rwlock_t lock; rwlock_t lock;
sctp_endpoint_common_t *chain; struct sctp_ep_common *chain;
} sctp_hashbucket_t __attribute__((__aligned__(8))); } sctp_hashbucket_t __attribute__((__aligned__(8)));
...@@ -517,7 +514,7 @@ struct sctp_chunk { ...@@ -517,7 +514,7 @@ struct sctp_chunk {
struct sctp_association *asoc; struct sctp_association *asoc;
/* What endpoint received this chunk? */ /* What endpoint received this chunk? */
sctp_endpoint_common_t *rcvr; struct sctp_ep_common *rcvr;
/* We fill this in if we are calculating RTT. */ /* We fill this in if we are calculating RTT. */
unsigned long sent_at; unsigned long sent_at;
...@@ -976,7 +973,7 @@ int sctp_is_any(const union sctp_addr *addr); ...@@ -976,7 +973,7 @@ int sctp_is_any(const union sctp_addr *addr);
int sctp_addr_is_valid(const union sctp_addr *addr); int sctp_addr_is_valid(const union sctp_addr *addr);
/* What type of sctp_endpoint_common? */ /* What type of endpoint? */
typedef enum { typedef enum {
SCTP_EP_TYPE_SOCKET, SCTP_EP_TYPE_SOCKET,
SCTP_EP_TYPE_ASSOCIATION, SCTP_EP_TYPE_ASSOCIATION,
...@@ -998,10 +995,10 @@ typedef enum { ...@@ -998,10 +995,10 @@ typedef enum {
* *
*/ */
struct sctp_endpoint_common { struct sctp_ep_common {
/* Fields to help us manage our entries in the hash tables. */ /* Fields to help us manage our entries in the hash tables. */
sctp_endpoint_common_t *next; struct sctp_ep_common *next;
sctp_endpoint_common_t **pprev; struct sctp_ep_common **pprev;
int hashent; int hashent;
/* Runtime type information. What kind of endpoint is this? */ /* Runtime type information. What kind of endpoint is this? */
...@@ -1055,7 +1052,7 @@ struct sctp_endpoint_common { ...@@ -1055,7 +1052,7 @@ struct sctp_endpoint_common {
struct sctp_endpoint { struct sctp_endpoint {
/* Common substructure for endpoint and association. */ /* Common substructure for endpoint and association. */
sctp_endpoint_common_t base; struct sctp_ep_common base;
/* Associations: A list of current associations and mappings /* Associations: A list of current associations and mappings
* to the data consumers for each association. This * to the data consumers for each association. This
...@@ -1090,7 +1087,7 @@ struct sctp_endpoint { ...@@ -1090,7 +1087,7 @@ struct sctp_endpoint {
}; };
/* Recover the outter endpoint structure. */ /* Recover the outter endpoint structure. */
static inline struct sctp_endpoint *sctp_ep(sctp_endpoint_common_t *base) static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base)
{ {
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
...@@ -1110,7 +1107,7 @@ struct sctp_association *sctp_endpoint_lookup_assoc( ...@@ -1110,7 +1107,7 @@ struct sctp_association *sctp_endpoint_lookup_assoc(
const struct sctp_endpoint *ep, const struct sctp_endpoint *ep,
const union sctp_addr *paddr, const union sctp_addr *paddr,
struct sctp_transport **); struct sctp_transport **);
int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, int sctp_endpoint_is_peeled_off(struct sctp_endpoint *,
const union sctp_addr *); const union sctp_addr *);
struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *,
const union sctp_addr *); const union sctp_addr *);
...@@ -1149,7 +1146,7 @@ struct sctp_association { ...@@ -1149,7 +1146,7 @@ struct sctp_association {
* In this context, it represents the associations's view * In this context, it represents the associations's view
* of the local endpoint of the association. * of the local endpoint of the association.
*/ */
sctp_endpoint_common_t base; struct sctp_ep_common base;
/* Associations on the same socket. */ /* Associations on the same socket. */
struct list_head asocs; struct list_head asocs;
...@@ -1558,7 +1555,7 @@ enum { ...@@ -1558,7 +1555,7 @@ enum {
}; };
/* Recover the outter association structure. */ /* Recover the outter association structure. */
static inline struct sctp_association *sctp_assoc(sctp_endpoint_common_t *base) static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base)
{ {
struct sctp_association *asoc; struct sctp_association *asoc;
......
...@@ -114,7 +114,7 @@ struct sctp_tsnmap_iter { ...@@ -114,7 +114,7 @@ struct sctp_tsnmap_iter {
}; };
/* Create a new tsnmap. */ /* Create a new tsnmap. */
struct sctp_tsnmap *sctp_tsnmap_new(__u16 len, __u32 init_tsn, int priority); struct sctp_tsnmap *sctp_tsnmap_new(__u16 len, __u32 init_tsn, int gfp);
/* Dispose of a tsnmap. */ /* Dispose of a tsnmap. */
void sctp_tsnmap_free(struct sctp_tsnmap *); void sctp_tsnmap_free(struct sctp_tsnmap *);
......
...@@ -64,7 +64,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb) ...@@ -64,7 +64,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb)
return (struct sctp_ulpevent *)skb->cb; return (struct sctp_ulpevent *)skb->cb;
} }
struct sctp_ulpevent *sctp_ulpevent_new(int size, int flags, int priority); struct sctp_ulpevent *sctp_ulpevent_new(int size, int flags, int gfp);
struct sctp_ulpevent *sctp_ulpevent_init(struct sctp_ulpevent *, int flags); struct sctp_ulpevent *sctp_ulpevent_init(struct sctp_ulpevent *, int flags);
void sctp_ulpevent_free(struct sctp_ulpevent *); void sctp_ulpevent_free(struct sctp_ulpevent *);
int sctp_ulpevent_is_notification(const struct sctp_ulpevent *); int sctp_ulpevent_is_notification(const struct sctp_ulpevent *);
...@@ -76,7 +76,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( ...@@ -76,7 +76,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
__u16 error, __u16 error,
__u16 outbound, __u16 outbound,
__u16 inbound, __u16 inbound,
int priority); int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
const struct sctp_association *asoc, const struct sctp_association *asoc,
...@@ -84,32 +84,32 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( ...@@ -84,32 +84,32 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
int flags, int flags,
int state, int state,
int error, int error,
int priority); int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_remote_error( struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
const struct sctp_association *asoc, const struct sctp_association *asoc,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
__u16 flags, __u16 flags,
int priority); int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_send_failed( struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
const struct sctp_association *asoc, const struct sctp_association *asoc,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
__u16 flags, __u16 flags,
__u32 error, __u32 error,
int priority); int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
const struct sctp_association *asoc, const struct sctp_association *asoc,
__u16 flags, __u16 flags,
int priority); int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_pdapi( struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
const struct sctp_association *asoc, const struct sctp_association *asoc,
__u32 indication, int priority); __u32 indication, int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
int priority); int gfp);
void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
struct msghdr *); struct msghdr *);
......
...@@ -50,14 +50,15 @@ ...@@ -50,14 +50,15 @@
struct sctp_ulpq { struct sctp_ulpq {
char malloced; char malloced;
char pd_mode; char pd_mode;
sctp_association_t *asoc; struct sctp_association *asoc;
struct sk_buff_head reasm; struct sk_buff_head reasm;
struct sk_buff_head lobby; struct sk_buff_head lobby;
}; };
/* Prototypes. */ /* Prototypes. */
struct sctp_ulpq *sctp_ulpq_new(sctp_association_t *asoc, int priority); struct sctp_ulpq *sctp_ulpq_new(struct sctp_association *asoc, int gfp);
struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, sctp_association_t *); struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
struct sctp_association *);
void sctp_ulpq_free(struct sctp_ulpq *); void sctp_ulpq_free(struct sctp_ulpq *);
/* Add a new DATA chunk for processing. */ /* Add a new DATA chunk for processing. */
......
...@@ -58,23 +58,23 @@ ...@@ -58,23 +58,23 @@
#include <net/sctp/sctp.h> #include <net/sctp/sctp.h>
/* Forward declarations for internal functions. */ /* Forward declarations for internal functions. */
static void sctp_assoc_bh_rcv(sctp_association_t *asoc); static void sctp_assoc_bh_rcv(struct sctp_association *asoc);
/* 1st Level Abstractions. */ /* 1st Level Abstractions. */
/* Allocate and initialize a new association */ /* Allocate and initialize a new association */
sctp_association_t *sctp_association_new(const sctp_endpoint_t *ep, struct sctp_association *sctp_association_new(const struct sctp_endpoint *ep,
const struct sock *sk, const struct sock *sk,
sctp_scope_t scope, int priority) sctp_scope_t scope, int gfp)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
asoc = t_new(sctp_association_t, priority); asoc = t_new(struct sctp_association, gfp);
if (!asoc) if (!asoc)
goto fail; goto fail;
if (!sctp_association_init(asoc, ep, sk, scope, priority)) if (!sctp_association_init(asoc, ep, sk, scope, gfp))
goto fail_init; goto fail_init;
asoc->base.malloced = 1; asoc->base.malloced = 1;
...@@ -89,11 +89,11 @@ sctp_association_t *sctp_association_new(const sctp_endpoint_t *ep, ...@@ -89,11 +89,11 @@ sctp_association_t *sctp_association_new(const sctp_endpoint_t *ep,
} }
/* Intialize a new association from provided memory. */ /* Intialize a new association from provided memory. */
sctp_association_t *sctp_association_init(sctp_association_t *asoc, struct sctp_association *sctp_association_init(struct sctp_association *asoc,
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const struct sock *sk, const struct sock *sk,
sctp_scope_t scope, sctp_scope_t scope,
int priority) int gfp)
{ {
struct sctp_opt *sp; struct sctp_opt *sp;
struct sctp_protocol *proto = sctp_get_protocol(); struct sctp_protocol *proto = sctp_get_protocol();
...@@ -103,10 +103,10 @@ sctp_association_t *sctp_association_init(sctp_association_t *asoc, ...@@ -103,10 +103,10 @@ sctp_association_t *sctp_association_init(sctp_association_t *asoc,
sp = sctp_sk((struct sock *)sk); sp = sctp_sk((struct sock *)sk);
/* Init all variables to a known value. */ /* Init all variables to a known value. */
memset(asoc, 0, sizeof(sctp_association_t)); memset(asoc, 0, sizeof(struct sctp_association));
/* Discarding const is appropriate here. */ /* Discarding const is appropriate here. */
asoc->ep = (sctp_endpoint_t *)ep; asoc->ep = (struct sctp_endpoint *)ep;
sctp_endpoint_hold(asoc->ep); sctp_endpoint_hold(asoc->ep);
/* Hold the sock. */ /* Hold the sock. */
...@@ -289,7 +289,7 @@ sctp_association_t *sctp_association_init(sctp_association_t *asoc, ...@@ -289,7 +289,7 @@ sctp_association_t *sctp_association_init(sctp_association_t *asoc,
/* Free this association if possible. There may still be users, so /* Free this association if possible. There may still be users, so
* the actual deallocation may be delayed. * the actual deallocation may be delayed.
*/ */
void sctp_association_free(sctp_association_t *asoc) void sctp_association_free(struct sctp_association *asoc)
{ {
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
struct sctp_transport *transport; struct sctp_transport *transport;
...@@ -352,7 +352,7 @@ void sctp_association_free(sctp_association_t *asoc) ...@@ -352,7 +352,7 @@ void sctp_association_free(sctp_association_t *asoc)
} }
/* Cleanup and free up an association. */ /* Cleanup and free up an association. */
static void sctp_association_destroy(sctp_association_t *asoc) static void sctp_association_destroy(struct sctp_association *asoc)
{ {
SCTP_ASSERT(asoc->base.dead, "Assoc is not dead", return); SCTP_ASSERT(asoc->base.dead, "Assoc is not dead", return);
...@@ -385,7 +385,7 @@ void sctp_assoc_set_primary(struct sctp_association *asoc, ...@@ -385,7 +385,7 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
/* Add a transport address to an association. */ /* Add a transport address to an association. */
struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
const union sctp_addr *addr, const union sctp_addr *addr,
int priority) int gfp)
{ {
struct sctp_transport *peer; struct sctp_transport *peer;
struct sctp_opt *sp; struct sctp_opt *sp;
...@@ -404,7 +404,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, ...@@ -404,7 +404,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
if (peer) if (peer)
return peer; return peer;
peer = sctp_transport_new(addr, priority); peer = sctp_transport_new(addr, gfp);
if (!peer) if (!peer)
return NULL; return NULL;
...@@ -490,8 +490,9 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, ...@@ -490,8 +490,9 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
} }
/* Lookup a transport by address. */ /* Lookup a transport by address. */
struct sctp_transport *sctp_assoc_lookup_paddr(const sctp_association_t *asoc, struct sctp_transport *sctp_assoc_lookup_paddr(
const union sctp_addr *address) const struct sctp_association *asoc,
const union sctp_addr *address)
{ {
struct sctp_transport *t; struct sctp_transport *t;
struct list_head *pos; struct list_head *pos;
...@@ -511,7 +512,7 @@ struct sctp_transport *sctp_assoc_lookup_paddr(const sctp_association_t *asoc, ...@@ -511,7 +512,7 @@ struct sctp_transport *sctp_assoc_lookup_paddr(const sctp_association_t *asoc,
* Mark the transport up or down and send a notification to the user. * Mark the transport up or down and send a notification to the user.
* Select and update the new active and retran paths. * Select and update the new active and retran paths.
*/ */
void sctp_assoc_control_transport(sctp_association_t *asoc, void sctp_assoc_control_transport(struct sctp_association *asoc,
struct sctp_transport *transport, struct sctp_transport *transport,
sctp_transport_cmd_t command, sctp_transport_cmd_t command,
sctp_sn_error_t error) sctp_sn_error_t error)
...@@ -601,7 +602,7 @@ void sctp_assoc_control_transport(sctp_association_t *asoc, ...@@ -601,7 +602,7 @@ void sctp_assoc_control_transport(sctp_association_t *asoc,
} }
/* Hold a reference to an association. */ /* Hold a reference to an association. */
void sctp_association_hold(sctp_association_t *asoc) void sctp_association_hold(struct sctp_association *asoc)
{ {
atomic_inc(&asoc->base.refcnt); atomic_inc(&asoc->base.refcnt);
} }
...@@ -609,7 +610,7 @@ void sctp_association_hold(sctp_association_t *asoc) ...@@ -609,7 +610,7 @@ void sctp_association_hold(sctp_association_t *asoc)
/* Release a reference to an association and cleanup /* Release a reference to an association and cleanup
* if there are no more references. * if there are no more references.
*/ */
void sctp_association_put(sctp_association_t *asoc) void sctp_association_put(struct sctp_association *asoc)
{ {
if (atomic_dec_and_test(&asoc->base.refcnt)) if (atomic_dec_and_test(&asoc->base.refcnt))
sctp_association_destroy(asoc); sctp_association_destroy(asoc);
...@@ -618,7 +619,7 @@ void sctp_association_put(sctp_association_t *asoc) ...@@ -618,7 +619,7 @@ void sctp_association_put(sctp_association_t *asoc)
/* Allocate the next TSN, Transmission Sequence Number, for the given /* Allocate the next TSN, Transmission Sequence Number, for the given
* association. * association.
*/ */
__u32 sctp_association_get_next_tsn(sctp_association_t *asoc) __u32 sctp_association_get_next_tsn(struct sctp_association *asoc)
{ {
/* From Section 1.6 Serial Number Arithmetic: /* From Section 1.6 Serial Number Arithmetic:
* Transmission Sequence Numbers wrap around when they reach * Transmission Sequence Numbers wrap around when they reach
...@@ -633,7 +634,7 @@ __u32 sctp_association_get_next_tsn(sctp_association_t *asoc) ...@@ -633,7 +634,7 @@ __u32 sctp_association_get_next_tsn(sctp_association_t *asoc)
} }
/* Allocate 'num' TSNs by incrementing the association's TSN by num. */ /* Allocate 'num' TSNs by incrementing the association's TSN by num. */
__u32 sctp_association_get_tsn_block(sctp_association_t *asoc, int num) __u32 sctp_association_get_tsn_block(struct sctp_association *asoc, int num)
{ {
__u32 retval = asoc->next_tsn; __u32 retval = asoc->next_tsn;
...@@ -681,7 +682,7 @@ sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc) ...@@ -681,7 +682,7 @@ sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc)
/* Use this function for the packet prepend callback when no ECNE /* Use this function for the packet prepend callback when no ECNE
* packet is desired (e.g. some packets don't like to be bundled). * packet is desired (e.g. some packets don't like to be bundled).
*/ */
sctp_chunk_t *sctp_get_no_prepend(sctp_association_t *asoc) sctp_chunk_t *sctp_get_no_prepend(struct sctp_association *asoc)
{ {
return NULL; return NULL;
} }
...@@ -689,7 +690,7 @@ sctp_chunk_t *sctp_get_no_prepend(sctp_association_t *asoc) ...@@ -689,7 +690,7 @@ sctp_chunk_t *sctp_get_no_prepend(sctp_association_t *asoc)
/* /*
* Find which transport this TSN was sent on. * Find which transport this TSN was sent on.
*/ */
struct sctp_transport *sctp_assoc_lookup_tsn(sctp_association_t *asoc, __u32 tsn) struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, __u32 tsn)
{ {
struct sctp_transport *active; struct sctp_transport *active;
struct sctp_transport *match; struct sctp_transport *match;
...@@ -746,7 +747,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(sctp_association_t *asoc, __u32 tsn ...@@ -746,7 +747,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(sctp_association_t *asoc, __u32 tsn
} }
/* Is this the association we are looking for? */ /* Is this the association we are looking for? */
struct sctp_transport *sctp_assoc_is_match(sctp_association_t *asoc, struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,
const union sctp_addr *laddr, const union sctp_addr *laddr,
const union sctp_addr *paddr) const union sctp_addr *paddr)
{ {
...@@ -772,9 +773,9 @@ struct sctp_transport *sctp_assoc_is_match(sctp_association_t *asoc, ...@@ -772,9 +773,9 @@ struct sctp_transport *sctp_assoc_is_match(sctp_association_t *asoc,
} }
/* Do delayed input processing. This is scheduled by sctp_rcv(). */ /* Do delayed input processing. This is scheduled by sctp_rcv(). */
static void sctp_assoc_bh_rcv(sctp_association_t *asoc) static void sctp_assoc_bh_rcv(struct sctp_association *asoc)
{ {
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_chunk_t *chunk; sctp_chunk_t *chunk;
struct sock *sk; struct sock *sk;
struct sctp_inq *inqueue; struct sctp_inq *inqueue;
...@@ -820,7 +821,7 @@ static void sctp_assoc_bh_rcv(sctp_association_t *asoc) ...@@ -820,7 +821,7 @@ static void sctp_assoc_bh_rcv(sctp_association_t *asoc)
} }
/* This routine moves an association from its old sk to a new sk. */ /* This routine moves an association from its old sk to a new sk. */
void sctp_assoc_migrate(sctp_association_t *assoc, struct sock *newsk) void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk)
{ {
struct sctp_opt *newsp = sctp_sk(newsk); struct sctp_opt *newsp = sctp_sk(newsk);
struct sock *oldsk = assoc->base.sk; struct sock *oldsk = assoc->base.sk;
...@@ -851,7 +852,7 @@ void sctp_assoc_migrate(sctp_association_t *assoc, struct sock *newsk) ...@@ -851,7 +852,7 @@ void sctp_assoc_migrate(sctp_association_t *assoc, struct sock *newsk)
} }
/* Update an association (possibly from unexpected COOKIE-ECHO processing). */ /* Update an association (possibly from unexpected COOKIE-ECHO processing). */
void sctp_assoc_update(sctp_association_t *asoc, sctp_association_t *new) void sctp_assoc_update(struct sctp_association *asoc, struct sctp_association *new)
{ {
/* Copy in new parameters of peer. */ /* Copy in new parameters of peer. */
asoc->c = new->c; asoc->c = new->c;
...@@ -899,7 +900,7 @@ void sctp_assoc_update(sctp_association_t *asoc, sctp_association_t *new) ...@@ -899,7 +900,7 @@ void sctp_assoc_update(sctp_association_t *asoc, sctp_association_t *new)
* through the inactive transports as this is the next best thing * through the inactive transports as this is the next best thing
* we can try. * we can try.
*/ */
void sctp_assoc_update_retran_path(sctp_association_t *asoc) void sctp_assoc_update_retran_path(struct sctp_association *asoc)
{ {
struct sctp_transport *t, *next; struct sctp_transport *t, *next;
struct list_head *head = &asoc->peer.transport_addr_list; struct list_head *head = &asoc->peer.transport_addr_list;
...@@ -945,7 +946,7 @@ void sctp_assoc_update_retran_path(sctp_association_t *asoc) ...@@ -945,7 +946,7 @@ void sctp_assoc_update_retran_path(sctp_association_t *asoc)
} }
/* Choose the transport for sending a SHUTDOWN packet. */ /* Choose the transport for sending a SHUTDOWN packet. */
struct sctp_transport *sctp_assoc_choose_shutdown_transport(sctp_association_t *asoc) struct sctp_transport *sctp_assoc_choose_shutdown_transport(struct sctp_association *asoc)
{ {
/* If this is the first time SHUTDOWN is sent, use the active path, /* If this is the first time SHUTDOWN is sent, use the active path,
* else use the retran path. If the last SHUTDOWN was sent over the * else use the retran path. If the last SHUTDOWN was sent over the
...@@ -964,7 +965,7 @@ struct sctp_transport *sctp_assoc_choose_shutdown_transport(sctp_association_t * ...@@ -964,7 +965,7 @@ struct sctp_transport *sctp_assoc_choose_shutdown_transport(sctp_association_t *
/* Update the association's pmtu and frag_point by going through all the /* Update the association's pmtu and frag_point by going through all the
* transports. This routine is called when a transport's PMTU has changed. * transports. This routine is called when a transport's PMTU has changed.
*/ */
void sctp_assoc_sync_pmtu(sctp_association_t *asoc) void sctp_assoc_sync_pmtu(struct sctp_association *asoc)
{ {
struct sctp_transport *t; struct sctp_transport *t;
struct list_head *pos; struct list_head *pos;
...@@ -1008,7 +1009,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc) ...@@ -1008,7 +1009,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc)
} }
/* Increase asoc's rwnd by len and send any window update SACK if needed. */ /* Increase asoc's rwnd by len and send any window update SACK if needed. */
void sctp_assoc_rwnd_increase(sctp_association_t *asoc, int len) void sctp_assoc_rwnd_increase(struct sctp_association *asoc, int len)
{ {
sctp_chunk_t *sack; sctp_chunk_t *sack;
struct timer_list *timer; struct timer_list *timer;
...@@ -1054,7 +1055,7 @@ void sctp_assoc_rwnd_increase(sctp_association_t *asoc, int len) ...@@ -1054,7 +1055,7 @@ void sctp_assoc_rwnd_increase(sctp_association_t *asoc, int len)
} }
/* Decrease asoc's rwnd by len. */ /* Decrease asoc's rwnd by len. */
void sctp_assoc_rwnd_decrease(sctp_association_t *asoc, int len) void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, int len)
{ {
SCTP_ASSERT(asoc->rwnd, "rwnd zero", return); SCTP_ASSERT(asoc->rwnd, "rwnd zero", return);
SCTP_ASSERT(!asoc->rwnd_over, "rwnd_over not zero", return); SCTP_ASSERT(!asoc->rwnd_over, "rwnd_over not zero", return);
...@@ -1093,7 +1094,7 @@ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, int gfp) ...@@ -1093,7 +1094,7 @@ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, int gfp)
} }
/* Build the association's bind address list from the cookie. */ /* Build the association's bind address list from the cookie. */
int sctp_assoc_set_bind_addr_from_cookie(sctp_association_t *asoc, int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *asoc,
sctp_cookie_t *cookie, int gfp) sctp_cookie_t *cookie, int gfp)
{ {
int var_size2 = ntohs(cookie->peer_init->chunk_hdr.length); int var_size2 = ntohs(cookie->peer_init->chunk_hdr.length);
......
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
#include <net/sctp/sm.h> #include <net/sctp/sm.h>
/* Create a new sctp_command_sequence. */ /* Create a new sctp_command_sequence. */
sctp_cmd_seq_t *sctp_new_cmd_seq(int priority) sctp_cmd_seq_t *sctp_new_cmd_seq(int gfp)
{ {
sctp_cmd_seq_t *retval = t_new(sctp_cmd_seq_t, priority); sctp_cmd_seq_t *retval = t_new(sctp_cmd_seq_t, gfp);
if (retval) if (retval)
sctp_init_cmd_seq(retval); sctp_init_cmd_seq(retval);
......
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
/* Forward declarations for internal helpers. */ /* Forward declarations for internal helpers. */
static int sctp_rcv_ootb(struct sk_buff *); static int sctp_rcv_ootb(struct sk_buff *);
sctp_association_t *__sctp_rcv_lookup(struct sk_buff *skb, struct sctp_association *__sctp_rcv_lookup(struct sk_buff *skb,
const union sctp_addr *laddr, const union sctp_addr *laddr,
const union sctp_addr *paddr, const union sctp_addr *paddr,
struct sctp_transport **transportp); struct sctp_transport **transportp);
sctp_endpoint_t *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr); struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr);
/* Calculate the SCTP checksum of an SCTP packet. */ /* Calculate the SCTP checksum of an SCTP packet. */
...@@ -102,9 +102,9 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb) ...@@ -102,9 +102,9 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb)
int sctp_rcv(struct sk_buff *skb) int sctp_rcv(struct sk_buff *skb)
{ {
struct sock *sk; struct sock *sk;
sctp_association_t *asoc; struct sctp_association *asoc;
sctp_endpoint_t *ep = NULL; struct sctp_endpoint *ep = NULL;
sctp_endpoint_common_t *rcvr; struct sctp_ep_common *rcvr;
struct sctp_transport *transport = NULL; struct sctp_transport *transport = NULL;
sctp_chunk_t *chunk; sctp_chunk_t *chunk;
struct sctphdr *sh; struct sctphdr *sh;
...@@ -128,11 +128,11 @@ int sctp_rcv(struct sk_buff *skb) ...@@ -128,11 +128,11 @@ int sctp_rcv(struct sk_buff *skb)
if (sctp_rcv_checksum(skb) < 0) if (sctp_rcv_checksum(skb) < 0)
goto bad_packet; goto bad_packet;
skb_pull(skb, sizeof(struct sctphdr)); skb_pull(skb, sizeof(struct sctphdr));
family = ipver2af(skb->nh.iph->version); family = ipver2af(skb->nh.iph->version);
af = sctp_get_af_specific(family); af = sctp_get_af_specific(family);
if (unlikely(!af)) if (unlikely(!af))
goto bad_packet; goto bad_packet;
/* Initialize local addresses for lookups. */ /* Initialize local addresses for lookups. */
...@@ -286,8 +286,8 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, ...@@ -286,8 +286,8 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
/* Common lookup code for icmp/icmpv6 error handler. */ /* Common lookup code for icmp/icmpv6 error handler. */
struct sock *sctp_err_lookup(int family, struct sk_buff *skb, struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
struct sctphdr *sctphdr, struct sctphdr *sctphdr,
struct sctp_endpoint **epp, struct sctp_endpoint **epp,
struct sctp_association **app, struct sctp_association **app,
struct sctp_transport **tpp) struct sctp_transport **tpp)
{ {
union sctp_addr saddr; union sctp_addr saddr;
...@@ -309,15 +309,15 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, ...@@ -309,15 +309,15 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
af->from_skb(&saddr, skb, 1); af->from_skb(&saddr, skb, 1);
af->from_skb(&daddr, skb, 0); af->from_skb(&daddr, skb, 0);
/* Look for an association that matches the incoming ICMP error /* Look for an association that matches the incoming ICMP error
* packet. * packet.
*/ */
asoc = __sctp_lookup_association(&saddr, &daddr, &transport); asoc = __sctp_lookup_association(&saddr, &daddr, &transport);
if (!asoc) { if (!asoc) {
/* If there is no matching association, see if it matches any /* If there is no matching association, see if it matches any
* endpoint. This may happen for an ICMP error generated in * endpoint. This may happen for an ICMP error generated in
* response to an INIT_ACK. * response to an INIT_ACK.
*/ */
ep = __sctp_rcv_lookup_endpoint(&daddr); ep = __sctp_rcv_lookup_endpoint(&daddr);
if (!ep) { if (!ep) {
return NULL; return NULL;
...@@ -345,25 +345,25 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, ...@@ -345,25 +345,25 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
*app = asoc; *app = asoc;
*tpp = transport; *tpp = transport;
return sk; return sk;
out: out:
sock_put(sk); sock_put(sk);
if (asoc) if (asoc)
sctp_association_put(asoc); sctp_association_put(asoc);
if (ep) if (ep)
sctp_endpoint_put(ep); sctp_endpoint_put(ep);
return NULL; return NULL;
} }
/* Common cleanup code for icmp/icmpv6 error handler. */ /* Common cleanup code for icmp/icmpv6 error handler. */
void sctp_err_finish(struct sock *sk, struct sctp_endpoint *ep, void sctp_err_finish(struct sock *sk, struct sctp_endpoint *ep,
struct sctp_association *asoc) struct sctp_association *asoc)
{ {
sctp_bh_unlock_sock(sk); sctp_bh_unlock_sock(sk);
sock_put(sk); sock_put(sk);
if (asoc) if (asoc)
sctp_association_put(asoc); sctp_association_put(asoc);
if (ep) if (ep)
sctp_endpoint_put(ep); sctp_endpoint_put(ep);
} }
...@@ -389,8 +389,8 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) ...@@ -389,8 +389,8 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
int type = skb->h.icmph->type; int type = skb->h.icmph->type;
int code = skb->h.icmph->code; int code = skb->h.icmph->code;
struct sock *sk; struct sock *sk;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
struct inet_opt *inet; struct inet_opt *inet;
char *saveip, *savesctp; char *saveip, *savesctp;
...@@ -414,7 +414,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) ...@@ -414,7 +414,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
ICMP_INC_STATS_BH(IcmpInErrors); ICMP_INC_STATS_BH(IcmpInErrors);
return; return;
} }
/* Warning: The sock lock is held. Remember to call /* Warning: The sock lock is held. Remember to call
* sctp_err_finish! * sctp_err_finish!
*/ */
...@@ -520,10 +520,10 @@ int sctp_rcv_ootb(struct sk_buff *skb) ...@@ -520,10 +520,10 @@ int sctp_rcv_ootb(struct sk_buff *skb)
} }
/* Insert endpoint into the hash table. */ /* Insert endpoint into the hash table. */
void __sctp_hash_endpoint(sctp_endpoint_t *ep) void __sctp_hash_endpoint(struct sctp_endpoint *ep)
{ {
sctp_endpoint_common_t **epp; struct sctp_ep_common **epp;
sctp_endpoint_common_t *epb; struct sctp_ep_common *epb;
sctp_hashbucket_t *head; sctp_hashbucket_t *head;
epb = &ep->base; epb = &ep->base;
...@@ -542,7 +542,7 @@ void __sctp_hash_endpoint(sctp_endpoint_t *ep) ...@@ -542,7 +542,7 @@ void __sctp_hash_endpoint(sctp_endpoint_t *ep)
} }
/* Add an endpoint to the hash. Local BH-safe. */ /* Add an endpoint to the hash. Local BH-safe. */
void sctp_hash_endpoint(sctp_endpoint_t *ep) void sctp_hash_endpoint(struct sctp_endpoint *ep)
{ {
sctp_local_bh_disable(); sctp_local_bh_disable();
__sctp_hash_endpoint(ep); __sctp_hash_endpoint(ep);
...@@ -550,10 +550,10 @@ void sctp_hash_endpoint(sctp_endpoint_t *ep) ...@@ -550,10 +550,10 @@ void sctp_hash_endpoint(sctp_endpoint_t *ep)
} }
/* Remove endpoint from the hash table. */ /* Remove endpoint from the hash table. */
void __sctp_unhash_endpoint(sctp_endpoint_t *ep) void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
{ {
sctp_hashbucket_t *head; sctp_hashbucket_t *head;
sctp_endpoint_common_t *epb; struct sctp_ep_common *epb;
epb = &ep->base; epb = &ep->base;
...@@ -574,7 +574,7 @@ void __sctp_unhash_endpoint(sctp_endpoint_t *ep) ...@@ -574,7 +574,7 @@ void __sctp_unhash_endpoint(sctp_endpoint_t *ep)
} }
/* Remove endpoint from the hash. Local BH-safe. */ /* Remove endpoint from the hash. Local BH-safe. */
void sctp_unhash_endpoint(sctp_endpoint_t *ep) void sctp_unhash_endpoint(struct sctp_endpoint *ep)
{ {
sctp_local_bh_disable(); sctp_local_bh_disable();
__sctp_unhash_endpoint(ep); __sctp_unhash_endpoint(ep);
...@@ -582,11 +582,11 @@ void sctp_unhash_endpoint(sctp_endpoint_t *ep) ...@@ -582,11 +582,11 @@ void sctp_unhash_endpoint(sctp_endpoint_t *ep)
} }
/* Look up an endpoint. */ /* Look up an endpoint. */
sctp_endpoint_t *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr) struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr)
{ {
sctp_hashbucket_t *head; sctp_hashbucket_t *head;
sctp_endpoint_common_t *epb; struct sctp_ep_common *epb;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
int hash; int hash;
hash = sctp_ep_hashfn(laddr->v4.sin_port); hash = sctp_ep_hashfn(laddr->v4.sin_port);
...@@ -609,7 +609,7 @@ sctp_endpoint_t *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr) ...@@ -609,7 +609,7 @@ sctp_endpoint_t *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr)
} }
/* Add an association to the hash. Local BH-safe. */ /* Add an association to the hash. Local BH-safe. */
void sctp_hash_established(sctp_association_t *asoc) void sctp_hash_established(struct sctp_association *asoc)
{ {
sctp_local_bh_disable(); sctp_local_bh_disable();
__sctp_hash_established(asoc); __sctp_hash_established(asoc);
...@@ -617,10 +617,10 @@ void sctp_hash_established(sctp_association_t *asoc) ...@@ -617,10 +617,10 @@ void sctp_hash_established(sctp_association_t *asoc)
} }
/* Insert association into the hash table. */ /* Insert association into the hash table. */
void __sctp_hash_established(sctp_association_t *asoc) void __sctp_hash_established(struct sctp_association *asoc)
{ {
sctp_endpoint_common_t **epp; struct sctp_ep_common **epp;
sctp_endpoint_common_t *epb; struct sctp_ep_common *epb;
sctp_hashbucket_t *head; sctp_hashbucket_t *head;
epb = &asoc->base; epb = &asoc->base;
...@@ -641,7 +641,7 @@ void __sctp_hash_established(sctp_association_t *asoc) ...@@ -641,7 +641,7 @@ void __sctp_hash_established(sctp_association_t *asoc)
} }
/* Remove association from the hash table. Local BH-safe. */ /* Remove association from the hash table. Local BH-safe. */
void sctp_unhash_established(sctp_association_t *asoc) void sctp_unhash_established(struct sctp_association *asoc)
{ {
sctp_local_bh_disable(); sctp_local_bh_disable();
__sctp_unhash_established(asoc); __sctp_unhash_established(asoc);
...@@ -649,10 +649,10 @@ void sctp_unhash_established(sctp_association_t *asoc) ...@@ -649,10 +649,10 @@ void sctp_unhash_established(sctp_association_t *asoc)
} }
/* Remove association from the hash table. */ /* Remove association from the hash table. */
void __sctp_unhash_established(sctp_association_t *asoc) void __sctp_unhash_established(struct sctp_association *asoc)
{ {
sctp_hashbucket_t *head; sctp_hashbucket_t *head;
sctp_endpoint_common_t *epb; struct sctp_ep_common *epb;
epb = &asoc->base; epb = &asoc->base;
...@@ -674,13 +674,14 @@ void __sctp_unhash_established(sctp_association_t *asoc) ...@@ -674,13 +674,14 @@ void __sctp_unhash_established(sctp_association_t *asoc)
} }
/* Look up an association. */ /* Look up an association. */
sctp_association_t *__sctp_lookup_association(const union sctp_addr *local, struct sctp_association *__sctp_lookup_association(
const union sctp_addr *peer, const union sctp_addr *local,
struct sctp_transport **pt) const union sctp_addr *peer,
struct sctp_transport **pt)
{ {
sctp_hashbucket_t *head; sctp_hashbucket_t *head;
sctp_endpoint_common_t *epb; struct sctp_ep_common *epb;
sctp_association_t *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
int hash; int hash;
...@@ -710,11 +711,11 @@ sctp_association_t *__sctp_lookup_association(const union sctp_addr *local, ...@@ -710,11 +711,11 @@ sctp_association_t *__sctp_lookup_association(const union sctp_addr *local,
} }
/* Look up an association. BH-safe. */ /* Look up an association. BH-safe. */
sctp_association_t *sctp_lookup_association(const union sctp_addr *laddr, struct sctp_association *sctp_lookup_association(const union sctp_addr *laddr,
const union sctp_addr *paddr, const union sctp_addr *paddr,
struct sctp_transport **transportp) struct sctp_transport **transportp)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
sctp_local_bh_disable(); sctp_local_bh_disable();
asoc = __sctp_lookup_association(laddr, paddr, transportp); asoc = __sctp_lookup_association(laddr, paddr, transportp);
...@@ -727,7 +728,7 @@ sctp_association_t *sctp_lookup_association(const union sctp_addr *laddr, ...@@ -727,7 +728,7 @@ sctp_association_t *sctp_lookup_association(const union sctp_addr *laddr,
int sctp_has_association(const union sctp_addr *laddr, int sctp_has_association(const union sctp_addr *laddr,
const union sctp_addr *paddr) const union sctp_addr *paddr)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) { if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) {
...@@ -757,10 +758,10 @@ int sctp_has_association(const union sctp_addr *laddr, ...@@ -757,10 +758,10 @@ int sctp_has_association(const union sctp_addr *laddr,
* in certain circumstances. * in certain circumstances.
* *
*/ */
static sctp_association_t *__sctp_rcv_init_lookup(struct sk_buff *skb, static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb,
const union sctp_addr *laddr, struct sctp_transport **transportp) const union sctp_addr *laddr, struct sctp_transport **transportp)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
union sctp_addr addr; union sctp_addr addr;
union sctp_addr *paddr = &addr; union sctp_addr *paddr = &addr;
struct sctphdr *sh = (struct sctphdr *) skb->h.raw; struct sctphdr *sh = (struct sctphdr *) skb->h.raw;
...@@ -815,12 +816,12 @@ static sctp_association_t *__sctp_rcv_init_lookup(struct sk_buff *skb, ...@@ -815,12 +816,12 @@ static sctp_association_t *__sctp_rcv_init_lookup(struct sk_buff *skb,
} }
/* Lookup an association for an inbound skb. */ /* Lookup an association for an inbound skb. */
sctp_association_t *__sctp_rcv_lookup(struct sk_buff *skb, struct sctp_association *__sctp_rcv_lookup(struct sk_buff *skb,
const union sctp_addr *paddr, const union sctp_addr *paddr,
const union sctp_addr *laddr, const union sctp_addr *laddr,
struct sctp_transport **transportp) struct sctp_transport **transportp)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
asoc = __sctp_lookup_association(laddr, paddr, transportp); asoc = __sctp_lookup_association(laddr, paddr, transportp);
......
...@@ -78,7 +78,7 @@ void sctp_inq_free(struct sctp_inq *queue) ...@@ -78,7 +78,7 @@ void sctp_inq_free(struct sctp_inq *queue)
sctp_chunk_t *chunk; sctp_chunk_t *chunk;
/* Empty the queue. */ /* Empty the queue. */
while ((chunk = (sctp_chunk_t *) skb_dequeue(&queue->in)) != NULL) while ((chunk = (sctp_chunk_t *) skb_dequeue(&queue->in)))
sctp_free_chunk(chunk); sctp_free_chunk(chunk);
/* If there is a packet which is currently being worked on, /* If there is a packet which is currently being worked on,
...@@ -123,7 +123,7 @@ sctp_chunk_t *sctp_inq_pop(struct sctp_inq *queue) ...@@ -123,7 +123,7 @@ sctp_chunk_t *sctp_inq_pop(struct sctp_inq *queue)
* at this time. * at this time.
*/ */
if ((chunk = queue->in_progress) != NULL) { if ((chunk = queue->in_progress)) {
/* There is a packet that we have been working on. /* There is a packet that we have been working on.
* Any post processing work to do before we move on? * Any post processing work to do before we move on?
*/ */
......
...@@ -95,8 +95,8 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -95,8 +95,8 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct ipv6hdr *iph = (struct ipv6hdr *)skb->data; struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
struct sctphdr *sh = (struct sctphdr *)(skb->data + offset); struct sctphdr *sh = (struct sctphdr *)(skb->data + offset);
struct sock *sk; struct sock *sk;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
struct ipv6_pinfo *np; struct ipv6_pinfo *np;
char *saveip, *savesctp; char *saveip, *savesctp;
...@@ -116,7 +116,7 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -116,7 +116,7 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
return; return;
} }
/* Warning: The sock lock is held. Remember to call /* Warning: The sock lock is held. Remember to call
* sctp_err_finish! * sctp_err_finish!
*/ */
...@@ -142,7 +142,7 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -142,7 +142,7 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
} }
/* Based on tcp_v6_xmit() in tcp_ipv6.c. */ /* Based on tcp_v6_xmit() in tcp_ipv6.c. */
static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
int ipfragok) int ipfragok)
{ {
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
...@@ -187,7 +187,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, ...@@ -187,7 +187,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
/* Returns the dst cache entry for the given source and destination ip /* Returns the dst cache entry for the given source and destination ip
* addresses. * addresses.
*/ */
struct dst_entry *sctp_v6_get_dst(sctp_association_t *asoc, struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
union sctp_addr *daddr, union sctp_addr *daddr,
union sctp_addr *saddr) union sctp_addr *saddr)
{ {
...@@ -245,7 +245,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1, ...@@ -245,7 +245,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
/* Fills in the source address(saddr) based on the destination address(daddr) /* Fills in the source address(saddr) based on the destination address(daddr)
* and asoc's bind address list. * and asoc's bind address list.
*/ */
void sctp_v6_get_saddr(sctp_association_t *asoc, struct dst_entry *dst, void sctp_v6_get_saddr(struct sctp_association *asoc, struct dst_entry *dst,
union sctp_addr *daddr, union sctp_addr *saddr) union sctp_addr *daddr, union sctp_addr *saddr)
{ {
sctp_bind_addr_t *bp; sctp_bind_addr_t *bp;
...@@ -385,7 +385,7 @@ static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst, ...@@ -385,7 +385,7 @@ static void sctp_v6_dst_saddr(union sctp_addr *addr, struct dst_entry *dst,
ipv6_addr_copy(&addr->v6.sin6_addr, &rt->rt6i_src.addr); ipv6_addr_copy(&addr->v6.sin6_addr, &rt->rt6i_src.addr);
} }
/* Compare addresses exactly. /* Compare addresses exactly.
* FIXME: v4-mapped-v6. * FIXME: v4-mapped-v6.
*/ */
static int sctp_v6_cmp_addr(const union sctp_addr *addr1, static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
...@@ -562,7 +562,7 @@ static void sctp_inet6_msgname(char *msgname, int *addr_len) ...@@ -562,7 +562,7 @@ static void sctp_inet6_msgname(char *msgname, int *addr_len)
} }
/* Initialize a PF_INET msgname from a ulpevent. */ /* Initialize a PF_INET msgname from a ulpevent. */
static void sctp_inet6_event_msgname(struct sctp_ulpevent *event, static void sctp_inet6_event_msgname(struct sctp_ulpevent *event,
char *msgname, int *addrlen) char *msgname, int *addrlen)
{ {
struct sockaddr_in6 *sin6, *sin6from; struct sockaddr_in6 *sin6, *sin6from;
...@@ -589,7 +589,7 @@ static void sctp_inet6_event_msgname(struct sctp_ulpevent *event, ...@@ -589,7 +589,7 @@ static void sctp_inet6_event_msgname(struct sctp_ulpevent *event,
sin6from = &event->asoc->peer.primary_addr.v6; sin6from = &event->asoc->peer.primary_addr.v6;
ipv6_addr_copy(&sin6->sin6_addr, &sin6from->sin6_addr); ipv6_addr_copy(&sin6->sin6_addr, &sin6from->sin6_addr);
if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
sin6->sin6_scope_id = sin6from->sin6_scope_id; sin6->sin6_scope_id = sin6from->sin6_scope_id;
} }
} }
...@@ -689,7 +689,7 @@ static int sctp_inet6_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -689,7 +689,7 @@ static int sctp_inet6_bind_verify(struct sctp_opt *opt, union sctp_addr *addr)
if (addr->v6.sin6_scope_id) if (addr->v6.sin6_scope_id)
sk->bound_dev_if = addr->v6.sin6_scope_id; sk->bound_dev_if = addr->v6.sin6_scope_id;
if (!sk->bound_dev_if) if (!sk->bound_dev_if)
return 0; return 0;
} }
af = opt->pf->af; af = opt->pf->af;
} }
...@@ -719,11 +719,11 @@ static int sctp_inet6_send_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -719,11 +719,11 @@ static int sctp_inet6_send_verify(struct sctp_opt *opt, union sctp_addr *addr)
if (addr->v6.sin6_scope_id) if (addr->v6.sin6_scope_id)
sk->bound_dev_if = addr->v6.sin6_scope_id; sk->bound_dev_if = addr->v6.sin6_scope_id;
if (!sk->bound_dev_if) if (!sk->bound_dev_if)
return 0; return 0;
} }
af = opt->pf->af; af = opt->pf->af;
} }
return af != NULL; return af != NULL;
} }
......
...@@ -94,13 +94,13 @@ static inline void sctp_outq_insert_data(struct sctp_outq *q, ...@@ -94,13 +94,13 @@ static inline void sctp_outq_insert_data(struct sctp_outq *q,
struct sctp_chunk *ch, struct sctp_chunk *ch,
struct sctp_chunk *pos) struct sctp_chunk *pos)
{ {
__skb_insert((struct sk_buff *)ch, (struct sk_buff *)pos->prev, __skb_insert((struct sk_buff *)ch, (struct sk_buff *)pos->prev,
(struct sk_buff *)pos, pos->list); (struct sk_buff *)pos, pos->list);
q->out_qlen += ch->skb->len; q->out_qlen += ch->skb->len;
} }
/* Generate a new outqueue. */ /* Generate a new outqueue. */
struct sctp_outq *sctp_outq_new(sctp_association_t *asoc) struct sctp_outq *sctp_outq_new(struct sctp_association *asoc)
{ {
struct sctp_outq *q; struct sctp_outq *q;
...@@ -116,7 +116,7 @@ struct sctp_outq *sctp_outq_new(sctp_association_t *asoc) ...@@ -116,7 +116,7 @@ struct sctp_outq *sctp_outq_new(sctp_association_t *asoc)
* You still need to define handlers if you really want to DO * You still need to define handlers if you really want to DO
* something with this structure... * something with this structure...
*/ */
void sctp_outq_init(sctp_association_t *asoc, struct sctp_outq *q) void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
{ {
q->asoc = asoc; q->asoc = asoc;
skb_queue_head_init(&q->out); skb_queue_head_init(&q->out);
...@@ -417,7 +417,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -417,7 +417,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
struct sctp_transport *transport = pkt->transport; struct sctp_transport *transport = pkt->transport;
sctp_xmit_t status; sctp_xmit_t status;
sctp_chunk_t *chunk; sctp_chunk_t *chunk;
sctp_association_t *asoc; struct sctp_association *asoc;
int error = 0; int error = 0;
asoc = q->asoc; asoc = q->asoc;
...@@ -527,7 +527,7 @@ void sctp_xmit_frag(struct sctp_outq *q, struct sctp_chunk *pos, ...@@ -527,7 +527,7 @@ void sctp_xmit_frag(struct sctp_outq *q, struct sctp_chunk *pos,
SCTP_DEBUG_PRINTK("sctp_xmit_frag: q not empty. " SCTP_DEBUG_PRINTK("sctp_xmit_frag: q not empty. "
"adding 0x%x to outqueue\n", "adding 0x%x to outqueue\n",
ntohl(frag->subh.data_hdr->tsn)); ntohl(frag->subh.data_hdr->tsn));
if (pos) if (pos)
sctp_outq_insert_data(q, frag, pos); sctp_outq_insert_data(q, frag, pos);
else else
sctp_outq_tail_data(q, frag); sctp_outq_tail_data(q, frag);
...@@ -584,7 +584,7 @@ void sctp_xmit_frag(struct sctp_outq *q, struct sctp_chunk *pos, ...@@ -584,7 +584,7 @@ void sctp_xmit_frag(struct sctp_outq *q, struct sctp_chunk *pos,
void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt, void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt,
sctp_chunk_t *frag) sctp_chunk_t *frag)
{ {
sctp_association_t *asoc = frag->asoc; struct sctp_association *asoc = frag->asoc;
struct list_head *lfrag, *frag_list; struct list_head *lfrag, *frag_list;
__u32 tsn; __u32 tsn;
int nfrags = 1; int nfrags = 1;
...@@ -618,7 +618,7 @@ void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -618,7 +618,7 @@ void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt,
sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk, sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk,
size_t max_frag_data_len) size_t max_frag_data_len)
{ {
sctp_association_t *asoc = chunk->asoc; struct sctp_association *asoc = chunk->asoc;
void *data_ptr = chunk->subh.data_hdr; void *data_ptr = chunk->subh.data_hdr;
struct sctp_sndrcvinfo *sinfo = &chunk->sinfo; struct sctp_sndrcvinfo *sinfo = &chunk->sinfo;
__u16 chunk_data_len = sctp_data_size(chunk); __u16 chunk_data_len = sctp_data_size(chunk);
...@@ -724,7 +724,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) ...@@ -724,7 +724,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
{ {
struct sctp_packet *packet; struct sctp_packet *packet;
struct sctp_packet singleton; struct sctp_packet singleton;
sctp_association_t *asoc = q->asoc; struct sctp_association *asoc = q->asoc;
int ecn_capable = asoc->peer.ecn_capable; int ecn_capable = asoc->peer.ecn_capable;
__u16 sport = asoc->base.bind_addr.port; __u16 sport = asoc->base.bind_addr.port;
__u16 dport = asoc->peer.port; __u16 dport = asoc->peer.port;
...@@ -1077,7 +1077,7 @@ int sctp_outq_set_output_handlers(struct sctp_outq *q, ...@@ -1077,7 +1077,7 @@ int sctp_outq_set_output_handlers(struct sctp_outq *q,
} }
/* Update unack_data based on the incoming SACK chunk */ /* Update unack_data based on the incoming SACK chunk */
static void sctp_sack_update_unack_data(sctp_association_t *assoc, static void sctp_sack_update_unack_data(struct sctp_association *assoc,
sctp_sackhdr_t *sack) sctp_sackhdr_t *sack)
{ {
sctp_sack_variable_t *frags; sctp_sack_variable_t *frags;
...@@ -1097,7 +1097,7 @@ static void sctp_sack_update_unack_data(sctp_association_t *assoc, ...@@ -1097,7 +1097,7 @@ static void sctp_sack_update_unack_data(sctp_association_t *assoc,
/* Return the highest new tsn that is acknowledged by the given SACK chunk. */ /* Return the highest new tsn that is acknowledged by the given SACK chunk. */
static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack, static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack,
sctp_association_t *asoc) struct sctp_association *asoc)
{ {
struct list_head *ltransport, *lchunk; struct list_head *ltransport, *lchunk;
struct sctp_transport *transport; struct sctp_transport *transport;
...@@ -1132,7 +1132,7 @@ static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack, ...@@ -1132,7 +1132,7 @@ static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack,
*/ */
int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack) int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack)
{ {
sctp_association_t *asoc = q->asoc; struct sctp_association *asoc = q->asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *tchunk; sctp_chunk_t *tchunk;
struct list_head *lchunk, *transport_list, *pos; struct list_head *lchunk, *transport_list, *pos;
......
...@@ -55,12 +55,12 @@ ...@@ -55,12 +55,12 @@
#define DECLARE_PRIMITIVE(name) \ #define DECLARE_PRIMITIVE(name) \
/* This is called in the code as sctp_primitive_ ## name. */ \ /* This is called in the code as sctp_primitive_ ## name. */ \
int sctp_primitive_ ## name(sctp_association_t *asoc, \ int sctp_primitive_ ## name(struct sctp_association *asoc, \
void *arg) { \ void *arg) { \
int error = 0; \ int error = 0; \
sctp_event_t event_type; sctp_subtype_t subtype; \ sctp_event_t event_type; sctp_subtype_t subtype; \
sctp_state_t state; \ sctp_state_t state; \
sctp_endpoint_t *ep; \ struct sctp_endpoint *ep; \
\ \
event_type = SCTP_EVENT_T_PRIMITIVE; \ event_type = SCTP_EVENT_T_PRIMITIVE; \
subtype = SCTP_ST_PRIMITIVE(SCTP_PRIMITIVE_ ## name); \ subtype = SCTP_ST_PRIMITIVE(SCTP_PRIMITIVE_ ## name); \
......
...@@ -203,7 +203,7 @@ static void sctp_free_local_addr_list(struct sctp_protocol *proto) ...@@ -203,7 +203,7 @@ static void sctp_free_local_addr_list(struct sctp_protocol *proto)
/* Copy the local addresses which are valid for 'scope' into 'bp'. */ /* Copy the local addresses which are valid for 'scope' into 'bp'. */
int sctp_copy_local_addr_list(struct sctp_protocol *proto, int sctp_copy_local_addr_list(struct sctp_protocol *proto,
struct sctp_bind_addr *bp, sctp_scope_t scope, struct sctp_bind_addr *bp, sctp_scope_t scope,
int priority, int copy_flags) int gfp, int copy_flags)
{ {
struct sockaddr_storage_list *addr; struct sockaddr_storage_list *addr;
int error = 0; int error = 0;
...@@ -223,8 +223,7 @@ int sctp_copy_local_addr_list(struct sctp_protocol *proto, ...@@ -223,8 +223,7 @@ int sctp_copy_local_addr_list(struct sctp_protocol *proto,
(((AF_INET6 == addr->a.sa.sa_family) && (((AF_INET6 == addr->a.sa.sa_family) &&
(copy_flags & SCTP_ADDR6_ALLOWED) && (copy_flags & SCTP_ADDR6_ALLOWED) &&
(copy_flags & SCTP_ADDR6_PEERSUPP)))) { (copy_flags & SCTP_ADDR6_PEERSUPP)))) {
error = sctp_add_bind_addr(bp, &addr->a, error = sctp_add_bind_addr(bp, &addr->a, gfp);
priority);
if (error) if (error)
goto end_copy; goto end_copy;
} }
...@@ -471,7 +470,7 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, ...@@ -471,7 +470,7 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
/* For v4, the source address is cached in the route entry(dst). So no need /* For v4, the source address is cached in the route entry(dst). So no need
* to cache it separately and hence this is an empty routine. * to cache it separately and hence this is an empty routine.
*/ */
void sctp_v4_get_saddr(sctp_association_t *asoc, void sctp_v4_get_saddr(struct sctp_association *asoc,
struct dst_entry *dst, struct dst_entry *dst,
union sctp_addr *daddr, union sctp_addr *daddr,
union sctp_addr *saddr) union sctp_addr *saddr)
...@@ -480,12 +479,12 @@ void sctp_v4_get_saddr(sctp_association_t *asoc, ...@@ -480,12 +479,12 @@ void sctp_v4_get_saddr(sctp_association_t *asoc,
} }
/* What interface did this skb arrive on? */ /* What interface did this skb arrive on? */
int sctp_v4_skb_iif(const struct sk_buff *skb) int sctp_v4_skb_iif(const struct sk_buff *skb)
{ {
return ((struct rtable *)skb->dst)->rt_iif; return ((struct rtable *)skb->dst)->rt_iif;
} }
/* Create and initialize a new sk for the socket returned by accept(). */ /* Create and initialize a new sk for the socket returned by accept(). */
struct sock *sctp_v4_create_accept_sk(struct sock *sk, struct sock *sctp_v4_create_accept_sk(struct sock *sk,
struct sctp_association *asoc) struct sctp_association *asoc)
{ {
...@@ -511,7 +510,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk, ...@@ -511,7 +510,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk,
newsk->family = PF_INET; newsk->family = PF_INET;
newsk->protocol = IPPROTO_SCTP; newsk->protocol = IPPROTO_SCTP;
newsk->backlog_rcv = sk->prot->backlog_rcv; newsk->backlog_rcv = sk->prot->backlog_rcv;
newinet = inet_sk(newsk); newinet = inet_sk(newsk);
newinet->sport = inet->sport; newinet->sport = inet->sport;
newinet->saddr = inet->saddr; newinet->saddr = inet->saddr;
...@@ -520,7 +519,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk, ...@@ -520,7 +519,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk,
newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr;
newinet->pmtudisc = inet->pmtudisc; newinet->pmtudisc = inet->pmtudisc;
newinet->id = 0; newinet->id = 0;
newinet->ttl = sysctl_ip_default_ttl; newinet->ttl = sysctl_ip_default_ttl;
newinet->mc_loop = 1; newinet->mc_loop = 1;
newinet->mc_ttl = 1; newinet->mc_ttl = 1;
...@@ -567,7 +566,7 @@ int sctp_ctl_sock_init(void) ...@@ -567,7 +566,7 @@ int sctp_ctl_sock_init(void)
if (sctp_get_pf_specific(PF_INET6)) if (sctp_get_pf_specific(PF_INET6))
family = PF_INET6; family = PF_INET6;
else else
family = PF_INET; family = PF_INET;
err = sock_create(family, SOCK_SEQPACKET, IPPROTO_SCTP, err = sock_create(family, SOCK_SEQPACKET, IPPROTO_SCTP,
...@@ -694,7 +693,7 @@ static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -694,7 +693,7 @@ static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr)
return sctp_v4_available(addr); return sctp_v4_available(addr);
} }
/* Verify that sockaddr looks sendable. Common verification has already /* Verify that sockaddr looks sendable. Common verification has already
* been taken care of. * been taken care of.
*/ */
static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr) static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr)
...@@ -705,7 +704,7 @@ static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr) ...@@ -705,7 +704,7 @@ static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr)
/* Fill in Supported Address Type information for INIT and INIT-ACK /* Fill in Supported Address Type information for INIT and INIT-ACK
* chunks. Returns number of addresses supported. * chunks. Returns number of addresses supported.
*/ */
static int sctp_inet_supported_addrs(const struct sctp_opt *opt, static int sctp_inet_supported_addrs(const struct sctp_opt *opt,
__u16 *types) __u16 *types)
{ {
types[0] = SCTP_PARAM_IPV4_ADDRESS; types[0] = SCTP_PARAM_IPV4_ADDRESS;
......
...@@ -2064,7 +2064,7 @@ int sctp_process_param(struct sctp_association *asoc, union sctp_params param, ...@@ -2064,7 +2064,7 @@ int sctp_process_param(struct sctp_association *asoc, union sctp_params param,
} }
/* Select a new verification tag. */ /* Select a new verification tag. */
__u32 sctp_generate_tag(const sctp_endpoint_t *ep) __u32 sctp_generate_tag(const struct sctp_endpoint *ep)
{ {
/* I believe that this random number generator complies with RFC1750. /* I believe that this random number generator complies with RFC1750.
* A tag of 0 is reserved for special cases (e.g. INIT). * A tag of 0 is reserved for special cases (e.g. INIT).
...@@ -2079,7 +2079,7 @@ __u32 sctp_generate_tag(const sctp_endpoint_t *ep) ...@@ -2079,7 +2079,7 @@ __u32 sctp_generate_tag(const sctp_endpoint_t *ep)
} }
/* Select an initial TSN to send during startup. */ /* Select an initial TSN to send during startup. */
__u32 sctp_generate_tsn(const sctp_endpoint_t *ep) __u32 sctp_generate_tsn(const struct sctp_endpoint *ep)
{ {
__u32 retval; __u32 retval;
......
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
********************************************************************/ ********************************************************************/
/* A helper function for delayed processing of INET ECN CE bit. */ /* A helper function for delayed processing of INET ECN CE bit. */
static void sctp_do_ecn_ce_work(sctp_association_t *asoc, __u32 lowest_tsn) static void sctp_do_ecn_ce_work(struct sctp_association *asoc,
__u32 lowest_tsn)
{ {
/* Save the TSN away for comparison when we receive CWR */ /* Save the TSN away for comparison when we receive CWR */
...@@ -80,7 +81,7 @@ static void sctp_do_ecn_ce_work(sctp_association_t *asoc, __u32 lowest_tsn) ...@@ -80,7 +81,7 @@ static void sctp_do_ecn_ce_work(sctp_association_t *asoc, __u32 lowest_tsn)
* This element represents the lowest TSN number in the datagram * This element represents the lowest TSN number in the datagram
* that was originally marked with the CE bit. * that was originally marked with the CE bit.
*/ */
static sctp_chunk_t *sctp_do_ecn_ecne_work(sctp_association_t *asoc, static sctp_chunk_t *sctp_do_ecn_ecne_work(struct sctp_association *asoc,
__u32 lowest_tsn, __u32 lowest_tsn,
sctp_chunk_t *chunk) sctp_chunk_t *chunk)
{ {
...@@ -123,7 +124,7 @@ static sctp_chunk_t *sctp_do_ecn_ecne_work(sctp_association_t *asoc, ...@@ -123,7 +124,7 @@ static sctp_chunk_t *sctp_do_ecn_ecne_work(sctp_association_t *asoc,
} }
/* Helper function to do delayed processing of ECN CWR chunk. */ /* Helper function to do delayed processing of ECN CWR chunk. */
static void sctp_do_ecn_cwr_work(sctp_association_t *asoc, static void sctp_do_ecn_cwr_work(struct sctp_association *asoc,
__u32 lowest_tsn) __u32 lowest_tsn)
{ {
/* Turn off ECNE getting auto-prepended to every outgoing /* Turn off ECNE getting auto-prepended to every outgoing
...@@ -200,7 +201,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer) ...@@ -200,7 +201,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
{ {
int error; int error;
struct sctp_transport *transport = (struct sctp_transport *) peer; struct sctp_transport *transport = (struct sctp_transport *) peer;
sctp_association_t *asoc = transport->asoc; struct sctp_association *asoc = transport->asoc;
/* Check whether a task is in the sock. */ /* Check whether a task is in the sock. */
...@@ -238,7 +239,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer) ...@@ -238,7 +239,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
/* This is a sa interface for producing timeout events. It works /* This is a sa interface for producing timeout events. It works
* for timeouts which use the association as their parameter. * for timeouts which use the association as their parameter.
*/ */
static void sctp_generate_timeout_event(sctp_association_t *asoc, static void sctp_generate_timeout_event(struct sctp_association *asoc,
sctp_event_timeout_t timeout_type) sctp_event_timeout_t timeout_type)
{ {
int error = 0; int error = 0;
...@@ -265,8 +266,7 @@ static void sctp_generate_timeout_event(sctp_association_t *asoc, ...@@ -265,8 +266,7 @@ static void sctp_generate_timeout_event(sctp_association_t *asoc,
error = sctp_do_sm(SCTP_EVENT_T_TIMEOUT, error = sctp_do_sm(SCTP_EVENT_T_TIMEOUT,
SCTP_ST_TIMEOUT(timeout_type), SCTP_ST_TIMEOUT(timeout_type),
asoc->state, asoc->ep, asoc, asoc->state, asoc->ep, asoc,
(void *)timeout_type, (void *)timeout_type, GFP_ATOMIC);
GFP_ATOMIC);
if (error) if (error)
asoc->base.sk->err = -error; asoc->base.sk->err = -error;
...@@ -278,25 +278,25 @@ static void sctp_generate_timeout_event(sctp_association_t *asoc, ...@@ -278,25 +278,25 @@ static void sctp_generate_timeout_event(sctp_association_t *asoc,
void sctp_generate_t1_cookie_event(unsigned long data) void sctp_generate_t1_cookie_event(unsigned long data)
{ {
sctp_association_t *asoc = (sctp_association_t *) data; struct sctp_association *asoc = (struct sctp_association *) data;
sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T1_COOKIE); sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T1_COOKIE);
} }
void sctp_generate_t1_init_event(unsigned long data) void sctp_generate_t1_init_event(unsigned long data)
{ {
sctp_association_t *asoc = (sctp_association_t *) data; struct sctp_association *asoc = (struct sctp_association *) data;
sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T1_INIT); sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T1_INIT);
} }
void sctp_generate_t2_shutdown_event(unsigned long data) void sctp_generate_t2_shutdown_event(unsigned long data)
{ {
sctp_association_t *asoc = (sctp_association_t *) data; struct sctp_association *asoc = (struct sctp_association *) data;
sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T2_SHUTDOWN); sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T2_SHUTDOWN);
} }
void sctp_generate_t5_shutdown_guard_event(unsigned long data) void sctp_generate_t5_shutdown_guard_event(unsigned long data)
{ {
sctp_association_t *asoc = (sctp_association_t *)data; struct sctp_association *asoc = (struct sctp_association *)data;
sctp_generate_timeout_event(asoc, sctp_generate_timeout_event(asoc,
SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD); SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD);
...@@ -304,7 +304,7 @@ void sctp_generate_t5_shutdown_guard_event(unsigned long data) ...@@ -304,7 +304,7 @@ void sctp_generate_t5_shutdown_guard_event(unsigned long data)
void sctp_generate_autoclose_event(unsigned long data) void sctp_generate_autoclose_event(unsigned long data)
{ {
sctp_association_t *asoc = (sctp_association_t *) data; struct sctp_association *asoc = (struct sctp_association *) data;
sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_AUTOCLOSE); sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_AUTOCLOSE);
} }
...@@ -315,7 +315,7 @@ void sctp_generate_heartbeat_event(unsigned long data) ...@@ -315,7 +315,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
{ {
int error = 0; int error = 0;
struct sctp_transport *transport = (struct sctp_transport *) data; struct sctp_transport *transport = (struct sctp_transport *) data;
sctp_association_t *asoc = transport->asoc; struct sctp_association *asoc = transport->asoc;
sctp_bh_lock_sock(asoc->base.sk); sctp_bh_lock_sock(asoc->base.sk);
if (sock_owned_by_user(asoc->base.sk)) { if (sock_owned_by_user(asoc->base.sk)) {
...@@ -335,8 +335,7 @@ void sctp_generate_heartbeat_event(unsigned long data) ...@@ -335,8 +335,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
error = sctp_do_sm(SCTP_EVENT_T_TIMEOUT, error = sctp_do_sm(SCTP_EVENT_T_TIMEOUT,
SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_HEARTBEAT), SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_HEARTBEAT),
asoc->state, asoc->state, asoc->ep, asoc,
asoc->ep, asoc,
transport, GFP_ATOMIC); transport, GFP_ATOMIC);
if (error) if (error)
...@@ -350,7 +349,7 @@ void sctp_generate_heartbeat_event(unsigned long data) ...@@ -350,7 +349,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
/* Inject a SACK Timeout event into the state machine. */ /* Inject a SACK Timeout event into the state machine. */
void sctp_generate_sack_event(unsigned long data) void sctp_generate_sack_event(unsigned long data)
{ {
sctp_association_t *asoc = (sctp_association_t *) data; struct sctp_association *asoc = (struct sctp_association *) data;
sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_SACK); sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_SACK);
} }
...@@ -382,7 +381,7 @@ sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = { ...@@ -382,7 +381,7 @@ sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = {
* notification SHOULD be sent to the upper layer. * notification SHOULD be sent to the upper layer.
* *
*/ */
static void sctp_do_8_2_transport_strike(sctp_association_t *asoc, static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
struct sctp_transport *transport) struct sctp_transport *transport)
{ {
/* The check for association's overall error counter exceeding the /* The check for association's overall error counter exceeding the
...@@ -410,7 +409,7 @@ static void sctp_do_8_2_transport_strike(sctp_association_t *asoc, ...@@ -410,7 +409,7 @@ static void sctp_do_8_2_transport_strike(sctp_association_t *asoc,
/* Worker routine to handle INIT command failure. */ /* Worker routine to handle INIT command failure. */
static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands, static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
sctp_association_t *asoc, struct sctp_association *asoc,
unsigned error) unsigned error)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
...@@ -483,7 +482,7 @@ static int sctp_cmd_process_init(sctp_cmd_seq_t *commands, ...@@ -483,7 +482,7 @@ static int sctp_cmd_process_init(sctp_cmd_seq_t *commands,
/* Helper function to break out starting up of heartbeat timers. */ /* Helper function to break out starting up of heartbeat timers. */
static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds, static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc) struct sctp_association *asoc)
{ {
struct sctp_transport *t; struct sctp_transport *t;
struct list_head *pos; struct list_head *pos;
...@@ -501,7 +500,7 @@ static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds, ...@@ -501,7 +500,7 @@ static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds,
} }
static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds, static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc) struct sctp_association *asoc)
{ {
struct sctp_transport *t; struct sctp_transport *t;
struct list_head *pos; struct list_head *pos;
...@@ -517,7 +516,7 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds, ...@@ -517,7 +516,7 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
/* Helper function to update the heartbeat timer. */ /* Helper function to update the heartbeat timer. */
static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc, struct sctp_association *asoc,
struct sctp_transport *t) struct sctp_transport *t)
{ {
/* Update the heartbeat timer. */ /* Update the heartbeat timer. */
...@@ -527,7 +526,7 @@ static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, ...@@ -527,7 +526,7 @@ static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
/* Helper function to handle the reception of an HEARTBEAT ACK. */ /* Helper function to handle the reception of an HEARTBEAT ACK. */
static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc, struct sctp_association *asoc,
struct sctp_transport *t, struct sctp_transport *t,
sctp_chunk_t *chunk) sctp_chunk_t *chunk)
{ {
...@@ -560,7 +559,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, ...@@ -560,7 +559,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
* timer. * timer.
*/ */
static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds, static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc, struct sctp_association *asoc,
struct sctp_transport *t) struct sctp_transport *t)
{ {
sctp_transport_lower_cwnd(t, SCTP_LOWER_CWND_INACTIVE); sctp_transport_lower_cwnd(t, SCTP_LOWER_CWND_INACTIVE);
...@@ -571,7 +570,7 @@ static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds, ...@@ -571,7 +570,7 @@ static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds,
/* Helper function to process the process SACK command. */ /* Helper function to process the process SACK command. */
static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds, static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc, struct sctp_association *asoc,
sctp_sackhdr_t *sackh) sctp_sackhdr_t *sackh)
{ {
int err; int err;
...@@ -595,7 +594,8 @@ static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds, ...@@ -595,7 +594,8 @@ static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
/* Helper function to set the timeout value for T2-SHUTDOWN timer and to set /* Helper function to set the timeout value for T2-SHUTDOWN timer and to set
* the transport for a shutdown chunk. * the transport for a shutdown chunk.
*/ */
static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds, sctp_association_t *asoc, static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
struct sctp_association *asoc,
sctp_chunk_t *chunk) sctp_chunk_t *chunk)
{ {
struct sctp_transport *t; struct sctp_transport *t;
...@@ -607,7 +607,7 @@ static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds, sctp_association_t *asoc, ...@@ -607,7 +607,7 @@ static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds, sctp_association_t *asoc,
} }
/* Helper function to change the state of an association. */ /* Helper function to change the state of an association. */
static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds, sctp_association_t *asoc, static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds, struct sctp_association *asoc,
sctp_state_t state) sctp_state_t state)
{ {
...@@ -673,10 +673,10 @@ static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds, sctp_association_t *asoc, ...@@ -673,10 +673,10 @@ static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds, sctp_association_t *asoc,
*/ */
int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_state_t state,
sctp_endpoint_t *ep, struct sctp_endpoint *ep,
sctp_association_t *asoc, struct sctp_association *asoc,
void *event_arg, void *event_arg,
int priority) int gfp)
{ {
sctp_cmd_seq_t commands; sctp_cmd_seq_t commands;
sctp_sm_table_entry_t *state_fn; sctp_sm_table_entry_t *state_fn;
...@@ -701,9 +701,8 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -701,9 +701,8 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
DEBUG_POST; DEBUG_POST;
error = sctp_side_effects(event_type, subtype, state, error = sctp_side_effects(event_type, subtype, state,
ep, asoc, event_arg, ep, asoc, event_arg, status,
status, &commands, &commands, gfp);
priority);
DEBUG_POST_SFX; DEBUG_POST_SFX;
return error; return error;
...@@ -717,12 +716,12 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -717,12 +716,12 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
*****************************************************************/ *****************************************************************/
int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_state_t state,
sctp_endpoint_t *ep, struct sctp_endpoint *ep,
sctp_association_t *asoc, struct sctp_association *asoc,
void *event_arg, void *event_arg,
sctp_disposition_t status, sctp_disposition_t status,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
int priority) int gfp)
{ {
int error; int error;
...@@ -735,7 +734,7 @@ int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -735,7 +734,7 @@ int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
if (0 != (error = sctp_cmd_interpreter(event_type, subtype, state, if (0 != (error = sctp_cmd_interpreter(event_type, subtype, state,
ep, asoc, ep, asoc,
event_arg, status, event_arg, status,
commands, priority))) commands, gfp)))
goto bail; goto bail;
switch (status) { switch (status) {
...@@ -803,10 +802,10 @@ int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -803,10 +802,10 @@ int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
/* This is the side-effect interpreter. */ /* This is the side-effect interpreter. */
int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_endpoint_t *ep, sctp_state_t state, struct sctp_endpoint *ep,
sctp_association_t *asoc, void *event_arg, struct sctp_association *asoc, void *event_arg,
sctp_disposition_t status, sctp_cmd_seq_t *commands, sctp_disposition_t status, sctp_cmd_seq_t *commands,
int priority) int gfp)
{ {
int error = 0; int error = 0;
int force; int force;
...@@ -903,7 +902,7 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -903,7 +902,7 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
* layer which will bail. * layer which will bail.
*/ */
error = sctp_cmd_process_init(commands, asoc, chunk, error = sctp_cmd_process_init(commands, asoc, chunk,
cmd->obj.ptr, priority); cmd->obj.ptr, gfp);
break; break;
case SCTP_CMD_GEN_COOKIE_ECHO: case SCTP_CMD_GEN_COOKIE_ECHO:
......
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_4_C(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -179,15 +179,15 @@ sctp_disposition_t sctp_sf_do_4_C(const sctp_endpoint_t *ep, ...@@ -179,15 +179,15 @@ sctp_disposition_t sctp_sf_do_4_C(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_1B_init(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
sctp_chunk_t *repl; sctp_chunk_t *repl;
sctp_association_t *new_asoc; struct sctp_association *new_asoc;
sctp_chunk_t *err_chunk; sctp_chunk_t *err_chunk;
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_unrecognized_param_t *unk_param; sctp_unrecognized_param_t *unk_param;
...@@ -260,8 +260,8 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const sctp_endpoint_t *ep, ...@@ -260,8 +260,8 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const sctp_endpoint_t *ep,
/* The call, sctp_process_init(), can fail on memory allocation. */ /* The call, sctp_process_init(), can fail on memory allocation. */
if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type,
sctp_source(chunk), sctp_source(chunk),
(sctp_init_chunk_t *)chunk->chunk_hdr, (sctp_init_chunk_t *)chunk->chunk_hdr,
GFP_ATOMIC)) GFP_ATOMIC))
goto nomem_init; goto nomem_init;
...@@ -355,8 +355,8 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const sctp_endpoint_t *ep, ...@@ -355,8 +355,8 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_1C_ack(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -514,13 +514,13 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const sctp_endpoint_t *ep, ...@@ -514,13 +514,13 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_1D_ce(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg, const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
sctp_association_t *new_asoc; struct sctp_association *new_asoc;
sctp_init_chunk_t *peer_init; sctp_init_chunk_t *peer_init;
sctp_chunk_t *repl; sctp_chunk_t *repl;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
...@@ -652,8 +652,8 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const sctp_endpoint_t *ep, ...@@ -652,8 +652,8 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_1E_ca(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg, const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
...@@ -697,8 +697,8 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const sctp_endpoint_t *ep, ...@@ -697,8 +697,8 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const sctp_endpoint_t *ep,
} }
/* Generate and sendout a heartbeat packet. */ /* Generate and sendout a heartbeat packet. */
sctp_disposition_t sctp_sf_heartbeat(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -730,8 +730,8 @@ sctp_disposition_t sctp_sf_heartbeat(const sctp_endpoint_t *ep, ...@@ -730,8 +730,8 @@ sctp_disposition_t sctp_sf_heartbeat(const sctp_endpoint_t *ep,
} }
/* Generate a HEARTBEAT packet on the given transport. */ /* Generate a HEARTBEAT packet on the given transport. */
sctp_disposition_t sctp_sf_sendbeat_8_3(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -740,7 +740,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const sctp_endpoint_t *ep, ...@@ -740,7 +740,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const sctp_endpoint_t *ep,
if (asoc->overall_error_count >= asoc->overall_error_threshold) { if (asoc->overall_error_count >= asoc->overall_error_threshold) {
/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_NO_ERROR)); SCTP_U32(SCTP_ERROR_NO_ERROR));
SCTP_INC_STATS(SctpAborteds); SCTP_INC_STATS(SctpAborteds);
SCTP_DEC_STATS(SctpCurrEstab); SCTP_DEC_STATS(SctpCurrEstab);
...@@ -795,8 +795,8 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const sctp_endpoint_t *ep, ...@@ -795,8 +795,8 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_beat_8_3(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -862,8 +862,8 @@ sctp_disposition_t sctp_sf_beat_8_3(const sctp_endpoint_t *ep, ...@@ -862,8 +862,8 @@ sctp_disposition_t sctp_sf_beat_8_3(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_backbeat_8_3(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -926,7 +926,7 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa, ...@@ -926,7 +926,7 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa,
struct sctp_packet *pkt; struct sctp_packet *pkt;
sctp_addr_param_t *addrparm; sctp_addr_param_t *addrparm;
sctp_errhdr_t *errhdr; sctp_errhdr_t *errhdr;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
char buffer[sizeof(sctp_errhdr_t) + sizeof(sctp_addr_param_t)]; char buffer[sizeof(sctp_errhdr_t) + sizeof(sctp_addr_param_t)];
/* Build the error on the stack. We are way to malloc crazy /* Build the error on the stack. We are way to malloc crazy
...@@ -969,8 +969,8 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa, ...@@ -969,8 +969,8 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa,
/* A restart is occurring, check to make sure no new addresses /* A restart is occurring, check to make sure no new addresses
* are being added as we may be under a takeover attack. * are being added as we may be under a takeover attack.
*/ */
static int sctp_sf_check_restart_addrs(const sctp_association_t *new_asoc, static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc,
const sctp_association_t *asoc, const struct sctp_association *asoc,
sctp_chunk_t *init, sctp_chunk_t *init,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
...@@ -1022,8 +1022,8 @@ static int sctp_sf_check_restart_addrs(const sctp_association_t *new_asoc, ...@@ -1022,8 +1022,8 @@ static int sctp_sf_check_restart_addrs(const sctp_association_t *new_asoc,
* *
* Note: Do not use in CLOSED or SHUTDOWN-ACK-SENT state. * Note: Do not use in CLOSED or SHUTDOWN-ACK-SENT state.
*/ */
static void sctp_tietags_populate(sctp_association_t *new_asoc, static void sctp_tietags_populate(struct sctp_association *new_asoc,
const sctp_association_t *asoc) const struct sctp_association *asoc)
{ {
switch (asoc->state) { switch (asoc->state) {
...@@ -1069,8 +1069,8 @@ static void sctp_tietags_populate(sctp_association_t *new_asoc, ...@@ -1069,8 +1069,8 @@ static void sctp_tietags_populate(sctp_association_t *new_asoc,
* Returns value representing action to be taken. These action values * Returns value representing action to be taken. These action values
* correspond to Action/Description values in RFC 2960, Table 2. * correspond to Action/Description values in RFC 2960, Table 2.
*/ */
static char sctp_tietags_compare(sctp_association_t *new_asoc, static char sctp_tietags_compare(struct sctp_association *new_asoc,
const sctp_association_t *asoc) const struct sctp_association *asoc)
{ {
/* In this case, the peer may have restarted. */ /* In this case, the peer may have restarted. */
if ((asoc->c.my_vtag != new_asoc->c.my_vtag) && if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
...@@ -1106,15 +1106,15 @@ static char sctp_tietags_compare(sctp_association_t *new_asoc, ...@@ -1106,15 +1106,15 @@ static char sctp_tietags_compare(sctp_association_t *new_asoc,
* chunk handling. * chunk handling.
*/ */
static sctp_disposition_t sctp_sf_do_unexpected_init( static sctp_disposition_t sctp_sf_do_unexpected_init(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, sctp_cmd_seq_t *commands) void *arg, sctp_cmd_seq_t *commands)
{ {
sctp_disposition_t retval; sctp_disposition_t retval;
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
sctp_chunk_t *repl; sctp_chunk_t *repl;
sctp_association_t *new_asoc; struct sctp_association *new_asoc;
sctp_chunk_t *err_chunk; sctp_chunk_t *err_chunk;
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_unrecognized_param_t *unk_param; sctp_unrecognized_param_t *unk_param;
...@@ -1303,11 +1303,11 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1303,11 +1303,11 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_2_1_siminit(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_2_1_siminit(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
/* Call helper to do the real work for both simulataneous and /* Call helper to do the real work for both simulataneous and
* duplicate INIT chunk handling. * duplicate INIT chunk handling.
...@@ -1356,11 +1356,11 @@ sctp_disposition_t sctp_sf_do_5_2_1_siminit(const sctp_endpoint_t *ep, ...@@ -1356,11 +1356,11 @@ sctp_disposition_t sctp_sf_do_5_2_1_siminit(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
/* Call helper to do the real work for both simulataneous and /* Call helper to do the real work for both simulataneous and
* duplicate INIT chunk handling. * duplicate INIT chunk handling.
...@@ -1375,11 +1375,11 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const sctp_endpoint_t *ep, ...@@ -1375,11 +1375,11 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const sctp_endpoint_t *ep,
* Section 5.2.4 * Section 5.2.4
* A) In this case, the peer may have restarted. * A) In this case, the peer may have restarted.
*/ */
static sctp_disposition_t sctp_sf_do_dupcook_a(const sctp_endpoint_t *ep, static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc) struct sctp_association *new_asoc)
{ {
sctp_init_chunk_t *peer_init; sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
...@@ -1391,7 +1391,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const sctp_endpoint_t *ep, ...@@ -1391,7 +1391,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const sctp_endpoint_t *ep,
peer_init = &chunk->subh.cookie_hdr->c.peer_init[0]; peer_init = &chunk->subh.cookie_hdr->c.peer_init[0];
if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type,
sctp_source(chunk), peer_init, sctp_source(chunk), peer_init,
GFP_ATOMIC)) GFP_ATOMIC))
goto nomem; goto nomem;
...@@ -1442,11 +1442,11 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const sctp_endpoint_t *ep, ...@@ -1442,11 +1442,11 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const sctp_endpoint_t *ep,
* after responding to the local endpoint's INIT * after responding to the local endpoint's INIT
*/ */
/* This case represents an initialization collision. */ /* This case represents an initialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep, static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc) struct sctp_association *new_asoc)
{ {
sctp_init_chunk_t *peer_init; sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
...@@ -1457,7 +1457,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep, ...@@ -1457,7 +1457,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep,
*/ */
peer_init = &chunk->subh.cookie_hdr->c.peer_init[0]; peer_init = &chunk->subh.cookie_hdr->c.peer_init[0];
if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type,
sctp_source(chunk), peer_init, sctp_source(chunk), peer_init,
GFP_ATOMIC)) GFP_ATOMIC))
goto nomem; goto nomem;
...@@ -1506,11 +1506,11 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep, ...@@ -1506,11 +1506,11 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep,
* but a new tag of its own. * but a new tag of its own.
*/ */
/* This case represents an intialization collision. */ /* This case represents an intialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_c(const sctp_endpoint_t *ep, static sctp_disposition_t sctp_sf_do_dupcook_c(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc) struct sctp_association *new_asoc)
{ {
/* The cookie should be silently discarded. /* The cookie should be silently discarded.
* The endpoint SHOULD NOT change states and should leave * The endpoint SHOULD NOT change states and should leave
...@@ -1527,11 +1527,11 @@ static sctp_disposition_t sctp_sf_do_dupcook_c(const sctp_endpoint_t *ep, ...@@ -1527,11 +1527,11 @@ static sctp_disposition_t sctp_sf_do_dupcook_c(const sctp_endpoint_t *ep,
* enter the ESTABLISHED state, if it has not already done so. * enter the ESTABLISHED state, if it has not already done so.
*/ */
/* This case represents an intialization collision. */ /* This case represents an intialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_d(const sctp_endpoint_t *ep, static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc) struct sctp_association *new_asoc)
{ {
struct sctp_ulpevent *ev = NULL; struct sctp_ulpevent *ev = NULL;
sctp_chunk_t *repl; sctp_chunk_t *repl;
...@@ -1603,15 +1603,15 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const sctp_endpoint_t *ep, ...@@ -1603,15 +1603,15 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_disposition_t retval; sctp_disposition_t retval;
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
sctp_association_t *new_asoc; struct sctp_association *new_asoc;
int error = 0; int error = 0;
char action; char action;
sctp_chunk_t *err_chk_p; sctp_chunk_t *err_chk_p;
...@@ -1701,11 +1701,12 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const sctp_endpoint_t *ep, ...@@ -1701,11 +1701,12 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const sctp_endpoint_t *ep,
* *
* See sctp_sf_do_9_1_abort(). * See sctp_sf_do_9_1_abort().
*/ */
sctp_disposition_t sctp_sf_shutdown_pending_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_shutdown_pending_abort(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
...@@ -1724,11 +1725,11 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort(const sctp_endpoint_t *ep, ...@@ -1724,11 +1725,11 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort(const sctp_endpoint_t *ep,
* *
* See sctp_sf_do_9_1_abort(). * See sctp_sf_do_9_1_abort().
*/ */
sctp_disposition_t sctp_sf_shutdown_sent_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
...@@ -1751,11 +1752,12 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const sctp_endpoint_t *ep, ...@@ -1751,11 +1752,12 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const sctp_endpoint_t *ep,
* *
* See sctp_sf_do_9_1_abort(). * See sctp_sf_do_9_1_abort().
*/ */
sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
/* The same T2 timer, so we should be able to use /* The same T2 timer, so we should be able to use
* common function with the SHUTDOWN-SENT state. * common function with the SHUTDOWN-SENT state.
...@@ -1777,11 +1779,11 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(const sctp_endpoint_t *ep, ...@@ -1777,11 +1779,11 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_cookie_echoed_err(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_cookie_echoed_err(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
sctp_errhdr_t *err; sctp_errhdr_t *err;
...@@ -1792,7 +1794,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const sctp_endpoint_t *ep, ...@@ -1792,7 +1794,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const sctp_endpoint_t *ep,
if (1 + asoc->counters[SCTP_COUNTER_INIT_ERROR] > if (1 + asoc->counters[SCTP_COUNTER_INIT_ERROR] >
asoc->max_init_attempts) { asoc->max_init_attempts) {
/* INIT_FAILED will issue an ulpevent. */ /* INIT_FAILED will issue an ulpevent. */
sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
SCTP_U32(err->cause)); SCTP_U32(err->cause));
return SCTP_DISPOSITION_DELETE_TCB; return SCTP_DISPOSITION_DELETE_TCB;
} }
...@@ -1831,8 +1833,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const sctp_endpoint_t *ep, ...@@ -1831,8 +1833,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_5_2_6_stale(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -1850,7 +1852,7 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const sctp_endpoint_t *ep, ...@@ -1850,7 +1852,7 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const sctp_endpoint_t *ep,
attempts = asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1; attempts = asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1;
if (attempts >= asoc->max_init_attempts) { if (attempts >= asoc->max_init_attempts) {
sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
SCTP_U32(SCTP_ERROR_STALE_COOKIE)); SCTP_U32(SCTP_ERROR_STALE_COOKIE));
return SCTP_DISPOSITION_DELETE_TCB; return SCTP_DISPOSITION_DELETE_TCB;
} }
...@@ -1946,8 +1948,8 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const sctp_endpoint_t *ep, ...@@ -1946,8 +1948,8 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -1959,7 +1961,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep, ...@@ -1959,7 +1961,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep,
return sctp_sf_pdiscard(ep, asoc, type, arg, commands); return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
if (chunk && (ntohs(chunk->chunk_hdr->length) >= if (chunk && (ntohs(chunk->chunk_hdr->length) >=
(sizeof(struct sctp_chunkhdr) + (sizeof(struct sctp_chunkhdr) +
sizeof(struct sctp_errhdr)))) sizeof(struct sctp_errhdr))))
error = ((sctp_errhdr_t *)chunk->skb->data)->cause; error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
...@@ -1977,11 +1979,11 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep, ...@@ -1977,11 +1979,11 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep,
* *
* See sctp_sf_do_9_1_abort() above. * See sctp_sf_do_9_1_abort() above.
*/ */
sctp_disposition_t sctp_sf_cookie_wait_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
__u16 error = SCTP_ERROR_NO_ERROR; __u16 error = SCTP_ERROR_NO_ERROR;
...@@ -1996,7 +1998,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const sctp_endpoint_t *ep, ...@@ -1996,7 +1998,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const sctp_endpoint_t *ep,
SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
if (chunk && (ntohs(chunk->chunk_hdr->length) >= if (chunk && (ntohs(chunk->chunk_hdr->length) >=
(sizeof(struct sctp_chunkhdr) + (sizeof(struct sctp_chunkhdr) +
sizeof(struct sctp_errhdr)))) sizeof(struct sctp_errhdr))))
error = ((sctp_errhdr_t *)chunk->skb->data)->cause; error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
...@@ -2011,8 +2013,8 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const sctp_endpoint_t *ep, ...@@ -2011,8 +2013,8 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const sctp_endpoint_t *ep,
* *
* See sctp_sf_do_9_1_abort() above. * See sctp_sf_do_9_1_abort() above.
*/ */
sctp_disposition_t sctp_sf_cookie_echoed_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_cookie_echoed_abort(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2056,8 +2058,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_abort(const sctp_endpoint_t *ep, ...@@ -2056,8 +2058,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_abort(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_9_2_shutdown(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2111,11 +2113,11 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const sctp_endpoint_t *ep, ...@@ -2111,11 +2113,11 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const sctp_endpoint_t *ep,
* that belong to this association, it should discard the INIT chunk and * that belong to this association, it should discard the INIT chunk and
* retransmit the SHUTDOWN ACK chunk. * retransmit the SHUTDOWN ACK chunk.
*/ */
sctp_disposition_t sctp_sf_do_9_2_reshutack(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_2_reshutack(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = (sctp_chunk_t *) arg; sctp_chunk_t *chunk = (sctp_chunk_t *) arg;
sctp_chunk_t *reply; sctp_chunk_t *reply;
...@@ -2165,8 +2167,8 @@ sctp_disposition_t sctp_sf_do_9_2_reshutack(const sctp_endpoint_t *ep, ...@@ -2165,8 +2167,8 @@ sctp_disposition_t sctp_sf_do_9_2_reshutack(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_ecn_cwr(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2221,8 +2223,8 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const sctp_endpoint_t *ep, ...@@ -2221,8 +2223,8 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_ecne(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_ecne(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2279,8 +2281,8 @@ sctp_disposition_t sctp_sf_do_ecne(const sctp_endpoint_t *ep, ...@@ -2279,8 +2281,8 @@ sctp_disposition_t sctp_sf_do_ecne(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2409,7 +2411,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep, ...@@ -2409,7 +2411,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep,
* processing the rest of the chunks in the packet. * processing the rest of the chunks in the packet.
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_NO_DATA)); SCTP_U32(SCTP_ERROR_NO_DATA));
SCTP_INC_STATS(SctpAborteds); SCTP_INC_STATS(SctpAborteds);
SCTP_DEC_STATS(SctpCurrEstab); SCTP_DEC_STATS(SctpCurrEstab);
...@@ -2537,11 +2539,11 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep, ...@@ -2537,11 +2539,11 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_eat_data_fast_4_4(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; sctp_chunk_t *chunk = arg;
sctp_datahdr_t *data_hdr; sctp_datahdr_t *data_hdr;
...@@ -2625,7 +2627,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const sctp_endpoint_t *ep, ...@@ -2625,7 +2627,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const sctp_endpoint_t *ep,
* processing the rest of the chunks in the packet. * processing the rest of the chunks in the packet.
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_NO_DATA)); SCTP_U32(SCTP_ERROR_NO_DATA));
SCTP_INC_STATS(SctpAborteds); SCTP_INC_STATS(SctpAborteds);
SCTP_DEC_STATS(SctpCurrEstab); SCTP_DEC_STATS(SctpCurrEstab);
...@@ -2712,8 +2714,8 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const sctp_endpoint_t *ep, ...@@ -2712,8 +2714,8 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_eat_sack_6_2(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2773,8 +2775,8 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const sctp_endpoint_t *ep, ...@@ -2773,8 +2775,8 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_tabort_8_4_8(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2819,8 +2821,8 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const sctp_endpoint_t *ep, ...@@ -2819,8 +2821,8 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_operr_notify(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2856,8 +2858,8 @@ sctp_disposition_t sctp_sf_operr_notify(const sctp_endpoint_t *ep, ...@@ -2856,8 +2858,8 @@ sctp_disposition_t sctp_sf_operr_notify(const sctp_endpoint_t *ep,
* *
* The return value is the disposition. * The return value is the disposition.
*/ */
sctp_disposition_t sctp_sf_do_9_2_final(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2924,8 +2926,8 @@ sctp_disposition_t sctp_sf_do_9_2_final(const sctp_endpoint_t *ep, ...@@ -2924,8 +2926,8 @@ sctp_disposition_t sctp_sf_do_9_2_final(const sctp_endpoint_t *ep,
* TCB was found. After sending this ABORT, the receiver of the OOTB * TCB was found. After sending this ABORT, the receiver of the OOTB
* packet shall discard the OOTB packet and take no further action. * packet shall discard the OOTB packet and take no further action.
*/ */
sctp_disposition_t sctp_sf_ootb(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -2975,8 +2977,8 @@ sctp_disposition_t sctp_sf_ootb(const sctp_endpoint_t *ep, ...@@ -2975,8 +2977,8 @@ sctp_disposition_t sctp_sf_ootb(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_shut_8_4_5(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3024,8 +3026,8 @@ sctp_disposition_t sctp_sf_shut_8_4_5(const sctp_endpoint_t *ep, ...@@ -3024,8 +3026,8 @@ sctp_disposition_t sctp_sf_shut_8_4_5(const sctp_endpoint_t *ep,
* chunks. --piggy ] * chunks. --piggy ]
* *
*/ */
sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3061,8 +3063,8 @@ sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const sctp_endpoint_t *ep, ...@@ -3061,8 +3063,8 @@ sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_unk_chunk(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3140,8 +3142,8 @@ sctp_disposition_t sctp_sf_unk_chunk(const sctp_endpoint_t *ep, ...@@ -3140,8 +3142,8 @@ sctp_disposition_t sctp_sf_unk_chunk(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_discard_chunk(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_discard_chunk(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3169,8 +3171,8 @@ sctp_disposition_t sctp_sf_discard_chunk(const sctp_endpoint_t *ep, ...@@ -3169,8 +3171,8 @@ sctp_disposition_t sctp_sf_discard_chunk(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_pdiscard(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_pdiscard(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3198,8 +3200,8 @@ sctp_disposition_t sctp_sf_pdiscard(const sctp_endpoint_t *ep, ...@@ -3198,8 +3200,8 @@ sctp_disposition_t sctp_sf_pdiscard(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t lucky(const sctp_endpoint_t *ep, sctp_disposition_t lucky(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3235,8 +3237,8 @@ sctp_disposition_t lucky(const sctp_endpoint_t *ep, ...@@ -3235,8 +3237,8 @@ sctp_disposition_t lucky(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t other_stupid(const sctp_endpoint_t *ep, sctp_disposition_t other_stupid(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3271,8 +3273,8 @@ sctp_disposition_t other_stupid(const sctp_endpoint_t *ep, ...@@ -3271,8 +3273,8 @@ sctp_disposition_t other_stupid(const sctp_endpoint_t *ep,
* We simply tag the chunk as a violation. The state machine will log * We simply tag the chunk as a violation. The state machine will log
* the violation and continue. * the violation and continue.
*/ */
sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_violation(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3309,7 +3311,7 @@ sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep, ...@@ -3309,7 +3311,7 @@ sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep,
* will be returned on successful establishment of the association. If * will be returned on successful establishment of the association. If
* SCTP is not able to open an SCTP association with the peer endpoint, * SCTP is not able to open an SCTP association with the peer endpoint,
* an error is returned. * an error is returned.
* [In the kernel implementation, the sctp_association_t needs to * [In the kernel implementation, the struct sctp_association needs to
* be created BEFORE causing this primitive to run.] * be created BEFORE causing this primitive to run.]
* *
* Other association parameters may be returned, including the * Other association parameters may be returned, including the
...@@ -3340,8 +3342,8 @@ sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep, ...@@ -3340,8 +3342,8 @@ sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep,
* *
* The return value is a disposition. * The return value is a disposition.
*/ */
sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3371,7 +3373,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep, ...@@ -3371,7 +3373,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep,
* rerun it through as a sideffect. * rerun it through as a sideffect.
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC,
SCTP_ASOC((sctp_association_t *) asoc)); SCTP_ASOC((struct sctp_association *) asoc));
/* After sending the INIT, "A" starts the T1-init timer and /* After sending the INIT, "A" starts the T1-init timer and
* enters the COOKIE-WAIT state. * enters the COOKIE-WAIT state.
...@@ -3446,8 +3448,8 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep, ...@@ -3446,8 +3448,8 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep,
* *
* The return value is the disposition. * The return value is the disposition.
*/ */
sctp_disposition_t sctp_sf_do_prm_send(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_prm_send(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3484,11 +3486,12 @@ sctp_disposition_t sctp_sf_do_prm_send(const sctp_endpoint_t *ep, ...@@ -3484,11 +3486,12 @@ sctp_disposition_t sctp_sf_do_prm_send(const sctp_endpoint_t *ep,
* *
* The return value is the disposition. * The return value is the disposition.
*/ */
sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
int disposition; int disposition;
...@@ -3545,11 +3548,12 @@ sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(const sctp_endpoint_t *ep, ...@@ -3545,11 +3548,12 @@ sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(const sctp_endpoint_t *ep,
* *
* The return value is the disposition. * The return value is the disposition.
*/ */
sctp_disposition_t sctp_sf_do_9_1_prm_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_1_prm_abort(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
/* From 9.1 Abort of an Association /* From 9.1 Abort of an Association
* Upon receipt of the ABORT primitive from its upper * Upon receipt of the ABORT primitive from its upper
...@@ -3577,7 +3581,7 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(const sctp_endpoint_t *ep, ...@@ -3577,7 +3581,7 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(const sctp_endpoint_t *ep,
*/ */
/* Delete the established association. */ /* Delete the established association. */
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_USER_ABORT)); SCTP_U32(SCTP_ERROR_USER_ABORT));
SCTP_INC_STATS(SctpAborteds); SCTP_INC_STATS(SctpAborteds);
...@@ -3587,8 +3591,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(const sctp_endpoint_t *ep, ...@@ -3587,8 +3591,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(const sctp_endpoint_t *ep,
} }
/* We tried an illegal operation on an association which is closed. */ /* We tried an illegal operation on an association which is closed. */
sctp_disposition_t sctp_sf_error_closed(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_error_closed(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3600,8 +3604,8 @@ sctp_disposition_t sctp_sf_error_closed(const sctp_endpoint_t *ep, ...@@ -3600,8 +3604,8 @@ sctp_disposition_t sctp_sf_error_closed(const sctp_endpoint_t *ep,
/* We tried an illegal operation on an association which is shutting /* We tried an illegal operation on an association which is shutting
* down. * down.
*/ */
sctp_disposition_t sctp_sf_error_shutdown(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_error_shutdown(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3626,8 +3630,8 @@ sctp_disposition_t sctp_sf_error_shutdown(const sctp_endpoint_t *ep, ...@@ -3626,8 +3630,8 @@ sctp_disposition_t sctp_sf_error_shutdown(const sctp_endpoint_t *ep,
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown( sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3660,8 +3664,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown( ...@@ -3660,8 +3664,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown(
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_cookie_echoed_prm_shutdown( sctp_disposition_t sctp_sf_cookie_echoed_prm_shutdown(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, sctp_cmd_seq_t *commands) void *arg, sctp_cmd_seq_t *commands)
{ {
...@@ -3685,11 +3689,12 @@ sctp_disposition_t sctp_sf_cookie_echoed_prm_shutdown( ...@@ -3685,11 +3689,12 @@ sctp_disposition_t sctp_sf_cookie_echoed_prm_shutdown(
* Outputs * Outputs
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_cookie_wait_prm_abort(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
struct msghdr *msg = arg; struct msghdr *msg = arg;
sctp_chunk_t *abort; sctp_chunk_t *abort;
...@@ -3717,7 +3722,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep, ...@@ -3717,7 +3722,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep,
*/ */
/* Delete the established association. */ /* Delete the established association. */
sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
SCTP_U32(SCTP_ERROR_USER_ABORT)); SCTP_U32(SCTP_ERROR_USER_ABORT));
return retval; return retval;
...@@ -3737,11 +3742,12 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep, ...@@ -3737,11 +3742,12 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep,
* Outputs * Outputs
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
/* There is a single T1 timer, so we should be able to use /* There is a single T1 timer, so we should be able to use
* common function with the COOKIE-WAIT state. * common function with the COOKIE-WAIT state.
...@@ -3762,8 +3768,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(const sctp_endpoint_t *ep, ...@@ -3762,8 +3768,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(const sctp_endpoint_t *ep,
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_shutdown_pending_prm_abort( sctp_disposition_t sctp_sf_shutdown_pending_prm_abort(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3788,8 +3794,8 @@ sctp_disposition_t sctp_sf_shutdown_pending_prm_abort( ...@@ -3788,8 +3794,8 @@ sctp_disposition_t sctp_sf_shutdown_pending_prm_abort(
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_shutdown_sent_prm_abort( sctp_disposition_t sctp_sf_shutdown_sent_prm_abort(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3818,8 +3824,8 @@ sctp_disposition_t sctp_sf_shutdown_sent_prm_abort( ...@@ -3818,8 +3824,8 @@ sctp_disposition_t sctp_sf_shutdown_sent_prm_abort(
* (timers) * (timers)
*/ */
sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort( sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3853,8 +3859,8 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort( ...@@ -3853,8 +3859,8 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort(
* association on which a heartbeat should be issued. * association on which a heartbeat should be issued.
*/ */
sctp_disposition_t sctp_sf_do_prm_requestheartbeat( sctp_disposition_t sctp_sf_do_prm_requestheartbeat(
const sctp_endpoint_t *ep, const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -3868,11 +3874,12 @@ sctp_disposition_t sctp_sf_do_prm_requestheartbeat( ...@@ -3868,11 +3874,12 @@ sctp_disposition_t sctp_sf_do_prm_requestheartbeat(
* *
* The return value is the disposition of the primitive. * The return value is the disposition of the primitive.
*/ */
sctp_disposition_t sctp_sf_ignore_primitive(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_ignore_primitive(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
SCTP_DEBUG_PRINTK("Primitive type %d is ignored.\n", type.primitive); SCTP_DEBUG_PRINTK("Primitive type %d is ignored.\n", type.primitive);
return SCTP_DISPOSITION_DISCARD; return SCTP_DISPOSITION_DISCARD;
...@@ -3895,11 +3902,12 @@ sctp_disposition_t sctp_sf_ignore_primitive(const sctp_endpoint_t *ep, ...@@ -3895,11 +3902,12 @@ sctp_disposition_t sctp_sf_ignore_primitive(const sctp_endpoint_t *ep,
* *
* The return value is the disposition. * The return value is the disposition.
*/ */
sctp_disposition_t sctp_sf_do_9_2_start_shutdown(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_2_start_shutdown(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *reply; sctp_chunk_t *reply;
...@@ -3956,11 +3964,12 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown(const sctp_endpoint_t *ep, ...@@ -3956,11 +3964,12 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown(const sctp_endpoint_t *ep,
* *
* The return value is the disposition. * The return value is the disposition.
*/ */
sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = (sctp_chunk_t *) arg; sctp_chunk_t *chunk = (sctp_chunk_t *) arg;
sctp_chunk_t *reply; sctp_chunk_t *reply;
...@@ -4009,8 +4018,8 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(const sctp_endpoint_t *ep, ...@@ -4009,8 +4018,8 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the event. * The return value is the disposition of the event.
*/ */
sctp_disposition_t sctp_sf_ignore_other(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_ignore_other(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4034,8 +4043,8 @@ sctp_disposition_t sctp_sf_ignore_other(const sctp_endpoint_t *ep, ...@@ -4034,8 +4043,8 @@ sctp_disposition_t sctp_sf_ignore_other(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_do_6_3_3_rtx(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4044,7 +4053,7 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const sctp_endpoint_t *ep, ...@@ -4044,7 +4053,7 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const sctp_endpoint_t *ep,
if (asoc->overall_error_count >= asoc->overall_error_threshold) { if (asoc->overall_error_count >= asoc->overall_error_threshold) {
/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_NO_ERROR)); SCTP_U32(SCTP_ERROR_NO_ERROR));
SCTP_INC_STATS(SctpAborteds); SCTP_INC_STATS(SctpAborteds);
SCTP_DEC_STATS(SctpCurrEstab); SCTP_DEC_STATS(SctpCurrEstab);
...@@ -4102,8 +4111,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const sctp_endpoint_t *ep, ...@@ -4102,8 +4111,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const sctp_endpoint_t *ep,
* allow. However, an SCTP transmitter MUST NOT be more aggressive than * allow. However, an SCTP transmitter MUST NOT be more aggressive than
* the following algorithms allow. * the following algorithms allow.
*/ */
sctp_disposition_t sctp_sf_do_6_2_sack(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_do_6_2_sack(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4137,8 +4146,8 @@ sctp_disposition_t sctp_sf_do_6_2_sack(const sctp_endpoint_t *ep, ...@@ -4137,8 +4146,8 @@ sctp_disposition_t sctp_sf_do_6_2_sack(const sctp_endpoint_t *ep,
* (timers, events) * (timers, events)
* *
*/ */
sctp_disposition_t sctp_sf_t1_timer_expire(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_t1_timer_expire(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4180,7 +4189,7 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const sctp_endpoint_t *ep, ...@@ -4180,7 +4189,7 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const sctp_endpoint_t *ep,
SCTP_TO(timer)); SCTP_TO(timer));
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
} else { } else {
sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
SCTP_U32(SCTP_ERROR_NO_ERROR)); SCTP_U32(SCTP_ERROR_NO_ERROR));
return SCTP_DISPOSITION_DELETE_TCB; return SCTP_DISPOSITION_DELETE_TCB;
} }
...@@ -4204,8 +4213,8 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const sctp_endpoint_t *ep, ...@@ -4204,8 +4213,8 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const sctp_endpoint_t *ep,
* the T2-Shutdown timer, giving its peer ample opportunity to transmit * the T2-Shutdown timer, giving its peer ample opportunity to transmit
* all of its queued DATA chunks that have not yet been sent. * all of its queued DATA chunks that have not yet been sent.
*/ */
sctp_disposition_t sctp_sf_t2_timer_expire(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4215,7 +4224,7 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const sctp_endpoint_t *ep, ...@@ -4215,7 +4224,7 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const sctp_endpoint_t *ep,
SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); SCTP_DEBUG_PRINTK("Timer T2 expired.\n");
if (asoc->overall_error_count >= asoc->overall_error_threshold) { if (asoc->overall_error_count >= asoc->overall_error_threshold) {
/* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_NO_ERROR)); SCTP_U32(SCTP_ERROR_NO_ERROR));
SCTP_INC_STATS(SctpAborteds); SCTP_INC_STATS(SctpAborteds);
SCTP_DEC_STATS(SctpCurrEstab); SCTP_DEC_STATS(SctpCurrEstab);
...@@ -4264,8 +4273,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const sctp_endpoint_t *ep, ...@@ -4264,8 +4273,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const sctp_endpoint_t *ep,
* At the expiration of this timer the sender SHOULD abort the association * At the expiration of this timer the sender SHOULD abort the association
* by sending an ABORT chunk. * by sending an ABORT chunk.
*/ */
sctp_disposition_t sctp_sf_t5_timer_expire(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4279,7 +4288,7 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const sctp_endpoint_t *ep, ...@@ -4279,7 +4288,7 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const sctp_endpoint_t *ep,
goto nomem; goto nomem;
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
SCTP_U32(SCTP_ERROR_NO_ERROR)); SCTP_U32(SCTP_ERROR_NO_ERROR));
return SCTP_DISPOSITION_DELETE_TCB; return SCTP_DISPOSITION_DELETE_TCB;
...@@ -4292,11 +4301,12 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const sctp_endpoint_t *ep, ...@@ -4292,11 +4301,12 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const sctp_endpoint_t *ep,
* The work that needs to be done is same as when SHUTDOWN is initiated by * The work that needs to be done is same as when SHUTDOWN is initiated by
* the user. So this routine looks same as sctp_sf_do_9_2_prm_shutdown(). * the user. So this routine looks same as sctp_sf_do_9_2_prm_shutdown().
*/ */
sctp_disposition_t sctp_sf_autoclose_timer_expire(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_autoclose_timer_expire(
const sctp_association_t *asoc, const struct sctp_endpoint *ep,
const sctp_subtype_t type, const struct sctp_association *asoc,
void *arg, const sctp_subtype_t type,
sctp_cmd_seq_t *commands) void *arg,
sctp_cmd_seq_t *commands)
{ {
int disposition; int disposition;
...@@ -4337,8 +4347,8 @@ sctp_disposition_t sctp_sf_autoclose_timer_expire(const sctp_endpoint_t *ep, ...@@ -4337,8 +4347,8 @@ sctp_disposition_t sctp_sf_autoclose_timer_expire(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_not_impl(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_not_impl(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4354,8 +4364,8 @@ sctp_disposition_t sctp_sf_not_impl(const sctp_endpoint_t *ep, ...@@ -4354,8 +4364,8 @@ sctp_disposition_t sctp_sf_not_impl(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_bug(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_bug(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4374,8 +4384,8 @@ sctp_disposition_t sctp_sf_bug(const sctp_endpoint_t *ep, ...@@ -4374,8 +4384,8 @@ sctp_disposition_t sctp_sf_bug(const sctp_endpoint_t *ep,
* *
* The return value is the disposition of the chunk. * The return value is the disposition of the chunk.
*/ */
sctp_disposition_t sctp_sf_timer_ignore(const sctp_endpoint_t *ep, sctp_disposition_t sctp_sf_timer_ignore(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_subtype_t type, const sctp_subtype_t type,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
...@@ -4411,8 +4421,8 @@ sctp_sackhdr_t *sctp_sm_pull_sack(sctp_chunk_t *chunk) ...@@ -4411,8 +4421,8 @@ sctp_sackhdr_t *sctp_sm_pull_sack(sctp_chunk_t *chunk)
/* Create an ABORT packet to be sent as a response, with the specified /* Create an ABORT packet to be sent as a response, with the specified
* error causes. * error causes.
*/ */
struct sctp_packet *sctp_abort_pkt_new(const sctp_endpoint_t *ep, struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, sctp_chunk_t *chunk,
const void *payload, const void *payload,
size_t paylen) size_t paylen)
...@@ -4447,7 +4457,7 @@ struct sctp_packet *sctp_abort_pkt_new(const sctp_endpoint_t *ep, ...@@ -4447,7 +4457,7 @@ struct sctp_packet *sctp_abort_pkt_new(const sctp_endpoint_t *ep,
} }
/* Allocate a packet for responding in the OOTB conditions. */ /* Allocate a packet for responding in the OOTB conditions. */
struct sctp_packet *sctp_ootb_pkt_new(const sctp_association_t *asoc, struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc,
const sctp_chunk_t *chunk) const sctp_chunk_t *chunk)
{ {
struct sctp_packet *packet; struct sctp_packet *packet;
...@@ -4512,8 +4522,8 @@ void sctp_ootb_pkt_free(struct sctp_packet *packet) ...@@ -4512,8 +4522,8 @@ void sctp_ootb_pkt_free(struct sctp_packet *packet)
} }
/* Send a stale cookie error when a invalid COOKIE ECHO chunk is found */ /* Send a stale cookie error when a invalid COOKIE ECHO chunk is found */
void sctp_send_stale_cookie_err(const sctp_endpoint_t *ep, void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const sctp_association_t *asoc, const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_chunk_t *err_chunk) sctp_chunk_t *err_chunk)
......
...@@ -111,17 +111,18 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id) ...@@ -111,17 +111,18 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id)
if (SCTP_SOCKET_UDP != sctp_sk(sk)->type) { if (SCTP_SOCKET_UDP != sctp_sk(sk)->type) {
if (!list_empty(&sctp_sk(sk)->ep->asocs)) if (!list_empty(&sctp_sk(sk)->ep->asocs))
asoc = list_entry(sctp_sk(sk)->ep->asocs.next, asoc = list_entry(sctp_sk(sk)->ep->asocs.next,
sctp_association_t, asocs); struct sctp_association, asocs);
return asoc; return asoc;
} }
/* First, verify that this is a kernel address. */ /* First, verify that this is a kernel address. */
if (sctp_is_valid_kaddr((unsigned long) id)) { if (sctp_is_valid_kaddr((unsigned long) id)) {
struct sctp_association *temp = (sctp_association_t *) id; struct sctp_association *temp;
/* Verify that this _is_ an sctp_association /* Verify that this _is_ an sctp_association
* data structure and if so, that the socket matches. * data structure and if so, that the socket matches.
*/ */
temp = (struct sctp_association *)id;
if ((SCTP_ASSOC_EYECATCHER == temp->eyecatcher) && if ((SCTP_ASSOC_EYECATCHER == temp->eyecatcher) &&
(temp->base.sk == sk)) (temp->base.sk == sk))
asoc = temp; asoc = temp;
...@@ -193,7 +194,7 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, ...@@ -193,7 +194,7 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt,
SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_opt *sp = sctp_sk(sk);
sctp_endpoint_t *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
sctp_bind_addr_t *bp = &ep->base.bind_addr; sctp_bind_addr_t *bp = &ep->base.bind_addr;
struct sctp_af *af; struct sctp_af *af;
unsigned short snum; unsigned short snum;
...@@ -450,12 +451,12 @@ int sctp_bindx_add(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt) ...@@ -450,12 +451,12 @@ int sctp_bindx_add(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt)
/* Add these addresses to all associations on this endpoint. */ /* Add these addresses to all associations on this endpoint. */
if (retval >= 0) { if (retval >= 0) {
struct list_head *pos; struct list_head *pos;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *asoc; struct sctp_association *asoc;
ep = sctp_sk(sk)->ep; ep = sctp_sk(sk)->ep;
list_for_each(pos, &ep->asocs) { list_for_each(pos, &ep->asocs) {
asoc = list_entry(pos, sctp_association_t, asocs); asoc = list_entry(pos, struct sctp_association, asocs);
sctp_addip_addr_config(asoc, sctp_addip_addr_config(asoc,
SCTP_PARAM_ADD_IP, SCTP_PARAM_ADD_IP,
...@@ -485,7 +486,7 @@ int sctp_bindx_add(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt) ...@@ -485,7 +486,7 @@ int sctp_bindx_add(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt)
int sctp_bindx_rem(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt) int sctp_bindx_rem(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_opt *sp = sctp_sk(sk);
sctp_endpoint_t *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
int cnt; int cnt;
sctp_bind_addr_t *bp = &ep->base.bind_addr; sctp_bind_addr_t *bp = &ep->base.bind_addr;
int retval = 0; int retval = 0;
...@@ -570,12 +571,12 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt) ...@@ -570,12 +571,12 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt)
/* Remove these addresses from all associations on this endpoint. */ /* Remove these addresses from all associations on this endpoint. */
if (retval >= 0) { if (retval >= 0) {
struct list_head *pos; struct list_head *pos;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *asoc; struct sctp_association *asoc;
ep = sctp_sk(sk)->ep; ep = sctp_sk(sk)->ep;
list_for_each(pos, &ep->asocs) { list_for_each(pos, &ep->asocs) {
asoc = list_entry(pos, sctp_association_t, asocs); asoc = list_entry(pos, struct sctp_association, asocs);
sctp_addip_addr_config(asoc, SCTP_PARAM_DEL_IP, sctp_addip_addr_config(asoc, SCTP_PARAM_DEL_IP,
addrs, addrcnt); addrs, addrcnt);
} }
...@@ -673,8 +674,8 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, ...@@ -673,8 +674,8 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
*/ */
SCTP_STATIC void sctp_close(struct sock *sk, long timeout) SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
{ {
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *asoc; struct sctp_association *asoc;
struct list_head *pos, *temp; struct list_head *pos, *temp;
SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p...)\n", sk); SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p...)\n", sk);
...@@ -686,7 +687,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) ...@@ -686,7 +687,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
/* Walk all associations on a socket, not on an endpoint. */ /* Walk all associations on a socket, not on an endpoint. */
list_for_each_safe(pos, temp, &ep->asocs) { list_for_each_safe(pos, temp, &ep->asocs) {
asoc = list_entry(pos, sctp_association_t, asocs); asoc = list_entry(pos, struct sctp_association, asocs);
sctp_primitive_SHUTDOWN(asoc, NULL); sctp_primitive_SHUTDOWN(asoc, NULL);
} }
...@@ -746,8 +747,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -746,8 +747,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, int msg_len) struct msghdr *msg, int msg_len)
{ {
struct sctp_opt *sp; struct sctp_opt *sp;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *new_asoc=NULL, *asoc=NULL; struct sctp_association *new_asoc=NULL, *asoc=NULL;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *chunk = NULL; sctp_chunk_t *chunk = NULL;
union sctp_addr to; union sctp_addr to;
...@@ -1275,7 +1276,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, ...@@ -1275,7 +1276,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
char *optval, int optlen) char *optval, int optlen)
{ {
struct sctp_paddrparams params; struct sctp_paddrparams params;
sctp_association_t *asoc; struct sctp_association *asoc;
union sctp_addr *addr; union sctp_addr *addr;
struct sctp_transport *trans; struct sctp_transport *trans;
int error; int error;
...@@ -1357,7 +1358,7 @@ static int sctp_setsockopt_default_send_param(struct sock *sk, ...@@ -1357,7 +1358,7 @@ static int sctp_setsockopt_default_send_param(struct sock *sk,
char *optval, int optlen) char *optval, int optlen)
{ {
struct sctp_sndrcvinfo info; struct sctp_sndrcvinfo info;
sctp_association_t *asoc; struct sctp_association *asoc;
if (optlen != sizeof(struct sctp_sndrcvinfo)) if (optlen != sizeof(struct sctp_sndrcvinfo))
return -EINVAL; return -EINVAL;
...@@ -1569,8 +1570,8 @@ SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *uaddr, ...@@ -1569,8 +1570,8 @@ SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len) int addr_len)
{ {
struct sctp_opt *sp; struct sctp_opt *sp;
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
sctp_association_t *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
union sctp_addr to; union sctp_addr to;
sctp_scope_t scope; sctp_scope_t scope;
...@@ -1746,7 +1747,7 @@ SCTP_STATIC int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -1746,7 +1747,7 @@ SCTP_STATIC int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg)
*/ */
SCTP_STATIC int sctp_init_sock(struct sock *sk) SCTP_STATIC int sctp_init_sock(struct sock *sk)
{ {
sctp_endpoint_t *ep; struct sctp_endpoint *ep;
struct sctp_protocol *proto; struct sctp_protocol *proto;
struct sctp_opt *sp; struct sctp_opt *sp;
...@@ -1992,7 +1993,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, ...@@ -1992,7 +1993,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc,
return err; return err;
/* Populate the fields of the newsk from the oldsk and migrate the /* Populate the fields of the newsk from the oldsk and migrate the
* assoc to the newsk. * asoc to the newsk.
*/ */
sctp_sock_migrate(sk, sock->sk, asoc, SCTP_SOCKET_UDP_HIGH_BANDWIDTH); sctp_sock_migrate(sk, sock->sk, asoc, SCTP_SOCKET_UDP_HIGH_BANDWIDTH);
*sockp = sock; *sockp = sock;
...@@ -2005,22 +2006,22 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int * ...@@ -2005,22 +2006,22 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int *
sctp_peeloff_arg_t peeloff; sctp_peeloff_arg_t peeloff;
struct socket *newsock; struct socket *newsock;
int retval = 0; int retval = 0;
sctp_association_t *assoc; struct sctp_association *asoc;
if (len != sizeof(sctp_peeloff_arg_t)) if (len != sizeof(sctp_peeloff_arg_t))
return -EINVAL; return -EINVAL;
if (copy_from_user(&peeloff, optval, len)) if (copy_from_user(&peeloff, optval, len))
return -EFAULT; return -EFAULT;
assoc = sctp_id2assoc(sk, peeloff.associd); asoc = sctp_id2assoc(sk, peeloff.associd);
if (!assoc) { if (!asoc) {
retval = -EINVAL; retval = -EINVAL;
goto out; goto out;
} }
SCTP_DEBUG_PRINTK("%s: sk: %p assoc: %p\n", __FUNCTION__, sk, assoc); SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p\n", __FUNCTION__, sk, asoc);
retval = sctp_do_peeloff(assoc, &newsock); retval = sctp_do_peeloff(asoc, &newsock);
if (retval < 0) if (retval < 0)
goto out; goto out;
...@@ -2031,8 +2032,8 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int * ...@@ -2031,8 +2032,8 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int *
goto out; goto out;
} }
SCTP_DEBUG_PRINTK("%s: sk: %p assoc: %p newsk: %p sd: %d\n", SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p newsk: %p sd: %d\n",
__FUNCTION__, sk, assoc, newsock->sk, retval); __FUNCTION__, sk, asoc, newsock->sk, retval);
/* Return the fd mapped to the new socket. */ /* Return the fd mapped to the new socket. */
peeloff.sd = retval; peeloff.sd = retval;
...@@ -2047,7 +2048,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, ...@@ -2047,7 +2048,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
char *optval, int *optlen) char *optval, int *optlen)
{ {
struct sctp_paddrparams params; struct sctp_paddrparams params;
sctp_association_t *asoc; struct sctp_association *asoc;
union sctp_addr *addr; union sctp_addr *addr;
struct sctp_transport *trans; struct sctp_transport *trans;
...@@ -2100,7 +2101,7 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len, ...@@ -2100,7 +2101,7 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len,
char *optval, int *optlen) char *optval, int *optlen)
{ {
sctp_assoc_t id; sctp_assoc_t id;
sctp_association_t *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
int cnt = 0; int cnt = 0;
...@@ -2129,7 +2130,7 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len, ...@@ -2129,7 +2130,7 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len,
static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
char *optval, int *optlen) char *optval, int *optlen)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
int cnt = 0; int cnt = 0;
struct sctp_getaddrs getaddrs; struct sctp_getaddrs getaddrs;
...@@ -2171,7 +2172,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len, ...@@ -2171,7 +2172,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
{ {
sctp_assoc_t id; sctp_assoc_t id;
sctp_bind_addr_t *bp; sctp_bind_addr_t *bp;
sctp_association_t *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
int cnt = 0; int cnt = 0;
...@@ -2209,7 +2210,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, ...@@ -2209,7 +2210,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
char *optval, int *optlen) char *optval, int *optlen)
{ {
sctp_bind_addr_t *bp; sctp_bind_addr_t *bp;
sctp_association_t *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
int cnt = 0; int cnt = 0;
struct sctp_getaddrs getaddrs; struct sctp_getaddrs getaddrs;
...@@ -2311,7 +2312,7 @@ static int sctp_getsockopt_default_send_param(struct sock *sk, ...@@ -2311,7 +2312,7 @@ static int sctp_getsockopt_default_send_param(struct sock *sk,
int len, char *optval, int *optlen) int len, char *optval, int *optlen)
{ {
struct sctp_sndrcvinfo info; struct sctp_sndrcvinfo info;
sctp_association_t *asoc; struct sctp_association *asoc;
if (len != sizeof(struct sctp_sndrcvinfo)) if (len != sizeof(struct sctp_sndrcvinfo))
return -EINVAL; return -EINVAL;
...@@ -2572,7 +2573,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr) ...@@ -2572,7 +2573,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
* in an endpoint. * in an endpoint.
*/ */
for ( ; sk2 != NULL; sk2 = sk2->bind_next) { for ( ; sk2 != NULL; sk2 = sk2->bind_next) {
sctp_endpoint_t *ep2; struct sctp_endpoint *ep2;
ep2 = sctp_sk(sk2)->ep; ep2 = sctp_sk(sk2)->ep;
if (sk_reuse && sk2->reuse) if (sk_reuse && sk2->reuse)
...@@ -2662,7 +2663,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum) ...@@ -2662,7 +2663,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum)
SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog) SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_opt *sp = sctp_sk(sk);
sctp_endpoint_t *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
/* Only UDP style sockets that are not peeled off are allowed to /* Only UDP style sockets that are not peeled off are allowed to
* listen(). * listen().
...@@ -2701,7 +2702,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog) ...@@ -2701,7 +2702,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog) SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_opt *sp = sctp_sk(sk);
sctp_endpoint_t *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
if (sk->state == SCTP_SS_LISTENING) if (sk->state == SCTP_SS_LISTENING)
return 0; return 0;
...@@ -2770,7 +2771,7 @@ int sctp_inet_listen(struct socket *sock, int backlog) ...@@ -2770,7 +2771,7 @@ int sctp_inet_listen(struct socket *sock, int backlog)
out: out:
sctp_release_sock(sk); sctp_release_sock(sk);
return err; return err;
cleanup: cleanup:
if (tfm) if (tfm)
sctp_crypto_free_tfm(tfm); sctp_crypto_free_tfm(tfm);
goto out; goto out;
...@@ -3173,7 +3174,7 @@ static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr, ...@@ -3173,7 +3174,7 @@ static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr,
} }
/* Get the sndbuf space available at the time on the association. */ /* Get the sndbuf space available at the time on the association. */
static inline int sctp_wspace(sctp_association_t *asoc) static inline int sctp_wspace(struct sctp_association *asoc)
{ {
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
int amt = 0; int amt = 0;
...@@ -3195,7 +3196,7 @@ static inline int sctp_wspace(sctp_association_t *asoc) ...@@ -3195,7 +3196,7 @@ static inline int sctp_wspace(sctp_association_t *asoc)
*/ */
static inline void sctp_set_owner_w(sctp_chunk_t *chunk) static inline void sctp_set_owner_w(sctp_chunk_t *chunk)
{ {
sctp_association_t *asoc = chunk->asoc; struct sctp_association *asoc = chunk->asoc;
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
/* The sndbuf space is tracked per association. */ /* The sndbuf space is tracked per association. */
...@@ -3210,7 +3211,7 @@ static inline void sctp_set_owner_w(sctp_chunk_t *chunk) ...@@ -3210,7 +3211,7 @@ static inline void sctp_set_owner_w(sctp_chunk_t *chunk)
} }
/* If sndbuf has changed, wake up per association sndbuf waiters. */ /* If sndbuf has changed, wake up per association sndbuf waiters. */
static void __sctp_write_space(sctp_association_t *asoc) static void __sctp_write_space(struct sctp_association *asoc)
{ {
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
struct socket *sock = sk->socket; struct socket *sock = sk->socket;
...@@ -3240,7 +3241,7 @@ static void __sctp_write_space(sctp_association_t *asoc) ...@@ -3240,7 +3241,7 @@ static void __sctp_write_space(sctp_association_t *asoc)
*/ */
static void sctp_wfree(struct sk_buff *skb) static void sctp_wfree(struct sk_buff *skb)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
sctp_chunk_t *chunk; sctp_chunk_t *chunk;
struct sock *sk; struct sock *sk;
...@@ -3256,7 +3257,7 @@ static void sctp_wfree(struct sk_buff *skb) ...@@ -3256,7 +3257,7 @@ static void sctp_wfree(struct sk_buff *skb)
} }
/* Helper function to wait for space in the sndbuf. */ /* Helper function to wait for space in the sndbuf. */
static int sctp_wait_for_sndbuf(sctp_association_t *asoc, long *timeo_p, static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
int msg_len) int msg_len)
{ {
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
...@@ -3319,12 +3320,12 @@ static int sctp_wait_for_sndbuf(sctp_association_t *asoc, long *timeo_p, ...@@ -3319,12 +3320,12 @@ static int sctp_wait_for_sndbuf(sctp_association_t *asoc, long *timeo_p,
/* If socket sndbuf has changed, wake up all per association waiters. */ /* If socket sndbuf has changed, wake up all per association waiters. */
void sctp_write_space(struct sock *sk) void sctp_write_space(struct sock *sk)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
/* Wake up the tasks in each wait queue. */ /* Wake up the tasks in each wait queue. */
list_for_each(pos, &((sctp_sk(sk))->ep->asocs)) { list_for_each(pos, &((sctp_sk(sk))->ep->asocs)) {
asoc = list_entry(pos, sctp_association_t, asocs); asoc = list_entry(pos, struct sctp_association, asocs);
__sctp_write_space(asoc); __sctp_write_space(asoc);
} }
} }
...@@ -3353,7 +3354,7 @@ static int sctp_writeable(struct sock *sk) ...@@ -3353,7 +3354,7 @@ static int sctp_writeable(struct sock *sk)
/* Wait for an association to go into ESTABLISHED state. If timeout is 0, /* Wait for an association to go into ESTABLISHED state. If timeout is 0,
* returns immediately with EINPROGRESS. * returns immediately with EINPROGRESS.
*/ */
static int sctp_wait_for_connect(sctp_association_t *asoc, long *timeo_p) static int sctp_wait_for_connect(struct sctp_association *asoc, long *timeo_p)
{ {
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
int err = 0; int err = 0;
...@@ -3464,7 +3465,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, ...@@ -3464,7 +3465,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
{ {
struct sctp_opt *oldsp = sctp_sk(oldsk); struct sctp_opt *oldsp = sctp_sk(oldsk);
struct sctp_opt *newsp = sctp_sk(newsk); struct sctp_opt *newsp = sctp_sk(newsk);
sctp_endpoint_t *newep = newsp->ep; struct sctp_endpoint *newep = newsp->ep;
struct sk_buff *skb, *tmp; struct sk_buff *skb, *tmp;
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
......
...@@ -53,11 +53,11 @@ static inline size_t sctp_ssnmap_size(__u16 in, __u16 out) ...@@ -53,11 +53,11 @@ static inline size_t sctp_ssnmap_size(__u16 in, __u16 out)
/* Create a new sctp_ssnmap. /* Create a new sctp_ssnmap.
* Allocate room to store at least 'len' contiguous TSNs. * Allocate room to store at least 'len' contiguous TSNs.
*/ */
struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int priority) struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp)
{ {
struct sctp_ssnmap *retval; struct sctp_ssnmap *retval;
retval = kmalloc(sctp_ssnmap_size(in, out), priority); retval = kmalloc(sctp_ssnmap_size(in, out), gfp);
if (!retval) if (!retval)
goto fail; goto fail;
......
...@@ -54,16 +54,15 @@ ...@@ -54,16 +54,15 @@
/* 1st Level Abstractions. */ /* 1st Level Abstractions. */
/* Allocate and initialize a new transport. */ /* Allocate and initialize a new transport. */
struct sctp_transport *sctp_transport_new(const union sctp_addr *addr, struct sctp_transport *sctp_transport_new(const union sctp_addr *addr, int gfp)
int priority)
{ {
struct sctp_transport *transport; struct sctp_transport *transport;
transport = t_new(struct sctp_transport, priority); transport = t_new(struct sctp_transport, gfp);
if (!transport) if (!transport)
goto fail; goto fail;
if (!sctp_transport_init(transport, addr, priority)) if (!sctp_transport_init(transport, addr, gfp))
goto fail_init; goto fail_init;
transport->malloced = 1; transport->malloced = 1;
...@@ -81,7 +80,7 @@ struct sctp_transport *sctp_transport_new(const union sctp_addr *addr, ...@@ -81,7 +80,7 @@ struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
/* Intialize a new transport from provided memory. */ /* Intialize a new transport from provided memory. */
struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
const union sctp_addr *addr, const union sctp_addr *addr,
int priority) int gfp)
{ {
struct sctp_protocol *proto = sctp_get_protocol(); struct sctp_protocol *proto = sctp_get_protocol();
...@@ -199,13 +198,13 @@ void sctp_transport_reset_timers(struct sctp_transport *transport) ...@@ -199,13 +198,13 @@ void sctp_transport_reset_timers(struct sctp_transport *transport)
* Register the reference count in the association. * Register the reference count in the association.
*/ */
void sctp_transport_set_owner(struct sctp_transport *transport, void sctp_transport_set_owner(struct sctp_transport *transport,
sctp_association_t *asoc) struct sctp_association *asoc)
{ {
transport->asoc = asoc; transport->asoc = asoc;
sctp_association_hold(asoc); sctp_association_hold(asoc);
} }
/* Initialize the pmtu of a transport. */ /* Initialize the pmtu of a transport. */
void sctp_transport_pmtu(struct sctp_transport *transport) void sctp_transport_pmtu(struct sctp_transport *transport)
{ {
struct dst_entry *dst; struct dst_entry *dst;
...@@ -225,7 +224,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport) ...@@ -225,7 +224,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
void sctp_transport_route(struct sctp_transport *transport, void sctp_transport_route(struct sctp_transport *transport,
union sctp_addr *saddr, struct sctp_opt *opt) union sctp_addr *saddr, struct sctp_opt *opt)
{ {
sctp_association_t *asoc = transport->asoc; struct sctp_association *asoc = transport->asoc;
struct sctp_af *af = transport->af_specific; struct sctp_af *af = transport->af_specific;
union sctp_addr *daddr = &transport->ipaddr; union sctp_addr *daddr = &transport->ipaddr;
struct dst_entry *dst; struct dst_entry *dst;
...@@ -359,7 +358,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport, ...@@ -359,7 +358,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
* two conditions are met can the cwnd be increased otherwise * two conditions are met can the cwnd be increased otherwise
* the cwnd MUST not be increased. If these conditions are met * the cwnd MUST not be increased. If these conditions are met
* then cwnd MUST be increased by at most the lesser of * then cwnd MUST be increased by at most the lesser of
* 1) the total size of the previously outstanding DATA * 1) the total size of the previously outstanding DATA
* chunk(s) acknowledged, and 2) the destination's path MTU. * chunk(s) acknowledged, and 2) the destination's path MTU.
*/ */
if (bytes_acked > pmtu) if (bytes_acked > pmtu)
...@@ -373,17 +372,17 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport, ...@@ -373,17 +372,17 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
transport, bytes_acked, cwnd, transport, bytes_acked, cwnd,
ssthresh, flight_size, pba); ssthresh, flight_size, pba);
} else { } else {
/* RFC 2960 7.2.2 Whenever cwnd is greater than ssthresh, /* RFC 2960 7.2.2 Whenever cwnd is greater than ssthresh,
* upon each SACK arrival that advances the Cumulative TSN Ack * upon each SACK arrival that advances the Cumulative TSN Ack
* Point, increase partial_bytes_acked by the total number of * Point, increase partial_bytes_acked by the total number of
* bytes of all new chunks acknowledged in that SACK including * bytes of all new chunks acknowledged in that SACK including
* chunks acknowledged by the new Cumulative TSN Ack and by * chunks acknowledged by the new Cumulative TSN Ack and by
* Gap Ack Blocks. * Gap Ack Blocks.
* *
* When partial_bytes_acked is equal to or greater than cwnd * When partial_bytes_acked is equal to or greater than cwnd
* and before the arrival of the SACK the sender had cwnd or * and before the arrival of the SACK the sender had cwnd or
* more bytes of data outstanding (i.e., before arrival of the * more bytes of data outstanding (i.e., before arrival of the
* SACK, flightsize was greater than or equal to cwnd), * SACK, flightsize was greater than or equal to cwnd),
* increase cwnd by MTU, and reset partial_bytes_acked to * increase cwnd by MTU, and reset partial_bytes_acked to
* (partial_bytes_acked - cwnd). * (partial_bytes_acked - cwnd).
*/ */
......
...@@ -55,13 +55,12 @@ static void sctp_tsnmap_find_gap_ack(__u8 *map, __u16 off, ...@@ -55,13 +55,12 @@ static void sctp_tsnmap_find_gap_ack(__u8 *map, __u16 off,
/* Create a new sctp_tsnmap. /* Create a new sctp_tsnmap.
* Allocate room to store at least 'len' contiguous TSNs. * Allocate room to store at least 'len' contiguous TSNs.
*/ */
struct sctp_tsnmap *sctp_tsnmap_new(__u16 len, __u32 initial_tsn, int priority) struct sctp_tsnmap *sctp_tsnmap_new(__u16 len, __u32 initial_tsn, int gfp)
{ {
struct sctp_tsnmap *retval; struct sctp_tsnmap *retval;
retval = kmalloc(sizeof(struct sctp_tsnmap) + retval = kmalloc(sizeof(struct sctp_tsnmap) +
sctp_tsnmap_storage_size(len), sctp_tsnmap_storage_size(len), gfp);
priority);
if (!retval) if (!retval)
goto fail; goto fail;
......
...@@ -52,12 +52,12 @@ static void sctp_ulpevent_set_owner(struct sk_buff *skb, ...@@ -52,12 +52,12 @@ static void sctp_ulpevent_set_owner(struct sk_buff *skb,
const struct sctp_association *asoc); const struct sctp_association *asoc);
/* Create a new sctp_ulpevent. */ /* Create a new sctp_ulpevent. */
struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags, int priority) struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sk_buff *skb; struct sk_buff *skb;
skb = alloc_skb(size, priority); skb = alloc_skb(size, gfp);
if (!skb) if (!skb)
goto fail; goto fail;
...@@ -106,16 +106,16 @@ int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event) ...@@ -106,16 +106,16 @@ int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event)
* zero'd out. * zero'd out.
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
const sctp_association_t *asoc, const struct sctp_association *asoc,
__u16 flags, __u16 state, __u16 error, __u16 outbound, __u16 flags, __u16 state, __u16 error, __u16 outbound,
__u16 inbound, int priority) __u16 inbound, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_assoc_change *sac; struct sctp_assoc_change *sac;
struct sk_buff *skb; struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
MSG_NOTIFICATION, priority); MSG_NOTIFICATION, gfp);
if (!event) if (!event)
goto fail; goto fail;
skb = sctp_event2skb(event); skb = sctp_event2skb(event);
...@@ -207,15 +207,16 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( ...@@ -207,15 +207,16 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
* an interface details event is sent. * an interface details event is sent.
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
const sctp_association_t *asoc, const struct sockaddr_storage *aaddr, const struct sctp_association *asoc,
int flags, int state, int error, int priority) const struct sockaddr_storage *aaddr,
int flags, int state, int error, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_paddr_change *spc; struct sctp_paddr_change *spc;
struct sk_buff *skb; struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_paddr_change), event = sctp_ulpevent_new(sizeof(struct sctp_paddr_change),
MSG_NOTIFICATION, priority); MSG_NOTIFICATION, gfp);
if (!event) if (!event)
goto fail; goto fail;
...@@ -315,8 +316,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( ...@@ -315,8 +316,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
* error formats. * error formats.
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_remote_error( struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
const sctp_association_t *asoc, sctp_chunk_t *chunk, const struct sctp_association *asoc, sctp_chunk_t *chunk,
__u16 flags, int priority) __u16 flags, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_remote_error *sre; struct sctp_remote_error *sre;
...@@ -338,7 +339,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error( ...@@ -338,7 +339,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
skb = skb_copy_expand(chunk->skb, skb = skb_copy_expand(chunk->skb,
sizeof(struct sctp_remote_error), /* headroom */ sizeof(struct sctp_remote_error), /* headroom */
0, /* tailroom */ 0, /* tailroom */
priority); gfp);
/* Pull off the rest of the cause TLV from the chunk. */ /* Pull off the rest of the cause TLV from the chunk. */
skb_pull(chunk->skb, elen); skb_pull(chunk->skb, elen);
...@@ -419,8 +420,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error( ...@@ -419,8 +420,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
* 5.3.1.4 SCTP_SEND_FAILED * 5.3.1.4 SCTP_SEND_FAILED
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_send_failed( struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
const sctp_association_t *asoc, sctp_chunk_t *chunk, const struct sctp_association *asoc, sctp_chunk_t *chunk,
__u16 flags, __u32 error, int priority) __u16 flags, __u32 error, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_send_failed *ssf; struct sctp_send_failed *ssf;
...@@ -430,7 +431,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed( ...@@ -430,7 +431,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
skb = skb_copy_expand(chunk->skb, skb = skb_copy_expand(chunk->skb,
sizeof(struct sctp_send_failed), /* headroom */ sizeof(struct sctp_send_failed), /* headroom */
0, /* tailroom */ 0, /* tailroom */
priority); gfp);
if (!skb) if (!skb)
goto fail; goto fail;
...@@ -521,15 +522,15 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed( ...@@ -521,15 +522,15 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
* 5.3.1.5 SCTP_SHUTDOWN_EVENT * 5.3.1.5 SCTP_SHUTDOWN_EVENT
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
const sctp_association_t *asoc, const struct sctp_association *asoc,
__u16 flags, int priority) __u16 flags, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_shutdown_event *sse; struct sctp_shutdown_event *sse;
struct sk_buff *skb; struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
MSG_NOTIFICATION, priority); MSG_NOTIFICATION, gfp);
if (!event) if (!event)
goto fail; goto fail;
...@@ -586,8 +587,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( ...@@ -586,8 +587,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
* Socket Extensions for SCTP * Socket Extensions for SCTP
* 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc, struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
sctp_chunk_t *chunk, int priority) sctp_chunk_t *chunk, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_sndrcvinfo *info; struct sctp_sndrcvinfo *info;
...@@ -595,7 +596,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc, ...@@ -595,7 +596,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
size_t padding, len; size_t padding, len;
/* Clone the original skb, sharing the data. */ /* Clone the original skb, sharing the data. */
skb = skb_clone(chunk->skb, priority); skb = skb_clone(chunk->skb, gfp);
if (!skb) if (!skb)
goto fail; goto fail;
...@@ -631,7 +632,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc, ...@@ -631,7 +632,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
event->iif = sctp_chunk_iif(chunk); event->iif = sctp_chunk_iif(chunk);
/* Note: Not clearing the entire event struct as /* Note: Not clearing the entire event struct as
* this is just a fragment of the real event. However, * this is just a fragment of the real event. However,
* we still need to do rwnd accounting. * we still need to do rwnd accounting.
*/ */
for (list = skb_shinfo(skb)->frag_list; list; list = list->next) for (list = skb_shinfo(skb)->frag_list; list; list = list->next)
sctp_ulpevent_set_owner_r(list, asoc); sctp_ulpevent_set_owner_r(list, asoc);
...@@ -690,16 +691,16 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc, ...@@ -690,16 +691,16 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
info->sinfo_flags |= MSG_UNORDERED; info->sinfo_flags |= MSG_UNORDERED;
/* sinfo_cumtsn: 32 bit (unsigned integer) /* sinfo_cumtsn: 32 bit (unsigned integer)
* *
* This field will hold the current cumulative TSN as * This field will hold the current cumulative TSN as
* known by the underlying SCTP layer. Note this field is * known by the underlying SCTP layer. Note this field is
* ignored when sending and only valid for a receive * ignored when sending and only valid for a receive
* operation when sinfo_flags are set to MSG_UNORDERED. * operation when sinfo_flags are set to MSG_UNORDERED.
*/ */
info->sinfo_cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); info->sinfo_cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
} }
/* Note: For reassembly, we need to have the fragmentation bits. /* Note: For reassembly, we need to have the fragmentation bits.
* For now, merge these into the msg_flags, since those bit * For now, merge these into the msg_flags, since those bit
* possitions are not used. * possitions are not used.
*/ */
...@@ -732,7 +733,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc, ...@@ -732,7 +733,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
return NULL; return NULL;
} }
/* Create a partial delivery related event. /* Create a partial delivery related event.
* *
* 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT * 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT
* *
...@@ -741,14 +742,14 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc, ...@@ -741,14 +742,14 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
* various events. * various events.
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_pdapi( struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
const sctp_association_t *asoc, __u32 indication, int priority) const struct sctp_association *asoc, __u32 indication, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_rcv_pdapi_event *pd; struct sctp_rcv_pdapi_event *pd;
struct sk_buff *skb; struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
MSG_NOTIFICATION, priority); MSG_NOTIFICATION, gfp);
if (!event) if (!event)
goto fail; goto fail;
...@@ -780,7 +781,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi( ...@@ -780,7 +781,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
pd->pdapi_indication = indication; pd->pdapi_indication = indication;
/* pdapi_assoc_id: sizeof (sctp_assoc_t) /* pdapi_assoc_id: sizeof (sctp_assoc_t)
* *
* The association id field, holds the identifier for the association. * The association id field, holds the identifier for the association.
*/ */
pd->pdapi_assoc_id = sctp_assoc2id(asoc); pd->pdapi_assoc_id = sctp_assoc2id(asoc);
...@@ -817,7 +818,7 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, ...@@ -817,7 +818,7 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
/* Do accounting for bytes just read by user. */ /* Do accounting for bytes just read by user. */
static void sctp_rcvmsg_rfree(struct sk_buff *skb) static void sctp_rcvmsg_rfree(struct sk_buff *skb)
{ {
sctp_association_t *asoc; struct sctp_association *asoc;
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
/* Current stack structures assume that the rcv buffer is /* Current stack structures assume that the rcv buffer is
...@@ -834,7 +835,7 @@ static void sctp_rcvmsg_rfree(struct sk_buff *skb) ...@@ -834,7 +835,7 @@ static void sctp_rcvmsg_rfree(struct sk_buff *skb)
/* Charge receive window for bytes received. */ /* Charge receive window for bytes received. */
static void sctp_ulpevent_set_owner_r(struct sk_buff *skb, static void sctp_ulpevent_set_owner_r(struct sk_buff *skb,
sctp_association_t *asoc) struct sctp_association *asoc)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
......
...@@ -57,11 +57,11 @@ static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *, ...@@ -57,11 +57,11 @@ static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *,
/* 1st Level Abstractions */ /* 1st Level Abstractions */
/* Create a new ULP queue. */ /* Create a new ULP queue. */
struct sctp_ulpq *sctp_ulpq_new(sctp_association_t *asoc, int priority) struct sctp_ulpq *sctp_ulpq_new(struct sctp_association *asoc, int gfp)
{ {
struct sctp_ulpq *ulpq; struct sctp_ulpq *ulpq;
ulpq = kmalloc(sizeof(struct sctp_ulpq), priority); ulpq = kmalloc(sizeof(struct sctp_ulpq), gfp);
if (!ulpq) if (!ulpq)
goto fail; goto fail;
if (!sctp_ulpq_init(ulpq, asoc)) if (!sctp_ulpq_init(ulpq, asoc))
...@@ -77,7 +77,7 @@ struct sctp_ulpq *sctp_ulpq_new(sctp_association_t *asoc, int priority) ...@@ -77,7 +77,7 @@ struct sctp_ulpq *sctp_ulpq_new(sctp_association_t *asoc, int priority)
/* Initialize a ULP queue from a block of memory. */ /* Initialize a ULP queue from a block of memory. */
struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq, struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
sctp_association_t *asoc) struct sctp_association *asoc)
{ {
memset(ulpq, sizeof(struct sctp_ulpq), 0x00); memset(ulpq, sizeof(struct sctp_ulpq), 0x00);
...@@ -119,7 +119,7 @@ void sctp_ulpq_free(struct sctp_ulpq *ulpq) ...@@ -119,7 +119,7 @@ void sctp_ulpq_free(struct sctp_ulpq *ulpq)
/* Process an incoming DATA chunk. */ /* Process an incoming DATA chunk. */
int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, sctp_chunk_t *chunk, int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, sctp_chunk_t *chunk,
int priority) int gfp)
{ {
struct sk_buff_head temp; struct sk_buff_head temp;
sctp_data_chunk_t *hdr; sctp_data_chunk_t *hdr;
...@@ -128,7 +128,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, sctp_chunk_t *chunk, ...@@ -128,7 +128,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, sctp_chunk_t *chunk,
hdr = (sctp_data_chunk_t *) chunk->chunk_hdr; hdr = (sctp_data_chunk_t *) chunk->chunk_hdr;
/* Create an event from the incoming chunk. */ /* Create an event from the incoming chunk. */
event = sctp_ulpevent_make_rcvmsg(chunk->asoc, chunk, priority); event = sctp_ulpevent_make_rcvmsg(chunk->asoc, chunk, gfp);
if (!event) if (!event)
return -ENOMEM; return -ENOMEM;
...@@ -705,7 +705,7 @@ static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed) ...@@ -705,7 +705,7 @@ static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed)
/* Partial deliver the first message as there is pressure on rwnd. */ /* Partial deliver the first message as there is pressure on rwnd. */
void sctp_ulpq_partial_delivery(struct sctp_ulpq *ulpq, void sctp_ulpq_partial_delivery(struct sctp_ulpq *ulpq,
struct sctp_chunk *chunk, int priority) struct sctp_chunk *chunk, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_association *asoc; struct sctp_association *asoc;
...@@ -729,7 +729,7 @@ void sctp_ulpq_partial_delivery(struct sctp_ulpq *ulpq, ...@@ -729,7 +729,7 @@ void sctp_ulpq_partial_delivery(struct sctp_ulpq *ulpq,
/* Renege some packets to make room for an incoming chunk. */ /* Renege some packets to make room for an incoming chunk. */
void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
int priority) int gfp)
{ {
struct sctp_association *asoc; struct sctp_association *asoc;
__u16 needed, freed; __u16 needed, freed;
...@@ -755,9 +755,9 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, ...@@ -755,9 +755,9 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
__u32 tsn; __u32 tsn;
tsn = ntohl(chunk->subh.data_hdr->tsn); tsn = ntohl(chunk->subh.data_hdr->tsn);
sctp_tsnmap_mark(&asoc->peer.tsn_map, tsn); sctp_tsnmap_mark(&asoc->peer.tsn_map, tsn);
sctp_ulpq_tail_data(ulpq, chunk, priority); sctp_ulpq_tail_data(ulpq, chunk, gfp);
sctp_ulpq_partial_delivery(ulpq, chunk, priority); sctp_ulpq_partial_delivery(ulpq, chunk, gfp);
} }
return; return;
...@@ -768,7 +768,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, ...@@ -768,7 +768,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
/* Notify the application if an association is aborted and in /* Notify the application if an association is aborted and in
* partial delivery mode. Send up any pending received messages. * partial delivery mode. Send up any pending received messages.
*/ */
void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, int priority) void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, int gfp)
{ {
struct sctp_ulpevent *ev = NULL; struct sctp_ulpevent *ev = NULL;
struct sock *sk; struct sock *sk;
...@@ -781,7 +781,7 @@ void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, int priority) ...@@ -781,7 +781,7 @@ void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, int priority)
&sctp_sk(sk)->subscribe)) &sctp_sk(sk)->subscribe))
ev = sctp_ulpevent_make_pdapi(ulpq->asoc, ev = sctp_ulpevent_make_pdapi(ulpq->asoc,
SCTP_PARTIAL_DELIVERY_ABORTED, SCTP_PARTIAL_DELIVERY_ABORTED,
priority); gfp);
if (ev) if (ev)
__skb_queue_tail(&sk->receive_queue, sctp_event2skb(ev)); __skb_queue_tail(&sk->receive_queue, sctp_event2skb(ev));
......
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