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 {
/* Create a new sctp_command_sequence.
* 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.
* Return 0 if the initialization fails.
......
......@@ -125,7 +125,7 @@ extern struct sctp_protocol sctp_proto;
extern struct sock *sctp_get_ctl_sock(void);
extern int sctp_copy_local_addr_list(struct sctp_protocol *,
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 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,
/*
* sctp/primitive.c
*/
extern int sctp_primitive_ASSOCIATE(sctp_association_t *, void *arg);
extern int sctp_primitive_SHUTDOWN(sctp_association_t *, void *arg);
extern int sctp_primitive_ABORT(sctp_association_t *, void *arg);
extern int sctp_primitive_SEND(sctp_association_t *, void *arg);
extern int sctp_primitive_REQUESTHEARTBEAT(sctp_association_t *, void *arg);
extern int sctp_primitive_ASSOCIATE(struct sctp_association *, void *arg);
extern int sctp_primitive_SHUTDOWN(struct sctp_association *, void *arg);
extern int sctp_primitive_ABORT(struct sctp_association *, void *arg);
extern int sctp_primitive_SEND(struct sctp_association *, void *arg);
extern int sctp_primitive_REQUESTHEARTBEAT(struct sctp_association *, void *arg);
/*
* sctp/crc32c.c
......@@ -159,15 +159,16 @@ extern __u32 sctp_end_cksum(__u32 cksum);
*/
extern int sctp_rcv(struct sk_buff *skb);
extern void sctp_v4_err(struct sk_buff *skb, u32 info);
extern void sctp_hash_established(sctp_association_t *);
extern void __sctp_hash_established(sctp_association_t *);
extern void sctp_unhash_established(sctp_association_t *);
extern void __sctp_unhash_established(sctp_association_t *);
extern void sctp_hash_endpoint(sctp_endpoint_t *);
extern void __sctp_hash_endpoint(sctp_endpoint_t *);
extern void sctp_unhash_endpoint(sctp_endpoint_t *);
extern void __sctp_unhash_endpoint(sctp_endpoint_t *);
extern sctp_association_t *__sctp_lookup_association(const union sctp_addr *,
extern void sctp_hash_established(struct sctp_association *);
extern void __sctp_hash_established(struct sctp_association *);
extern void sctp_unhash_established(struct sctp_association *);
extern void __sctp_unhash_established(struct sctp_association *);
extern void sctp_hash_endpoint(struct sctp_endpoint *);
extern void __sctp_hash_endpoint(struct sctp_endpoint *);
extern void sctp_unhash_endpoint(struct sctp_endpoint *);
extern void __sctp_unhash_endpoint(struct sctp_endpoint *);
extern struct sctp_association *__sctp_lookup_association(
const union sctp_addr *,
const union sctp_addr *,
struct sctp_transport **);
extern struct sock *sctp_err_lookup(int family, struct sk_buff *,
......@@ -341,14 +342,14 @@ static inline void sctp_v6_exit(void) { return; }
/* 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;
}
/* 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. */
......
......@@ -81,8 +81,8 @@ typedef struct {
int action;
} sctp_sm_command_t;
typedef sctp_disposition_t (sctp_state_fn_t) (const sctp_endpoint_t *,
const sctp_association_t *,
typedef sctp_disposition_t (sctp_state_fn_t) (const struct sctp_endpoint *,
const struct sctp_association *,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *);
......@@ -209,67 +209,67 @@ __u32 sctp_generate_verification_tag(void);
void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
/* 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 *,
int priority, int vparam_len);
sctp_chunk_t *sctp_make_init_ack(const sctp_association_t *,
int gfp, int vparam_len);
sctp_chunk_t *sctp_make_init_ack(const struct sctp_association *,
const sctp_chunk_t *,
const int priority,
const int gfp,
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 *);
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 *);
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 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,
int len, const __u8 *data,
__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,
int len, const __u8 flags,
__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,
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);
sctp_chunk_t *sctp_make_ecne(const sctp_association_t *,
sctp_chunk_t *sctp_make_ecne(const struct sctp_association *,
const __u32);
sctp_chunk_t *sctp_make_sack(const sctp_association_t *);
sctp_chunk_t *sctp_make_shutdown(const sctp_association_t *asoc);
sctp_chunk_t *sctp_make_shutdown_ack(const sctp_association_t *asoc,
sctp_chunk_t *sctp_make_sack(const struct sctp_association *);
sctp_chunk_t *sctp_make_shutdown(const struct sctp_association *asoc);
sctp_chunk_t *sctp_make_shutdown_ack(const struct sctp_association *asoc,
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 *);
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 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 *,
__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 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 void *payload,
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 void *payload,
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,
__u16 cause_code,
const void *payload,
size_t paylen);
void sctp_chunk_assign_tsn(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 *,
struct msghdr *, int len,
struct sk_buff_head *);
......@@ -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,
sctp_state_t state,
sctp_endpoint_t *,
sctp_association_t *asoc,
struct sctp_endpoint *,
struct sctp_association *asoc,
void *event_arg,
int priority);
int gfp);
int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state,
sctp_endpoint_t *,
sctp_association_t *asoc,
struct sctp_endpoint *,
struct sctp_association *asoc,
void *event_arg,
sctp_disposition_t status,
sctp_cmd_seq_t *commands,
int priority);
int gfp);
/* 2nd level prototypes */
int
sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state,
sctp_endpoint_t *ep,
sctp_association_t *asoc,
struct sctp_endpoint *ep,
struct sctp_association *asoc,
void *event_arg,
sctp_disposition_t status,
sctp_cmd_seq_t *retval,
int priority);
int gfp);
int sctp_gen_sack(sctp_association_t *, int force, sctp_cmd_seq_t *);
void sctp_do_TSNdup(sctp_association_t *, sctp_chunk_t *, long gap);
int sctp_gen_sack(struct sctp_association *, int force, sctp_cmd_seq_t *);
void sctp_do_TSNdup(struct sctp_association *, sctp_chunk_t *, long gap);
void sctp_generate_t3_rtx_event(unsigned long peer);
void sctp_generate_heartbeat_event(unsigned long peer);
......@@ -325,21 +325,21 @@ sctp_cookie_param_t *
sctp_pack_cookie(const struct sctp_endpoint *, const struct sctp_association *,
const struct sctp_chunk *, int *cookie_len,
const __u8 *, int addrs_len);
sctp_association_t *sctp_unpack_cookie(const sctp_endpoint_t *,
const sctp_association_t *,
sctp_chunk_t *, int priority, int *err,
struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *,
const struct sctp_association *,
sctp_chunk_t *, int gfp, int *err,
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);
void sctp_send_stale_cookie_err(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands,
sctp_chunk_t *err_chunk);
/* 3rd level prototypes */
__u32 sctp_generate_tag(const sctp_endpoint_t *);
__u32 sctp_generate_tsn(const sctp_endpoint_t *);
__u32 sctp_generate_tag(const struct sctp_endpoint *);
__u32 sctp_generate_tsn(const struct sctp_endpoint *);
/* 4th level prototypes */
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
*/
static inline int
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
*
......
......@@ -83,14 +83,11 @@ struct sctp_outq;
struct sctp_bind_addr;
struct sctp_ulpq;
struct sctp_opt;
struct sctp_endpoint_common;
struct sctp_ep_common;
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_bind_addr sctp_bind_addr_t;
typedef struct sctp_endpoint_common sctp_endpoint_common_t;
#include <net/sctp/tsnmap.h>
#include <net/sctp/ulpevent.h>
......@@ -114,7 +111,7 @@ typedef struct sctp_bind_hashbucket {
/* Used for hashing all associations. */
typedef struct sctp_hashbucket {
rwlock_t lock;
sctp_endpoint_common_t *chain;
struct sctp_ep_common *chain;
} sctp_hashbucket_t __attribute__((__aligned__(8)));
......@@ -517,7 +514,7 @@ struct sctp_chunk {
struct sctp_association *asoc;
/* What endpoint received this chunk? */
sctp_endpoint_common_t *rcvr;
struct sctp_ep_common *rcvr;
/* We fill this in if we are calculating RTT. */
unsigned long sent_at;
......@@ -976,7 +973,7 @@ int sctp_is_any(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 {
SCTP_EP_TYPE_SOCKET,
SCTP_EP_TYPE_ASSOCIATION,
......@@ -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. */
sctp_endpoint_common_t *next;
sctp_endpoint_common_t **pprev;
struct sctp_ep_common *next;
struct sctp_ep_common **pprev;
int hashent;
/* Runtime type information. What kind of endpoint is this? */
......@@ -1055,7 +1052,7 @@ struct sctp_endpoint_common {
struct sctp_endpoint {
/* Common substructure for endpoint and association. */
sctp_endpoint_common_t base;
struct sctp_ep_common base;
/* Associations: A list of current associations and mappings
* to the data consumers for each association. This
......@@ -1090,7 +1087,7 @@ struct sctp_endpoint {
};
/* 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;
......@@ -1149,7 +1146,7 @@ struct sctp_association {
* In this context, it represents the associations's view
* of the local endpoint of the association.
*/
sctp_endpoint_common_t base;
struct sctp_ep_common base;
/* Associations on the same socket. */
struct list_head asocs;
......@@ -1558,7 +1555,7 @@ enum {
};
/* 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;
......
......@@ -114,7 +114,7 @@ struct sctp_tsnmap_iter {
};
/* 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. */
void sctp_tsnmap_free(struct sctp_tsnmap *);
......
......@@ -64,7 +64,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb)
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);
void sctp_ulpevent_free(struct sctp_ulpevent *);
int sctp_ulpevent_is_notification(const struct sctp_ulpevent *);
......@@ -76,7 +76,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
__u16 error,
__u16 outbound,
__u16 inbound,
int priority);
int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
const struct sctp_association *asoc,
......@@ -84,32 +84,32 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
int flags,
int state,
int error,
int priority);
int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
const struct sctp_association *asoc,
struct sctp_chunk *chunk,
__u16 flags,
int priority);
int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
const struct sctp_association *asoc,
struct sctp_chunk *chunk,
__u16 flags,
__u32 error,
int priority);
int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
const struct sctp_association *asoc,
__u16 flags,
int priority);
int gfp);
struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
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_chunk *chunk,
int priority);
int gfp);
void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
struct msghdr *);
......
......@@ -50,14 +50,15 @@
struct sctp_ulpq {
char malloced;
char pd_mode;
sctp_association_t *asoc;
struct sctp_association *asoc;
struct sk_buff_head reasm;
struct sk_buff_head lobby;
};
/* Prototypes. */
struct sctp_ulpq *sctp_ulpq_new(sctp_association_t *asoc, int priority);
struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, sctp_association_t *);
struct sctp_ulpq *sctp_ulpq_new(struct sctp_association *asoc, int gfp);
struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
struct sctp_association *);
void sctp_ulpq_free(struct sctp_ulpq *);
/* Add a new DATA chunk for processing. */
......
......@@ -58,23 +58,23 @@
#include <net/sctp/sctp.h>
/* 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. */
/* 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,
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)
goto fail;
if (!sctp_association_init(asoc, ep, sk, scope, priority))
if (!sctp_association_init(asoc, ep, sk, scope, gfp))
goto fail_init;
asoc->base.malloced = 1;
......@@ -89,11 +89,11 @@ sctp_association_t *sctp_association_new(const sctp_endpoint_t *ep,
}
/* Intialize a new association from provided memory. */
sctp_association_t *sctp_association_init(sctp_association_t *asoc,
const sctp_endpoint_t *ep,
struct sctp_association *sctp_association_init(struct sctp_association *asoc,
const struct sctp_endpoint *ep,
const struct sock *sk,
sctp_scope_t scope,
int priority)
int gfp)
{
struct sctp_opt *sp;
struct sctp_protocol *proto = sctp_get_protocol();
......@@ -103,10 +103,10 @@ sctp_association_t *sctp_association_init(sctp_association_t *asoc,
sp = sctp_sk((struct sock *)sk);
/* 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. */
asoc->ep = (sctp_endpoint_t *)ep;
asoc->ep = (struct sctp_endpoint *)ep;
sctp_endpoint_hold(asoc->ep);
/* Hold the sock. */
......@@ -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
* 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 sctp_transport *transport;
......@@ -352,7 +352,7 @@ void sctp_association_free(sctp_association_t *asoc)
}
/* 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);
......@@ -385,7 +385,7 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
/* Add a transport address to an association. */
struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
const union sctp_addr *addr,
int priority)
int gfp)
{
struct sctp_transport *peer;
struct sctp_opt *sp;
......@@ -404,7 +404,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
if (peer)
return peer;
peer = sctp_transport_new(addr, priority);
peer = sctp_transport_new(addr, gfp);
if (!peer)
return NULL;
......@@ -490,7 +490,8 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
}
/* 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 struct sctp_association *asoc,
const union sctp_addr *address)
{
struct sctp_transport *t;
......@@ -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.
* 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,
sctp_transport_cmd_t command,
sctp_sn_error_t error)
......@@ -601,7 +602,7 @@ void sctp_assoc_control_transport(sctp_association_t *asoc,
}
/* 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);
}
......@@ -609,7 +610,7 @@ void sctp_association_hold(sctp_association_t *asoc)
/* Release a reference to an association and cleanup
* 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))
sctp_association_destroy(asoc);
......@@ -618,7 +619,7 @@ void sctp_association_put(sctp_association_t *asoc)
/* Allocate the next TSN, Transmission Sequence Number, for the given
* 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:
* Transmission Sequence Numbers wrap around when they reach
......@@ -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. */
__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;
......@@ -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
* 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;
}
......@@ -689,7 +690,7 @@ sctp_chunk_t *sctp_get_no_prepend(sctp_association_t *asoc)
/*
* 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 *match;
......@@ -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? */
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 *paddr)
{
......@@ -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(). */
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;
struct sock *sk;
struct sctp_inq *inqueue;
......@@ -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. */
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 sock *oldsk = assoc->base.sk;
......@@ -851,7 +852,7 @@ void sctp_assoc_migrate(sctp_association_t *assoc, struct sock *newsk)
}
/* 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. */
asoc->c = new->c;
......@@ -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
* 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 list_head *head = &asoc->peer.transport_addr_list;
......@@ -945,7 +946,7 @@ void sctp_assoc_update_retran_path(sctp_association_t *asoc)
}
/* 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,
* 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 *
/* 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.
*/
void sctp_assoc_sync_pmtu(sctp_association_t *asoc)
void sctp_assoc_sync_pmtu(struct sctp_association *asoc)
{
struct sctp_transport *t;
struct list_head *pos;
......@@ -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. */
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;
struct timer_list *timer;
......@@ -1054,7 +1055,7 @@ void sctp_assoc_rwnd_increase(sctp_association_t *asoc, int 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_over, "rwnd_over not zero", return);
......@@ -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. */
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)
{
int var_size2 = ntohs(cookie->peer_init->chunk_hdr.length);
......
......@@ -43,9 +43,9 @@
#include <net/sctp/sm.h>
/* 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)
sctp_init_cmd_seq(retval);
......
......@@ -63,11 +63,11 @@
/* Forward declarations for internal helpers. */
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 *paddr,
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. */
......@@ -102,9 +102,9 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb)
int sctp_rcv(struct sk_buff *skb)
{
struct sock *sk;
sctp_association_t *asoc;
sctp_endpoint_t *ep = NULL;
sctp_endpoint_common_t *rcvr;
struct sctp_association *asoc;
struct sctp_endpoint *ep = NULL;
struct sctp_ep_common *rcvr;
struct sctp_transport *transport = NULL;
sctp_chunk_t *chunk;
struct sctphdr *sh;
......@@ -389,8 +389,8 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
int type = skb->h.icmph->type;
int code = skb->h.icmph->code;
struct sock *sk;
sctp_endpoint_t *ep;
sctp_association_t *asoc;
struct sctp_endpoint *ep;
struct sctp_association *asoc;
struct sctp_transport *transport;
struct inet_opt *inet;
char *saveip, *savesctp;
......@@ -520,10 +520,10 @@ int sctp_rcv_ootb(struct sk_buff *skb)
}
/* 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;
sctp_endpoint_common_t *epb;
struct sctp_ep_common **epp;
struct sctp_ep_common *epb;
sctp_hashbucket_t *head;
epb = &ep->base;
......@@ -542,7 +542,7 @@ void __sctp_hash_endpoint(sctp_endpoint_t *ep)
}
/* 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_hash_endpoint(ep);
......@@ -550,10 +550,10 @@ void sctp_hash_endpoint(sctp_endpoint_t *ep)
}
/* 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_endpoint_common_t *epb;
struct sctp_ep_common *epb;
epb = &ep->base;
......@@ -574,7 +574,7 @@ void __sctp_unhash_endpoint(sctp_endpoint_t *ep)
}
/* 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_unhash_endpoint(ep);
......@@ -582,11 +582,11 @@ void sctp_unhash_endpoint(sctp_endpoint_t *ep)
}
/* 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_endpoint_common_t *epb;
sctp_endpoint_t *ep;
struct sctp_ep_common *epb;
struct sctp_endpoint *ep;
int hash;
hash = sctp_ep_hashfn(laddr->v4.sin_port);
......@@ -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. */
void sctp_hash_established(sctp_association_t *asoc)
void sctp_hash_established(struct sctp_association *asoc)
{
sctp_local_bh_disable();
__sctp_hash_established(asoc);
......@@ -617,10 +617,10 @@ void sctp_hash_established(sctp_association_t *asoc)
}
/* 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;
sctp_endpoint_common_t *epb;
struct sctp_ep_common **epp;
struct sctp_ep_common *epb;
sctp_hashbucket_t *head;
epb = &asoc->base;
......@@ -641,7 +641,7 @@ void __sctp_hash_established(sctp_association_t *asoc)
}
/* 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_unhash_established(asoc);
......@@ -649,10 +649,10 @@ void sctp_unhash_established(sctp_association_t *asoc)
}
/* 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_endpoint_common_t *epb;
struct sctp_ep_common *epb;
epb = &asoc->base;
......@@ -674,13 +674,14 @@ void __sctp_unhash_established(sctp_association_t *asoc)
}
/* 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 *local,
const union sctp_addr *peer,
struct sctp_transport **pt)
{
sctp_hashbucket_t *head;
sctp_endpoint_common_t *epb;
sctp_association_t *asoc;
struct sctp_ep_common *epb;
struct sctp_association *asoc;
struct sctp_transport *transport;
int hash;
......@@ -710,11 +711,11 @@ sctp_association_t *__sctp_lookup_association(const union sctp_addr *local,
}
/* 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,
struct sctp_transport **transportp)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
sctp_local_bh_disable();
asoc = __sctp_lookup_association(laddr, paddr, transportp);
......@@ -727,7 +728,7 @@ sctp_association_t *sctp_lookup_association(const union sctp_addr *laddr,
int sctp_has_association(const union sctp_addr *laddr,
const union sctp_addr *paddr)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
struct sctp_transport *transport;
if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) {
......@@ -757,10 +758,10 @@ int sctp_has_association(const union sctp_addr *laddr,
* 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)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
union sctp_addr addr;
union sctp_addr *paddr = &addr;
struct sctphdr *sh = (struct sctphdr *) skb->h.raw;
......@@ -815,12 +816,12 @@ static sctp_association_t *__sctp_rcv_init_lookup(struct sk_buff *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 *laddr,
struct sctp_transport **transportp)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
asoc = __sctp_lookup_association(laddr, paddr, transportp);
......
......@@ -78,7 +78,7 @@ void sctp_inq_free(struct sctp_inq *queue)
sctp_chunk_t *chunk;
/* 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);
/* 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)
* at this time.
*/
if ((chunk = queue->in_progress) != NULL) {
if ((chunk = queue->in_progress)) {
/* There is a packet that we have been working 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,
struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
struct sctphdr *sh = (struct sctphdr *)(skb->data + offset);
struct sock *sk;
sctp_endpoint_t *ep;
sctp_association_t *asoc;
struct sctp_endpoint *ep;
struct sctp_association *asoc;
struct sctp_transport *transport;
struct ipv6_pinfo *np;
char *saveip, *savesctp;
......@@ -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
* 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 *saddr)
{
......@@ -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)
* 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)
{
sctp_bind_addr_t *bp;
......
......@@ -100,7 +100,7 @@ static inline void sctp_outq_insert_data(struct sctp_outq *q,
}
/* 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;
......@@ -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
* 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;
skb_queue_head_init(&q->out);
......@@ -417,7 +417,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
struct sctp_transport *transport = pkt->transport;
sctp_xmit_t status;
sctp_chunk_t *chunk;
sctp_association_t *asoc;
struct sctp_association *asoc;
int error = 0;
asoc = q->asoc;
......@@ -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,
sctp_chunk_t *frag)
{
sctp_association_t *asoc = frag->asoc;
struct sctp_association *asoc = frag->asoc;
struct list_head *lfrag, *frag_list;
__u32 tsn;
int nfrags = 1;
......@@ -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,
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;
struct sctp_sndrcvinfo *sinfo = &chunk->sinfo;
__u16 chunk_data_len = sctp_data_size(chunk);
......@@ -724,7 +724,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
{
struct sctp_packet *packet;
struct sctp_packet singleton;
sctp_association_t *asoc = q->asoc;
struct sctp_association *asoc = q->asoc;
int ecn_capable = asoc->peer.ecn_capable;
__u16 sport = asoc->base.bind_addr.port;
__u16 dport = asoc->peer.port;
......@@ -1077,7 +1077,7 @@ int sctp_outq_set_output_handlers(struct sctp_outq *q,
}
/* 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_sack_variable_t *frags;
......@@ -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. */
static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack,
sctp_association_t *asoc)
struct sctp_association *asoc)
{
struct list_head *ltransport, *lchunk;
struct sctp_transport *transport;
......@@ -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)
{
sctp_association_t *asoc = q->asoc;
struct sctp_association *asoc = q->asoc;
struct sctp_transport *transport;
sctp_chunk_t *tchunk;
struct list_head *lchunk, *transport_list, *pos;
......
......@@ -55,12 +55,12 @@
#define DECLARE_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) { \
int error = 0; \
sctp_event_t event_type; sctp_subtype_t subtype; \
sctp_state_t state; \
sctp_endpoint_t *ep; \
struct sctp_endpoint *ep; \
\
event_type = SCTP_EVENT_T_PRIMITIVE; \
subtype = SCTP_ST_PRIMITIVE(SCTP_PRIMITIVE_ ## name); \
......
......@@ -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'. */
int sctp_copy_local_addr_list(struct sctp_protocol *proto,
struct sctp_bind_addr *bp, sctp_scope_t scope,
int priority, int copy_flags)
int gfp, int copy_flags)
{
struct sockaddr_storage_list *addr;
int error = 0;
......@@ -223,8 +223,7 @@ int sctp_copy_local_addr_list(struct sctp_protocol *proto,
(((AF_INET6 == addr->a.sa.sa_family) &&
(copy_flags & SCTP_ADDR6_ALLOWED) &&
(copy_flags & SCTP_ADDR6_PEERSUPP)))) {
error = sctp_add_bind_addr(bp, &addr->a,
priority);
error = sctp_add_bind_addr(bp, &addr->a, gfp);
if (error)
goto end_copy;
}
......@@ -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
* 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,
union sctp_addr *daddr,
union sctp_addr *saddr)
......
......@@ -2064,7 +2064,7 @@ int sctp_process_param(struct sctp_association *asoc, union sctp_params param,
}
/* 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.
* 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)
}
/* 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;
......
......@@ -60,7 +60,8 @@
********************************************************************/
/* 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 */
......@@ -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
* 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,
sctp_chunk_t *chunk)
{
......@@ -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. */
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)
{
/* Turn off ECNE getting auto-prepended to every outgoing
......@@ -200,7 +201,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
{
int error;
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. */
......@@ -238,7 +239,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
/* This is a sa interface for producing timeout events. It works
* 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)
{
int error = 0;
......@@ -265,8 +266,7 @@ static void sctp_generate_timeout_event(sctp_association_t *asoc,
error = sctp_do_sm(SCTP_EVENT_T_TIMEOUT,
SCTP_ST_TIMEOUT(timeout_type),
asoc->state, asoc->ep, asoc,
(void *)timeout_type,
GFP_ATOMIC);
(void *)timeout_type, GFP_ATOMIC);
if (error)
asoc->base.sk->err = -error;
......@@ -278,25 +278,25 @@ static void sctp_generate_timeout_event(sctp_association_t *asoc,
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);
}
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);
}
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);
}
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_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD);
......@@ -304,7 +304,7 @@ void sctp_generate_t5_shutdown_guard_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);
}
......@@ -315,7 +315,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
{
int error = 0;
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);
if (sock_owned_by_user(asoc->base.sk)) {
......@@ -335,8 +335,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
error = sctp_do_sm(SCTP_EVENT_T_TIMEOUT,
SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_HEARTBEAT),
asoc->state,
asoc->ep, asoc,
asoc->state, asoc->ep, asoc,
transport, GFP_ATOMIC);
if (error)
......@@ -350,7 +349,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
/* Inject a SACK Timeout event into the state machine. */
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);
}
......@@ -382,7 +381,7 @@ sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = {
* 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)
{
/* 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,
/* Worker routine to handle INIT command failure. */
static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
sctp_association_t *asoc,
struct sctp_association *asoc,
unsigned error)
{
struct sctp_ulpevent *event;
......@@ -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. */
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 list_head *pos;
......@@ -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,
sctp_association_t *asoc)
struct sctp_association *asoc)
{
struct sctp_transport *t;
struct list_head *pos;
......@@ -517,7 +516,7 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
/* Helper function to update the heartbeat timer. */
static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc,
struct sctp_association *asoc,
struct sctp_transport *t)
{
/* Update the heartbeat timer. */
......@@ -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. */
static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc,
struct sctp_association *asoc,
struct sctp_transport *t,
sctp_chunk_t *chunk)
{
......@@ -560,7 +559,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
* timer.
*/
static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc,
struct sctp_association *asoc,
struct sctp_transport *t)
{
sctp_transport_lower_cwnd(t, SCTP_LOWER_CWND_INACTIVE);
......@@ -571,7 +570,7 @@ static void sctp_cmd_transport_reset(sctp_cmd_seq_t *cmds,
/* Helper function to process the process SACK command. */
static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
sctp_association_t *asoc,
struct sctp_association *asoc,
sctp_sackhdr_t *sackh)
{
int err;
......@@ -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
* 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)
{
struct sctp_transport *t;
......@@ -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. */
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)
{
......@@ -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,
sctp_state_t state,
sctp_endpoint_t *ep,
sctp_association_t *asoc,
struct sctp_endpoint *ep,
struct sctp_association *asoc,
void *event_arg,
int priority)
int gfp)
{
sctp_cmd_seq_t commands;
sctp_sm_table_entry_t *state_fn;
......@@ -701,9 +701,8 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
DEBUG_POST;
error = sctp_side_effects(event_type, subtype, state,
ep, asoc, event_arg,
status, &commands,
priority);
ep, asoc, event_arg, status,
&commands, gfp);
DEBUG_POST_SFX;
return error;
......@@ -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,
sctp_state_t state,
sctp_endpoint_t *ep,
sctp_association_t *asoc,
struct sctp_endpoint *ep,
struct sctp_association *asoc,
void *event_arg,
sctp_disposition_t status,
sctp_cmd_seq_t *commands,
int priority)
int gfp)
{
int error;
......@@ -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,
ep, asoc,
event_arg, status,
commands, priority)))
commands, gfp)))
goto bail;
switch (status) {
......@@ -803,10 +802,10 @@ int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
/* This is the side-effect interpreter. */
int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
sctp_state_t state, sctp_endpoint_t *ep,
sctp_association_t *asoc, void *event_arg,
sctp_state_t state, struct sctp_endpoint *ep,
struct sctp_association *asoc, void *event_arg,
sctp_disposition_t status, sctp_cmd_seq_t *commands,
int priority)
int gfp)
{
int error = 0;
int force;
......@@ -903,7 +902,7 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
* layer which will bail.
*/
error = sctp_cmd_process_init(commands, asoc, chunk,
cmd->obj.ptr, priority);
cmd->obj.ptr, gfp);
break;
case SCTP_CMD_GEN_COOKIE_ECHO:
......
......@@ -95,8 +95,8 @@
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_do_4_C(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_5_1B_init(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
sctp_chunk_t *chunk = arg;
sctp_chunk_t *repl;
sctp_association_t *new_asoc;
struct sctp_association *new_asoc;
sctp_chunk_t *err_chunk;
struct sctp_packet *packet;
sctp_unrecognized_param_t *unk_param;
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_5_1C_ack(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_5_1D_ce(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands)
{
sctp_chunk_t *chunk = arg;
sctp_association_t *new_asoc;
struct sctp_association *new_asoc;
sctp_init_chunk_t *peer_init;
sctp_chunk_t *repl;
struct sctp_ulpevent *ev;
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_5_1E_ca(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands)
{
......@@ -697,8 +697,8 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const sctp_endpoint_t *ep,
}
/* Generate and sendout a heartbeat packet. */
sctp_disposition_t sctp_sf_heartbeat(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -730,8 +730,8 @@ sctp_disposition_t sctp_sf_heartbeat(const sctp_endpoint_t *ep,
}
/* Generate a HEARTBEAT packet on the given transport. */
sctp_disposition_t sctp_sf_sendbeat_8_3(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_beat_8_3(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_backbeat_8_3(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -926,7 +926,7 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa,
struct sctp_packet *pkt;
sctp_addr_param_t *addrparm;
sctp_errhdr_t *errhdr;
sctp_endpoint_t *ep;
struct sctp_endpoint *ep;
char buffer[sizeof(sctp_errhdr_t) + sizeof(sctp_addr_param_t)];
/* 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,
/* A restart is occurring, check to make sure no new addresses
* are being added as we may be under a takeover attack.
*/
static int sctp_sf_check_restart_addrs(const sctp_association_t *new_asoc,
const sctp_association_t *asoc,
static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc,
const struct sctp_association *asoc,
sctp_chunk_t *init,
sctp_cmd_seq_t *commands)
{
......@@ -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.
*/
static void sctp_tietags_populate(sctp_association_t *new_asoc,
const sctp_association_t *asoc)
static void sctp_tietags_populate(struct sctp_association *new_asoc,
const struct sctp_association *asoc)
{
switch (asoc->state) {
......@@ -1069,8 +1069,8 @@ static void sctp_tietags_populate(sctp_association_t *new_asoc,
* Returns value representing action to be taken. These action values
* correspond to Action/Description values in RFC 2960, Table 2.
*/
static char sctp_tietags_compare(sctp_association_t *new_asoc,
const sctp_association_t *asoc)
static char sctp_tietags_compare(struct sctp_association *new_asoc,
const struct sctp_association *asoc)
{
/* In this case, the peer may have restarted. */
if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
......@@ -1106,15 +1106,15 @@ static char sctp_tietags_compare(sctp_association_t *new_asoc,
* chunk handling.
*/
static sctp_disposition_t sctp_sf_do_unexpected_init(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg, sctp_cmd_seq_t *commands)
{
sctp_disposition_t retval;
sctp_chunk_t *chunk = arg;
sctp_chunk_t *repl;
sctp_association_t *new_asoc;
struct sctp_association *new_asoc;
sctp_chunk_t *err_chunk;
struct sctp_packet *packet;
sctp_unrecognized_param_t *unk_param;
......@@ -1303,8 +1303,8 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_do_5_2_1_siminit(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_2_1_siminit(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -1356,8 +1356,8 @@ sctp_disposition_t sctp_sf_do_5_2_1_siminit(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -1375,11 +1375,11 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const sctp_endpoint_t *ep,
* Section 5.2.4
* A) In this case, the peer may have restarted.
*/
static sctp_disposition_t sctp_sf_do_dupcook_a(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc)
struct sctp_association *new_asoc)
{
sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev;
......@@ -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
*/
/* This case represents an initialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc)
struct sctp_association *new_asoc)
{
sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev;
......@@ -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.
*/
/* This case represents an intialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_c(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
static sctp_disposition_t sctp_sf_do_dupcook_c(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc)
struct sctp_association *new_asoc)
{
/* The cookie should be silently discarded.
* 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,
* enter the ESTABLISHED state, if it has not already done so.
*/
/* This case represents an intialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_d(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands,
sctp_association_t *new_asoc)
struct sctp_association *new_asoc)
{
struct sctp_ulpevent *ev = NULL;
sctp_chunk_t *repl;
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
sctp_disposition_t retval;
sctp_chunk_t *chunk = arg;
sctp_association_t *new_asoc;
struct sctp_association *new_asoc;
int error = 0;
char action;
sctp_chunk_t *err_chk_p;
......@@ -1701,8 +1701,9 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const sctp_endpoint_t *ep,
*
* See sctp_sf_do_9_1_abort().
*/
sctp_disposition_t sctp_sf_shutdown_pending_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_shutdown_pending_abort(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -1724,8 +1725,8 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort(const sctp_endpoint_t *ep,
*
* See sctp_sf_do_9_1_abort().
*/
sctp_disposition_t sctp_sf_shutdown_sent_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -1751,8 +1752,9 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const sctp_endpoint_t *ep,
*
* See sctp_sf_do_9_1_abort().
*/
sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -1777,8 +1779,8 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_abort(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_cookie_echoed_err(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_cookie_echoed_err(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_5_2_6_stale(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -1977,8 +1979,8 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const sctp_endpoint_t *ep,
*
* See sctp_sf_do_9_1_abort() above.
*/
sctp_disposition_t sctp_sf_cookie_wait_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_cookie_echoed_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_cookie_echoed_abort(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_9_2_shutdown(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -2111,8 +2113,8 @@ 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
* retransmit the SHUTDOWN ACK chunk.
*/
sctp_disposition_t sctp_sf_do_9_2_reshutack(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_2_reshutack(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_ecn_cwr(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_ecne(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_ecne(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -2537,8 +2539,8 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_eat_data_fast_4_4(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_eat_sack_6_2(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_tabort_8_4_8(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_operr_notify(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -2856,8 +2858,8 @@ sctp_disposition_t sctp_sf_operr_notify(const sctp_endpoint_t *ep,
*
* The return value is the disposition.
*/
sctp_disposition_t sctp_sf_do_9_2_final(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* packet shall discard the OOTB packet and take no further action.
*/
sctp_disposition_t sctp_sf_ootb(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -2975,8 +2977,8 @@ sctp_disposition_t sctp_sf_ootb(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_shut_8_4_5(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3024,8 +3026,8 @@ sctp_disposition_t sctp_sf_shut_8_4_5(const sctp_endpoint_t *ep,
* chunks. --piggy ]
*
*/
sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
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,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_unk_chunk(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_discard_chunk(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_discard_chunk(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_pdiscard(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_pdiscard(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3198,8 +3200,8 @@ sctp_disposition_t sctp_sf_pdiscard(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t lucky(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t lucky(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3235,8 +3237,8 @@ sctp_disposition_t lucky(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t other_stupid(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t other_stupid(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* the violation and continue.
*/
sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_violation(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* SCTP is not able to open an SCTP association with the peer endpoint,
* 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.]
*
* Other association parameters may be returned, including the
......@@ -3340,8 +3342,8 @@ sctp_disposition_t sctp_sf_violation(const sctp_endpoint_t *ep,
*
* The return value is a disposition.
*/
sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3371,7 +3373,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep,
* rerun it through as a sideffect.
*/
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
* enters the COOKIE-WAIT state.
......@@ -3446,8 +3448,8 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const sctp_endpoint_t *ep,
*
* The return value is the disposition.
*/
sctp_disposition_t sctp_sf_do_prm_send(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_prm_send(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3484,8 +3486,9 @@ sctp_disposition_t sctp_sf_do_prm_send(const sctp_endpoint_t *ep,
*
* The return value is the disposition.
*/
sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3545,8 +3548,9 @@ sctp_disposition_t sctp_sf_do_9_2_prm_shutdown(const sctp_endpoint_t *ep,
*
* The return value is the disposition.
*/
sctp_disposition_t sctp_sf_do_9_1_prm_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_1_prm_abort(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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. */
sctp_disposition_t sctp_sf_error_closed(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_error_closed(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* down.
*/
sctp_disposition_t sctp_sf_error_shutdown(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_error_shutdown(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3626,8 +3630,8 @@ sctp_disposition_t sctp_sf_error_shutdown(const sctp_endpoint_t *ep,
* (timers)
*/
sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3660,8 +3664,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown(
* (timers)
*/
sctp_disposition_t sctp_sf_cookie_echoed_prm_shutdown(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg, sctp_cmd_seq_t *commands)
{
......@@ -3685,8 +3689,9 @@ sctp_disposition_t sctp_sf_cookie_echoed_prm_shutdown(
* Outputs
* (timers)
*/
sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_cookie_wait_prm_abort(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3737,8 +3742,9 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(const sctp_endpoint_t *ep,
* Outputs
* (timers)
*/
sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3762,8 +3768,8 @@ sctp_disposition_t sctp_sf_cookie_echoed_prm_abort(const sctp_endpoint_t *ep,
* (timers)
*/
sctp_disposition_t sctp_sf_shutdown_pending_prm_abort(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3788,8 +3794,8 @@ sctp_disposition_t sctp_sf_shutdown_pending_prm_abort(
* (timers)
*/
sctp_disposition_t sctp_sf_shutdown_sent_prm_abort(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3818,8 +3824,8 @@ sctp_disposition_t sctp_sf_shutdown_sent_prm_abort(
* (timers)
*/
sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3853,8 +3859,8 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort(
* association on which a heartbeat should be issued.
*/
sctp_disposition_t sctp_sf_do_prm_requestheartbeat(
const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3868,8 +3874,9 @@ sctp_disposition_t sctp_sf_do_prm_requestheartbeat(
*
* The return value is the disposition of the primitive.
*/
sctp_disposition_t sctp_sf_ignore_primitive(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_ignore_primitive(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3895,8 +3902,9 @@ sctp_disposition_t sctp_sf_ignore_primitive(const sctp_endpoint_t *ep,
*
* The return value is the disposition.
*/
sctp_disposition_t sctp_sf_do_9_2_start_shutdown(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_2_start_shutdown(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -3956,8 +3964,9 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown(const sctp_endpoint_t *ep,
*
* The return value is the disposition.
*/
sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_ignore_other(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_ignore_other(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_do_6_3_3_rtx(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* the following algorithms allow.
*/
sctp_disposition_t sctp_sf_do_6_2_sack(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_do_6_2_sack(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -4137,8 +4146,8 @@ sctp_disposition_t sctp_sf_do_6_2_sack(const sctp_endpoint_t *ep,
* (timers, events)
*
*/
sctp_disposition_t sctp_sf_t1_timer_expire(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_t1_timer_expire(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* 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,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* by sending an ABORT chunk.
*/
sctp_disposition_t sctp_sf_t5_timer_expire(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -4292,8 +4301,9 @@ 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 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,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_autoclose_timer_expire(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_not_impl(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_not_impl(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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.
*/
sctp_disposition_t sctp_sf_bug(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_bug(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -4374,8 +4384,8 @@ sctp_disposition_t sctp_sf_bug(const sctp_endpoint_t *ep,
*
* The return value is the disposition of the chunk.
*/
sctp_disposition_t sctp_sf_timer_ignore(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
sctp_disposition_t sctp_sf_timer_ignore(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
......@@ -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
* error causes.
*/
struct sctp_packet *sctp_abort_pkt_new(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
sctp_chunk_t *chunk,
const void *payload,
size_t paylen)
......@@ -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. */
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)
{
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 */
void sctp_send_stale_cookie_err(const sctp_endpoint_t *ep,
const sctp_association_t *asoc,
void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_chunk_t *chunk,
sctp_cmd_seq_t *commands,
sctp_chunk_t *err_chunk)
......
......@@ -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 (!list_empty(&sctp_sk(sk)->ep->asocs))
asoc = list_entry(sctp_sk(sk)->ep->asocs.next,
sctp_association_t, asocs);
struct sctp_association, asocs);
return asoc;
}
/* First, verify that this is a kernel address. */
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
* data structure and if so, that the socket matches.
*/
temp = (struct sctp_association *)id;
if ((SCTP_ASSOC_EYECATCHER == temp->eyecatcher) &&
(temp->base.sk == sk))
asoc = temp;
......@@ -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)
{
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;
struct sctp_af *af;
unsigned short snum;
......@@ -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. */
if (retval >= 0) {
struct list_head *pos;
sctp_endpoint_t *ep;
sctp_association_t *asoc;
struct sctp_endpoint *ep;
struct sctp_association *asoc;
ep = sctp_sk(sk)->ep;
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_ADD_IP,
......@@ -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)
{
struct sctp_opt *sp = sctp_sk(sk);
sctp_endpoint_t *ep = sp->ep;
struct sctp_endpoint *ep = sp->ep;
int cnt;
sctp_bind_addr_t *bp = &ep->base.bind_addr;
int retval = 0;
......@@ -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. */
if (retval >= 0) {
struct list_head *pos;
sctp_endpoint_t *ep;
sctp_association_t *asoc;
struct sctp_endpoint *ep;
struct sctp_association *asoc;
ep = sctp_sk(sk)->ep;
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,
addrs, addrcnt);
}
......@@ -673,8 +674,8 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
*/
SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
{
sctp_endpoint_t *ep;
sctp_association_t *asoc;
struct sctp_endpoint *ep;
struct sctp_association *asoc;
struct list_head *pos, *temp;
SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p...)\n", sk);
......@@ -686,7 +687,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
/* Walk all associations on a socket, not on an endpoint. */
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);
}
......@@ -746,8 +747,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, int msg_len)
{
struct sctp_opt *sp;
sctp_endpoint_t *ep;
sctp_association_t *new_asoc=NULL, *asoc=NULL;
struct sctp_endpoint *ep;
struct sctp_association *new_asoc=NULL, *asoc=NULL;
struct sctp_transport *transport;
sctp_chunk_t *chunk = NULL;
union sctp_addr to;
......@@ -1275,7 +1276,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
char *optval, int optlen)
{
struct sctp_paddrparams params;
sctp_association_t *asoc;
struct sctp_association *asoc;
union sctp_addr *addr;
struct sctp_transport *trans;
int error;
......@@ -1357,7 +1358,7 @@ static int sctp_setsockopt_default_send_param(struct sock *sk,
char *optval, int optlen)
{
struct sctp_sndrcvinfo info;
sctp_association_t *asoc;
struct sctp_association *asoc;
if (optlen != sizeof(struct sctp_sndrcvinfo))
return -EINVAL;
......@@ -1569,8 +1570,8 @@ SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len)
{
struct sctp_opt *sp;
sctp_endpoint_t *ep;
sctp_association_t *asoc;
struct sctp_endpoint *ep;
struct sctp_association *asoc;
struct sctp_transport *transport;
union sctp_addr to;
sctp_scope_t scope;
......@@ -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_endpoint_t *ep;
struct sctp_endpoint *ep;
struct sctp_protocol *proto;
struct sctp_opt *sp;
......@@ -1992,7 +1993,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc,
return err;
/* 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);
*sockp = sock;
......@@ -2005,22 +2006,22 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int *
sctp_peeloff_arg_t peeloff;
struct socket *newsock;
int retval = 0;
sctp_association_t *assoc;
struct sctp_association *asoc;
if (len != sizeof(sctp_peeloff_arg_t))
return -EINVAL;
if (copy_from_user(&peeloff, optval, len))
return -EFAULT;
assoc = sctp_id2assoc(sk, peeloff.associd);
if (!assoc) {
asoc = sctp_id2assoc(sk, peeloff.associd);
if (!asoc) {
retval = -EINVAL;
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)
goto out;
......@@ -2031,8 +2032,8 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char *optval, int *
goto out;
}
SCTP_DEBUG_PRINTK("%s: sk: %p assoc: %p newsk: %p sd: %d\n",
__FUNCTION__, sk, assoc, newsock->sk, retval);
SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p newsk: %p sd: %d\n",
__FUNCTION__, sk, asoc, newsock->sk, retval);
/* Return the fd mapped to the new socket. */
peeloff.sd = retval;
......@@ -2047,7 +2048,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
char *optval, int *optlen)
{
struct sctp_paddrparams params;
sctp_association_t *asoc;
struct sctp_association *asoc;
union sctp_addr *addr;
struct sctp_transport *trans;
......@@ -2100,7 +2101,7 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len,
char *optval, int *optlen)
{
sctp_assoc_t id;
sctp_association_t *asoc;
struct sctp_association *asoc;
struct list_head *pos;
int cnt = 0;
......@@ -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,
char *optval, int *optlen)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
struct list_head *pos;
int cnt = 0;
struct sctp_getaddrs getaddrs;
......@@ -2171,7 +2172,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
{
sctp_assoc_t id;
sctp_bind_addr_t *bp;
sctp_association_t *asoc;
struct sctp_association *asoc;
struct list_head *pos;
int cnt = 0;
......@@ -2209,7 +2210,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
char *optval, int *optlen)
{
sctp_bind_addr_t *bp;
sctp_association_t *asoc;
struct sctp_association *asoc;
struct list_head *pos;
int cnt = 0;
struct sctp_getaddrs getaddrs;
......@@ -2311,7 +2312,7 @@ static int sctp_getsockopt_default_send_param(struct sock *sk,
int len, char *optval, int *optlen)
{
struct sctp_sndrcvinfo info;
sctp_association_t *asoc;
struct sctp_association *asoc;
if (len != sizeof(struct sctp_sndrcvinfo))
return -EINVAL;
......@@ -2572,7 +2573,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
* in an endpoint.
*/
for ( ; sk2 != NULL; sk2 = sk2->bind_next) {
sctp_endpoint_t *ep2;
struct sctp_endpoint *ep2;
ep2 = sctp_sk(sk2)->ep;
if (sk_reuse && sk2->reuse)
......@@ -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)
{
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
* listen().
......@@ -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)
{
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)
return 0;
......@@ -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. */
static inline int sctp_wspace(sctp_association_t *asoc)
static inline int sctp_wspace(struct sctp_association *asoc)
{
struct sock *sk = asoc->base.sk;
int amt = 0;
......@@ -3195,7 +3196,7 @@ static inline int sctp_wspace(sctp_association_t *asoc)
*/
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;
/* The sndbuf space is tracked per association. */
......@@ -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. */
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 socket *sock = sk->socket;
......@@ -3240,7 +3241,7 @@ static void __sctp_write_space(sctp_association_t *asoc)
*/
static void sctp_wfree(struct sk_buff *skb)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
sctp_chunk_t *chunk;
struct sock *sk;
......@@ -3256,7 +3257,7 @@ static void sctp_wfree(struct sk_buff *skb)
}
/* 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)
{
struct sock *sk = asoc->base.sk;
......@@ -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. */
void sctp_write_space(struct sock *sk)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
struct list_head *pos;
/* Wake up the tasks in each wait queue. */
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);
}
}
......@@ -3353,7 +3354,7 @@ static int sctp_writeable(struct sock *sk)
/* Wait for an association to go into ESTABLISHED state. If timeout is 0,
* 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;
int err = 0;
......@@ -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 *newsp = sctp_sk(newsk);
sctp_endpoint_t *newep = newsp->ep;
struct sctp_endpoint *newep = newsp->ep;
struct sk_buff *skb, *tmp;
struct sctp_ulpevent *event;
......
......@@ -53,11 +53,11 @@ static inline size_t sctp_ssnmap_size(__u16 in, __u16 out)
/* Create a new sctp_ssnmap.
* 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;
retval = kmalloc(sctp_ssnmap_size(in, out), priority);
retval = kmalloc(sctp_ssnmap_size(in, out), gfp);
if (!retval)
goto fail;
......
......@@ -54,16 +54,15 @@
/* 1st Level Abstractions. */
/* Allocate and initialize a new transport. */
struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
int priority)
struct sctp_transport *sctp_transport_new(const union sctp_addr *addr, int gfp)
{
struct sctp_transport *transport;
transport = t_new(struct sctp_transport, priority);
transport = t_new(struct sctp_transport, gfp);
if (!transport)
goto fail;
if (!sctp_transport_init(transport, addr, priority))
if (!sctp_transport_init(transport, addr, gfp))
goto fail_init;
transport->malloced = 1;
......@@ -81,7 +80,7 @@ struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
/* Intialize a new transport from provided memory. */
struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
const union sctp_addr *addr,
int priority)
int gfp)
{
struct sctp_protocol *proto = sctp_get_protocol();
......@@ -199,7 +198,7 @@ void sctp_transport_reset_timers(struct sctp_transport *transport)
* Register the reference count in the association.
*/
void sctp_transport_set_owner(struct sctp_transport *transport,
sctp_association_t *asoc)
struct sctp_association *asoc)
{
transport->asoc = asoc;
sctp_association_hold(asoc);
......@@ -225,7 +224,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
void sctp_transport_route(struct sctp_transport *transport,
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;
union sctp_addr *daddr = &transport->ipaddr;
struct dst_entry *dst;
......
......@@ -55,13 +55,12 @@ static void sctp_tsnmap_find_gap_ack(__u8 *map, __u16 off,
/* Create a new sctp_tsnmap.
* 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;
retval = kmalloc(sizeof(struct sctp_tsnmap) +
sctp_tsnmap_storage_size(len),
priority);
sctp_tsnmap_storage_size(len), gfp);
if (!retval)
goto fail;
......
......@@ -52,12 +52,12 @@ static void sctp_ulpevent_set_owner(struct sk_buff *skb,
const struct sctp_association *asoc);
/* 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 sk_buff *skb;
skb = alloc_skb(size, priority);
skb = alloc_skb(size, gfp);
if (!skb)
goto fail;
......@@ -106,16 +106,16 @@ int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event)
* zero'd out.
*/
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 inbound, int priority)
__u16 inbound, int gfp)
{
struct sctp_ulpevent *event;
struct sctp_assoc_change *sac;
struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
MSG_NOTIFICATION, priority);
MSG_NOTIFICATION, gfp);
if (!event)
goto fail;
skb = sctp_event2skb(event);
......@@ -207,15 +207,16 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
* an interface details event is sent.
*/
struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
const sctp_association_t *asoc, const struct sockaddr_storage *aaddr,
int flags, int state, int error, int priority)
const struct sctp_association *asoc,
const struct sockaddr_storage *aaddr,
int flags, int state, int error, int gfp)
{
struct sctp_ulpevent *event;
struct sctp_paddr_change *spc;
struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_paddr_change),
MSG_NOTIFICATION, priority);
MSG_NOTIFICATION, gfp);
if (!event)
goto fail;
......@@ -315,8 +316,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
* error formats.
*/
struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
const sctp_association_t *asoc, sctp_chunk_t *chunk,
__u16 flags, int priority)
const struct sctp_association *asoc, sctp_chunk_t *chunk,
__u16 flags, int gfp)
{
struct sctp_ulpevent *event;
struct sctp_remote_error *sre;
......@@ -338,7 +339,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
skb = skb_copy_expand(chunk->skb,
sizeof(struct sctp_remote_error), /* headroom */
0, /* tailroom */
priority);
gfp);
/* Pull off the rest of the cause TLV from the chunk. */
skb_pull(chunk->skb, elen);
......@@ -419,8 +420,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
* 5.3.1.4 SCTP_SEND_FAILED
*/
struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
const sctp_association_t *asoc, sctp_chunk_t *chunk,
__u16 flags, __u32 error, int priority)
const struct sctp_association *asoc, sctp_chunk_t *chunk,
__u16 flags, __u32 error, int gfp)
{
struct sctp_ulpevent *event;
struct sctp_send_failed *ssf;
......@@ -430,7 +431,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
skb = skb_copy_expand(chunk->skb,
sizeof(struct sctp_send_failed), /* headroom */
0, /* tailroom */
priority);
gfp);
if (!skb)
goto fail;
......@@ -521,15 +522,15 @@ struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
* 5.3.1.5 SCTP_SHUTDOWN_EVENT
*/
struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
const sctp_association_t *asoc,
__u16 flags, int priority)
const struct sctp_association *asoc,
__u16 flags, int gfp)
{
struct sctp_ulpevent *event;
struct sctp_shutdown_event *sse;
struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
MSG_NOTIFICATION, priority);
MSG_NOTIFICATION, gfp);
if (!event)
goto fail;
......@@ -586,8 +587,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
* Socket Extensions for SCTP
* 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
*/
struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
sctp_chunk_t *chunk, int priority)
struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
sctp_chunk_t *chunk, int gfp)
{
struct sctp_ulpevent *event;
struct sctp_sndrcvinfo *info;
......@@ -595,7 +596,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
size_t padding, len;
/* Clone the original skb, sharing the data. */
skb = skb_clone(chunk->skb, priority);
skb = skb_clone(chunk->skb, gfp);
if (!skb)
goto fail;
......@@ -741,14 +742,14 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(sctp_association_t *asoc,
* various events.
*/
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_rcv_pdapi_event *pd;
struct sk_buff *skb;
event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
MSG_NOTIFICATION, priority);
MSG_NOTIFICATION, gfp);
if (!event)
goto fail;
......@@ -817,7 +818,7 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
/* Do accounting for bytes just read by user. */
static void sctp_rcvmsg_rfree(struct sk_buff *skb)
{
sctp_association_t *asoc;
struct sctp_association *asoc;
struct sctp_ulpevent *event;
/* Current stack structures assume that the rcv buffer is
......@@ -834,7 +835,7 @@ static void sctp_rcvmsg_rfree(struct sk_buff *skb)
/* Charge receive window for bytes received. */
static void sctp_ulpevent_set_owner_r(struct sk_buff *skb,
sctp_association_t *asoc)
struct sctp_association *asoc)
{
struct sctp_ulpevent *event;
......
......@@ -57,11 +57,11 @@ static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *,
/* 1st Level Abstractions */
/* 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;
ulpq = kmalloc(sizeof(struct sctp_ulpq), priority);
ulpq = kmalloc(sizeof(struct sctp_ulpq), gfp);
if (!ulpq)
goto fail;
if (!sctp_ulpq_init(ulpq, asoc))
......@@ -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. */
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);
......@@ -119,7 +119,7 @@ void sctp_ulpq_free(struct sctp_ulpq *ulpq)
/* Process an incoming DATA chunk. */
int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, sctp_chunk_t *chunk,
int priority)
int gfp)
{
struct sk_buff_head temp;
sctp_data_chunk_t *hdr;
......@@ -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;
/* 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)
return -ENOMEM;
......@@ -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. */
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_association *asoc;
......@@ -729,7 +729,7 @@ void sctp_ulpq_partial_delivery(struct sctp_ulpq *ulpq,
/* Renege some packets to make room for an incoming chunk. */
void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
int priority)
int gfp)
{
struct sctp_association *asoc;
__u16 needed, freed;
......@@ -755,9 +755,9 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
__u32 tsn;
tsn = ntohl(chunk->subh.data_hdr->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;
......@@ -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
* 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 sock *sk;
......@@ -781,7 +781,7 @@ void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, int priority)
&sctp_sk(sk)->subscribe))
ev = sctp_ulpevent_make_pdapi(ulpq->asoc,
SCTP_PARTIAL_DELIVERY_ABORTED,
priority);
gfp);
if (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