Commit eb643da0 authored by Jon Grimm's avatar Jon Grimm

[SCTP] More typedef removals.

Continue typedef removal.  Also, change sctp_chunk.num_times_sent
counter to a resent flag.  There was a rather obscure, unlikely,
and in the end fairly benign bug sitting there if num_times_sent 
wrapped.  However, there's no need to keep this counter, as its
use was really just to know if we'd ever resent this chunk. 
parent 2dd53b84
...@@ -209,66 +209,66 @@ __u32 sctp_generate_verification_tag(void); ...@@ -209,66 +209,66 @@ __u32 sctp_generate_verification_tag(void);
void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
/* Prototypes for chunk-building functions. */ /* Prototypes for chunk-building functions. */
sctp_chunk_t *sctp_make_init(const struct sctp_association *, struct sctp_chunk *sctp_make_init(const struct sctp_association *,
const sctp_bind_addr_t *, const struct sctp_bind_addr *,
int gfp, int vparam_len); int gfp, int vparam_len);
sctp_chunk_t *sctp_make_init_ack(const struct sctp_association *, struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *,
const sctp_chunk_t *, const struct sctp_chunk *,
const int gfp, const int gfp,
const int unkparam_len); const int unkparam_len);
sctp_chunk_t *sctp_make_cookie_echo(const struct sctp_association *, struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *,
const sctp_chunk_t *); const struct sctp_chunk *);
sctp_chunk_t *sctp_make_cookie_ack(const struct sctp_association *, struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *,
const sctp_chunk_t *); const struct sctp_chunk *);
sctp_chunk_t *sctp_make_cwr(const struct sctp_association *, struct sctp_chunk *sctp_make_cwr(const struct sctp_association *,
const __u32 lowest_tsn, const __u32 lowest_tsn,
const sctp_chunk_t *); const struct sctp_chunk *);
sctp_chunk_t *sctp_make_datafrag(struct sctp_association *, struct sctp_chunk *sctp_make_datafrag(struct sctp_association *,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int len, const __u8 *data, int len, const __u8 *data,
__u8 flags, __u16 ssn); __u8 flags, __u16 ssn);
sctp_chunk_t * sctp_make_datafrag_empty(struct sctp_association *, struct sctp_chunk * sctp_make_datafrag_empty(struct sctp_association *,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int len, const __u8 flags, int len, const __u8 flags,
__u16 ssn); __u16 ssn);
sctp_chunk_t *sctp_make_data(struct sctp_association *, struct sctp_chunk *sctp_make_data(struct sctp_association *,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int len, const __u8 *data); int len, const __u8 *data);
sctp_chunk_t *sctp_make_data_empty(struct sctp_association *, struct sctp_chunk *sctp_make_data_empty(struct sctp_association *,
const struct sctp_sndrcvinfo *, int len); const struct sctp_sndrcvinfo *, int len);
sctp_chunk_t *sctp_make_ecne(const struct sctp_association *, struct sctp_chunk *sctp_make_ecne(const struct sctp_association *,
const __u32); const __u32);
sctp_chunk_t *sctp_make_sack(const struct sctp_association *); struct sctp_chunk *sctp_make_sack(const struct sctp_association *);
sctp_chunk_t *sctp_make_shutdown(const struct sctp_association *asoc); struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc);
sctp_chunk_t *sctp_make_shutdown_ack(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc,
const sctp_chunk_t *); const struct sctp_chunk *);
sctp_chunk_t *sctp_make_shutdown_complete(const struct sctp_association *, struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *,
const sctp_chunk_t *); const struct sctp_chunk *);
void sctp_init_cause(sctp_chunk_t *, __u16 cause, const void *, size_t); void sctp_init_cause(struct sctp_chunk *, __u16 cause, const void *, size_t);
sctp_chunk_t *sctp_make_abort(const struct sctp_association *, struct sctp_chunk *sctp_make_abort(const struct sctp_association *,
const sctp_chunk_t *, const struct sctp_chunk *,
const size_t hint); const size_t hint);
sctp_chunk_t *sctp_make_abort_no_data(const struct sctp_association *, struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *,
const sctp_chunk_t *, const struct sctp_chunk *,
__u32 tsn); __u32 tsn);
sctp_chunk_t *sctp_make_abort_user(const struct sctp_association *, struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *,
const sctp_chunk_t *, const struct sctp_chunk *,
const struct msghdr *); const struct msghdr *);
sctp_chunk_t *sctp_make_heartbeat(const struct sctp_association *, struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
const struct sctp_transport *, const struct sctp_transport *,
const void *payload, const void *payload,
const size_t paylen); const size_t paylen);
sctp_chunk_t *sctp_make_heartbeat_ack(const struct sctp_association *, struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *,
const sctp_chunk_t *, const struct sctp_chunk *,
const void *payload, const void *payload,
const size_t paylen); const size_t paylen);
sctp_chunk_t *sctp_make_op_error(const struct sctp_association *, struct sctp_chunk *sctp_make_op_error(const struct sctp_association *,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
__u16 cause_code, __u16 cause_code,
const void *payload, const void *payload,
size_t paylen); size_t paylen);
void sctp_chunk_assign_tsn(sctp_chunk_t *); void sctp_chunk_assign_tsn(struct sctp_chunk *);
void sctp_chunk_assign_ssn(sctp_chunk_t *); void sctp_chunk_assign_ssn(struct sctp_chunk *);
int sctp_datachunks_from_user(struct sctp_association *, int sctp_datachunks_from_user(struct sctp_association *,
const struct sctp_sndrcvinfo *, const struct sctp_sndrcvinfo *,
struct msghdr *, int len, struct msghdr *, int len,
...@@ -306,12 +306,12 @@ sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -306,12 +306,12 @@ sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
int sctp_gen_sack(struct sctp_association *, int force, sctp_cmd_seq_t *); 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_do_TSNdup(struct sctp_association *, struct sctp_chunk *, long gap);
void sctp_generate_t3_rtx_event(unsigned long peer); void sctp_generate_t3_rtx_event(unsigned long peer);
void sctp_generate_heartbeat_event(unsigned long peer); void sctp_generate_heartbeat_event(unsigned long peer);
sctp_sackhdr_t *sctp_sm_pull_sack(sctp_chunk_t *); sctp_sackhdr_t *sctp_sm_pull_sack(struct sctp_chunk *);
struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *, struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *,
const struct sctp_association *, const struct sctp_association *,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
...@@ -327,15 +327,15 @@ sctp_pack_cookie(const struct sctp_endpoint *, const struct sctp_association *, ...@@ -327,15 +327,15 @@ sctp_pack_cookie(const struct sctp_endpoint *, const struct sctp_association *,
const __u8 *, int addrs_len); const __u8 *, int addrs_len);
struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *, struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *,
const struct sctp_association *, const struct sctp_association *,
sctp_chunk_t *, int gfp, int *err, struct sctp_chunk *, int gfp, int *err,
sctp_chunk_t **err_chk_p); struct sctp_chunk **err_chk_p);
int sctp_addip_addr_config(struct sctp_association *, sctp_param_t, int sctp_addip_addr_config(struct sctp_association *, sctp_param_t,
struct sockaddr_storage*, int); struct sockaddr_storage*, int);
void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep, void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_chunk_t *err_chunk); struct sctp_chunk *err_chunk);
/* 3rd level prototypes */ /* 3rd level prototypes */
__u32 sctp_generate_tag(const struct sctp_endpoint *); __u32 sctp_generate_tag(const struct sctp_endpoint *);
...@@ -361,7 +361,7 @@ extern sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES]; ...@@ -361,7 +361,7 @@ extern sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES];
/* Get the size of a DATA chunk payload. */ /* Get the size of a DATA chunk payload. */
static inline __u16 sctp_data_size(sctp_chunk_t *chunk) static inline __u16 sctp_data_size(struct sctp_chunk *chunk)
{ {
__u16 size; __u16 size;
...@@ -449,7 +449,7 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a ...@@ -449,7 +449,7 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a
* tag and the T bit is set in the Chunk Flags. * tag and the T bit is set in the Chunk Flags.
*/ */
static inline int static inline int
sctp_vtag_verify_either(const sctp_chunk_t *chunk, sctp_vtag_verify_either(const struct sctp_chunk *chunk,
const struct sctp_association *asoc) const struct sctp_association *asoc)
{ {
/* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2
......
...@@ -86,8 +86,6 @@ struct sctp_opt; ...@@ -86,8 +86,6 @@ struct sctp_opt;
struct sctp_ep_common; struct sctp_ep_common;
struct sctp_ssnmap; struct sctp_ssnmap;
typedef struct sctp_chunk sctp_chunk_t;
typedef struct sctp_bind_addr sctp_bind_addr_t;
#include <net/sctp/tsnmap.h> #include <net/sctp/tsnmap.h>
#include <net/sctp/ulpevent.h> #include <net/sctp/ulpevent.h>
...@@ -464,8 +462,8 @@ struct sctp_chunk { ...@@ -464,8 +462,8 @@ struct sctp_chunk {
* three elements of struct sk_buff. This allows us to reuse * three elements of struct sk_buff. This allows us to reuse
* all the skb_* queue management functions. * all the skb_* queue management functions.
*/ */
sctp_chunk_t *next; struct sctp_chunk *next;
sctp_chunk_t *prev; struct sctp_chunk *prev;
struct sk_buff_head *list; struct sk_buff_head *list;
/* This is our link to the per-transport transmitted list. */ /* This is our link to the per-transport transmitted list. */
...@@ -522,13 +520,13 @@ struct sctp_chunk { ...@@ -522,13 +520,13 @@ struct sctp_chunk {
unsigned long sent_at; unsigned long sent_at;
__u8 rtt_in_progress; /* Is this chunk used for RTT calculation? */ __u8 rtt_in_progress; /* Is this chunk used for RTT calculation? */
__u8 num_times_sent; /* How man times did we send this? */ __u8 resent; /* Has this chunk ever been retransmitted. */
__u8 has_tsn; /* Does this chunk have a TSN yet? */ __u8 has_tsn; /* Does this chunk have a TSN yet? */
__u8 has_ssn; /* Does this chunk have a SSN yet? */ __u8 has_ssn; /* Does this chunk have a SSN yet? */
__u8 singleton; /* Was this the only chunk in the packet? */ __u8 singleton; /* Was this the only chunk in the packet? */
__u8 end_of_packet; /* Was this the last chunk in the packet? */ __u8 end_of_packet; /* Was this the last chunk in the packet? */
__u8 ecn_ce_done; /* Have we processed the ECN CE bit? */ __u8 ecn_ce_done; /* Have we processed the ECN CE bit? */
__u8 pdiscard; /* Discard the whole packet now? */ __u8 pdiscard; /* Discard the whole packet now? */
__u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */
__u8 fast_retransmit; /* Is this chunk fast retransmitted? */ __u8 fast_retransmit; /* Is this chunk fast retransmitted? */
__u8 tsn_missing_report; /* Data chunk missing counter. */ __u8 tsn_missing_report; /* Data chunk missing counter. */
...@@ -545,14 +543,16 @@ struct sctp_chunk { ...@@ -545,14 +543,16 @@ struct sctp_chunk {
struct sctp_transport *transport; struct sctp_transport *transport;
}; };
sctp_chunk_t *sctp_make_chunk(const struct sctp_association *, __u8 type, struct sctp_chunk *sctp_make_chunk(const struct sctp_association *, __u8 type,
__u8 flags, int size); __u8 flags, int size);
void sctp_free_chunk(sctp_chunk_t *); void sctp_free_chunk(struct sctp_chunk *);
void *sctp_addto_chunk(sctp_chunk_t *chunk, int len, const void *data); void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
sctp_chunk_t *sctp_chunkify(struct sk_buff *, const struct sctp_association *, struct sctp_chunk *sctp_chunkify(struct sk_buff *,
struct sock *); const struct sctp_association *,
void sctp_init_addrs(sctp_chunk_t *, union sctp_addr *, union sctp_addr *); struct sock *);
const union sctp_addr *sctp_source(const sctp_chunk_t *chunk); void sctp_init_addrs(struct sctp_chunk *, union sctp_addr *,
union sctp_addr *);
const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);
/* This is a structure for holding either an IPv6 or an IPv4 address. */ /* This is a structure for holding either an IPv6 or an IPv4 address. */
/* sin_family -- AF_INET or AF_INET6 /* sin_family -- AF_INET or AF_INET6
...@@ -564,7 +564,7 @@ struct sockaddr_storage_list { ...@@ -564,7 +564,7 @@ struct sockaddr_storage_list {
union sctp_addr a; union sctp_addr a;
}; };
typedef sctp_chunk_t *(sctp_packet_phandler_t)(struct sctp_association *); typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
/* This structure holds lists of chunks as we are assembling for /* This structure holds lists of chunks as we are assembling for
* transmission. * transmission.
...@@ -621,7 +621,7 @@ typedef struct sctp_packet *(sctp_outq_ohandler_config_t) ...@@ -621,7 +621,7 @@ typedef struct sctp_packet *(sctp_outq_ohandler_config_t)
int ecn_capable, int ecn_capable,
sctp_packet_phandler_t *get_prepend_chunk); sctp_packet_phandler_t *get_prepend_chunk);
typedef sctp_xmit_t (sctp_outq_ohandler_t)(struct sctp_packet *, typedef sctp_xmit_t (sctp_outq_ohandler_t)(struct sctp_packet *,
sctp_chunk_t *); struct sctp_chunk *);
typedef int (sctp_outq_ohandler_force_t)(struct sctp_packet *); typedef int (sctp_outq_ohandler_force_t)(struct sctp_packet *);
sctp_outq_ohandler_init_t sctp_packet_init; sctp_outq_ohandler_init_t sctp_packet_init;
...@@ -832,7 +832,7 @@ struct sctp_inq { ...@@ -832,7 +832,7 @@ struct sctp_inq {
/* This is the packet which is currently off the in queue and is /* This is the packet which is currently off the in queue and is
* being worked on through the inbound chunk processing. * being worked on through the inbound chunk processing.
*/ */
sctp_chunk_t *in_progress; struct sctp_chunk *in_progress;
/* This is the delayed task to finish delivering inbound /* This is the delayed task to finish delivering inbound
* messages. * messages.
...@@ -845,7 +845,7 @@ struct sctp_inq { ...@@ -845,7 +845,7 @@ struct sctp_inq {
struct sctp_inq *sctp_inq_new(void); struct sctp_inq *sctp_inq_new(void);
void sctp_inq_init(struct sctp_inq *); void sctp_inq_init(struct sctp_inq *);
void sctp_inq_free(struct sctp_inq *); void sctp_inq_free(struct sctp_inq *);
void sctp_inq_push(struct sctp_inq *, sctp_chunk_t *packet); void sctp_inq_push(struct sctp_inq *, struct sctp_chunk *packet);
struct sctp_chunk *sctp_inq_pop(struct sctp_inq *); struct sctp_chunk *sctp_inq_pop(struct sctp_inq *);
void sctp_inq_set_th_handler(struct sctp_inq *, void (*)(void *), void *); void sctp_inq_set_th_handler(struct sctp_inq *, void (*)(void *), void *);
...@@ -916,7 +916,7 @@ struct sctp_outq *sctp_outq_new(struct sctp_association *); ...@@ -916,7 +916,7 @@ struct sctp_outq *sctp_outq_new(struct sctp_association *);
void sctp_outq_init(struct sctp_association *, struct sctp_outq *); void sctp_outq_init(struct sctp_association *, struct sctp_outq *);
void sctp_outq_teardown(struct sctp_outq *); void sctp_outq_teardown(struct sctp_outq *);
void sctp_outq_free(struct sctp_outq*); void sctp_outq_free(struct sctp_outq*);
int sctp_outq_tail(struct sctp_outq *, sctp_chunk_t *chunk); int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk);
int sctp_outq_flush(struct sctp_outq *, int); int sctp_outq_flush(struct sctp_outq *, int);
int sctp_outq_sack(struct sctp_outq *, sctp_sackhdr_t *); int sctp_outq_sack(struct sctp_outq *, sctp_sackhdr_t *);
int sctp_outq_is_empty(const struct sctp_outq *); int sctp_outq_is_empty(const struct sctp_outq *);
...@@ -953,15 +953,16 @@ struct sctp_bind_addr { ...@@ -953,15 +953,16 @@ struct sctp_bind_addr {
int malloced; /* Are we kfree()able? */ int malloced; /* Are we kfree()able? */
}; };
sctp_bind_addr_t *sctp_bind_addr_new(int gfp_mask); struct sctp_bind_addr *sctp_bind_addr_new(int gfp_mask);
void sctp_bind_addr_init(sctp_bind_addr_t *, __u16 port); void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
void sctp_bind_addr_free(sctp_bind_addr_t *); void sctp_bind_addr_free(struct sctp_bind_addr *);
int sctp_bind_addr_copy(sctp_bind_addr_t *dest, const sctp_bind_addr_t *src, int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
const struct sctp_bind_addr *src,
sctp_scope_t scope, int gfp,int flags); sctp_scope_t scope, int gfp,int flags);
int sctp_add_bind_addr(sctp_bind_addr_t *, union sctp_addr *, int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
int gfp); int gfp);
int sctp_del_bind_addr(sctp_bind_addr_t *, union sctp_addr *); int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
int sctp_bind_addr_match(sctp_bind_addr_t *, const union sctp_addr *, int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
struct sctp_opt *); struct sctp_opt *);
union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
int *addrs_len, int gfp); int *addrs_len, int gfp);
...@@ -1025,7 +1026,7 @@ struct sctp_ep_common { ...@@ -1025,7 +1026,7 @@ struct sctp_ep_common {
* bind_addr.port is our shared port number. * bind_addr.port is our shared port number.
* bind_addr.address_list is our set of local IP addresses. * bind_addr.address_list is our set of local IP addresses.
*/ */
sctp_bind_addr_t bind_addr; struct sctp_bind_addr bind_addr;
/* Protection during address list comparisons. */ /* Protection during address list comparisons. */
rwlock_t addr_lock; rwlock_t addr_lock;
...@@ -1477,7 +1478,7 @@ struct sctp_association { ...@@ -1477,7 +1478,7 @@ struct sctp_association {
* [This is our one-and-only-one ASCONF in flight. If we do * [This is our one-and-only-one ASCONF in flight. If we do
* not have an ASCONF in flight, this is NULL.] * not have an ASCONF in flight, this is NULL.]
*/ */
sctp_chunk_t *addip_last_asconf; struct sctp_chunk *addip_last_asconf;
/* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.
* *
...@@ -1492,7 +1493,7 @@ struct sctp_association { ...@@ -1492,7 +1493,7 @@ struct sctp_association {
* [This is our saved ASCONF-ACK. We invalidate it when a new * [This is our saved ASCONF-ACK. We invalidate it when a new
* ASCONF serial number arrives.] * ASCONF serial number arrives.]
*/ */
sctp_chunk_t *addip_last_asconf_ack; struct sctp_chunk *addip_last_asconf_ack;
/* These ASCONF chunks are waiting to be sent. /* These ASCONF chunks are waiting to be sent.
* *
...@@ -1611,8 +1612,8 @@ int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, ...@@ -1611,8 +1612,8 @@ int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
int sctp_cmp_addr_exact(const union sctp_addr *ss1, int sctp_cmp_addr_exact(const union sctp_addr *ss1,
const union sctp_addr *ss2); const union sctp_addr *ss2);
sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc); struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc);
sctp_chunk_t *sctp_get_no_prepend(struct sctp_association *asoc); struct sctp_chunk *sctp_get_no_prepend(struct sctp_association *asoc);
/* A convenience structure to parse out SCTP specific CMSGs. */ /* A convenience structure to parse out SCTP specific CMSGs. */
typedef struct sctp_cmsgs { typedef struct sctp_cmsgs {
......
...@@ -664,7 +664,7 @@ int sctp_cmp_addr_exact(const union sctp_addr *ss1, ...@@ -664,7 +664,7 @@ int sctp_cmp_addr_exact(const union sctp_addr *ss1,
* Note: We are sly and return a shared, prealloced chunk. FIXME: * Note: We are sly and return a shared, prealloced chunk. FIXME:
* No we don't, but we could/should. * No we don't, but we could/should.
*/ */
sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc) struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc)
{ {
struct sctp_chunk *chunk; struct sctp_chunk *chunk;
...@@ -682,7 +682,7 @@ sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc) ...@@ -682,7 +682,7 @@ sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc)
/* Use this function for the packet prepend callback when no ECNE /* Use this function for the packet prepend callback when no ECNE
* packet is desired (e.g. some packets don't like to be bundled). * packet is desired (e.g. some packets don't like to be bundled).
*/ */
sctp_chunk_t *sctp_get_no_prepend(struct sctp_association *asoc) struct sctp_chunk *sctp_get_no_prepend(struct sctp_association *asoc)
{ {
return NULL; return NULL;
} }
...@@ -690,13 +690,14 @@ sctp_chunk_t *sctp_get_no_prepend(struct sctp_association *asoc) ...@@ -690,13 +690,14 @@ sctp_chunk_t *sctp_get_no_prepend(struct sctp_association *asoc)
/* /*
* Find which transport this TSN was sent on. * Find which transport this TSN was sent on.
*/ */
struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, __u32 tsn) struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
__u32 tsn)
{ {
struct sctp_transport *active; struct sctp_transport *active;
struct sctp_transport *match; struct sctp_transport *match;
struct list_head *entry, *pos; struct list_head *entry, *pos;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
__u32 key = htonl(tsn); __u32 key = htonl(tsn);
match = NULL; match = NULL;
...@@ -719,7 +720,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, __u3 ...@@ -719,7 +720,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, __u3
active = asoc->peer.active_path; active = asoc->peer.active_path;
list_for_each(entry, &active->transmitted) { list_for_each(entry, &active->transmitted) {
chunk = list_entry(entry, sctp_chunk_t, transmitted_list); chunk = list_entry(entry, struct sctp_chunk, transmitted_list);
if (key == chunk->subh.data_hdr->tsn) { if (key == chunk->subh.data_hdr->tsn) {
match = active; match = active;
...@@ -734,7 +735,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, __u3 ...@@ -734,7 +735,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc, __u3
if (transport == active) if (transport == active)
break; break;
list_for_each(entry, &transport->transmitted) { list_for_each(entry, &transport->transmitted) {
chunk = list_entry(entry, sctp_chunk_t, chunk = list_entry(entry, struct sctp_chunk,
transmitted_list); transmitted_list);
if (key == chunk->subh.data_hdr->tsn) { if (key == chunk->subh.data_hdr->tsn) {
match = transport; match = transport;
...@@ -776,7 +777,7 @@ struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc, ...@@ -776,7 +777,7 @@ struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,
static void sctp_assoc_bh_rcv(struct sctp_association *asoc) static void sctp_assoc_bh_rcv(struct sctp_association *asoc)
{ {
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sock *sk; struct sock *sk;
struct sctp_inq *inqueue; struct sctp_inq *inqueue;
int state, subtype; int state, subtype;
...@@ -852,7 +853,8 @@ void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk) ...@@ -852,7 +853,8 @@ void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk)
} }
/* Update an association (possibly from unexpected COOKIE-ECHO processing). */ /* Update an association (possibly from unexpected COOKIE-ECHO processing). */
void sctp_assoc_update(struct sctp_association *asoc, struct sctp_association *new) void sctp_assoc_update(struct sctp_association *asoc,
struct sctp_association *new)
{ {
/* Copy in new parameters of peer. */ /* Copy in new parameters of peer. */
asoc->c = new->c; asoc->c = new->c;
...@@ -946,7 +948,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) ...@@ -946,7 +948,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
} }
/* Choose the transport for sending a SHUTDOWN packet. */ /* Choose the transport for sending a SHUTDOWN packet. */
struct sctp_transport *sctp_assoc_choose_shutdown_transport(struct sctp_association *asoc) struct sctp_transport *sctp_assoc_choose_shutdown_transport(
struct sctp_association *asoc)
{ {
/* If this is the first time SHUTDOWN is sent, use the active path, /* If this is the first time SHUTDOWN is sent, use the active path,
* else use the retran path. If the last SHUTDOWN was sent over the * else use the retran path. If the last SHUTDOWN was sent over the
...@@ -1011,7 +1014,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc) ...@@ -1011,7 +1014,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc)
/* Increase asoc's rwnd by len and send any window update SACK if needed. */ /* Increase asoc's rwnd by len and send any window update SACK if needed. */
void sctp_assoc_rwnd_increase(struct sctp_association *asoc, int len) void sctp_assoc_rwnd_increase(struct sctp_association *asoc, int len)
{ {
sctp_chunk_t *sack; struct sctp_chunk *sack;
struct timer_list *timer; struct timer_list *timer;
if (asoc->rwnd_over) { if (asoc->rwnd_over) {
......
...@@ -52,16 +52,17 @@ ...@@ -52,16 +52,17 @@
#include <net/sctp/sm.h> #include <net/sctp/sm.h>
/* Forward declarations for internal helpers. */ /* Forward declarations for internal helpers. */
static int sctp_copy_one_addr(sctp_bind_addr_t *, union sctp_addr *, static int sctp_copy_one_addr(struct sctp_bind_addr *, union sctp_addr *,
sctp_scope_t scope, int gfp, int flags); sctp_scope_t scope, int gfp, int flags);
static void sctp_bind_addr_clean(sctp_bind_addr_t *); static void sctp_bind_addr_clean(struct sctp_bind_addr *);
/* First Level Abstractions. */ /* First Level Abstractions. */
/* Copy 'src' to 'dest' taking 'scope' into account. Omit addresses /* Copy 'src' to 'dest' taking 'scope' into account. Omit addresses
* in 'src' which have a broader scope than 'scope'. * in 'src' which have a broader scope than 'scope'.
*/ */
int sctp_bind_addr_copy(sctp_bind_addr_t *dest, const sctp_bind_addr_t *src, int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
const struct sctp_bind_addr *src,
sctp_scope_t scope, int gfp, int flags) sctp_scope_t scope, int gfp, int flags)
{ {
struct sockaddr_storage_list *addr; struct sockaddr_storage_list *addr;
...@@ -104,11 +105,11 @@ int sctp_bind_addr_copy(sctp_bind_addr_t *dest, const sctp_bind_addr_t *src, ...@@ -104,11 +105,11 @@ int sctp_bind_addr_copy(sctp_bind_addr_t *dest, const sctp_bind_addr_t *src,
} }
/* Create a new SCTP_bind_addr from nothing. */ /* Create a new SCTP_bind_addr from nothing. */
sctp_bind_addr_t *sctp_bind_addr_new(int gfp) struct sctp_bind_addr *sctp_bind_addr_new(int gfp)
{ {
sctp_bind_addr_t *retval; struct sctp_bind_addr *retval;
retval = t_new(sctp_bind_addr_t, gfp); retval = t_new(struct sctp_bind_addr, gfp);
if (!retval) if (!retval)
goto nomem; goto nomem;
...@@ -123,7 +124,7 @@ sctp_bind_addr_t *sctp_bind_addr_new(int gfp) ...@@ -123,7 +124,7 @@ sctp_bind_addr_t *sctp_bind_addr_new(int gfp)
/* Initialize the SCTP_bind_addr structure for either an endpoint or /* Initialize the SCTP_bind_addr structure for either an endpoint or
* an association. * an association.
*/ */
void sctp_bind_addr_init(sctp_bind_addr_t *bp, __u16 port) void sctp_bind_addr_init(struct sctp_bind_addr *bp, __u16 port)
{ {
bp->malloced = 0; bp->malloced = 0;
...@@ -132,7 +133,7 @@ void sctp_bind_addr_init(sctp_bind_addr_t *bp, __u16 port) ...@@ -132,7 +133,7 @@ void sctp_bind_addr_init(sctp_bind_addr_t *bp, __u16 port)
} }
/* Dispose of the address list. */ /* Dispose of the address list. */
static void sctp_bind_addr_clean(sctp_bind_addr_t *bp) static void sctp_bind_addr_clean(struct sctp_bind_addr *bp)
{ {
struct sockaddr_storage_list *addr; struct sockaddr_storage_list *addr;
struct list_head *pos, *temp; struct list_head *pos, *temp;
...@@ -147,7 +148,7 @@ static void sctp_bind_addr_clean(sctp_bind_addr_t *bp) ...@@ -147,7 +148,7 @@ static void sctp_bind_addr_clean(sctp_bind_addr_t *bp)
} }
/* Dispose of an SCTP_bind_addr structure */ /* Dispose of an SCTP_bind_addr structure */
void sctp_bind_addr_free(sctp_bind_addr_t *bp) void sctp_bind_addr_free(struct sctp_bind_addr *bp)
{ {
/* Empty the bind address list. */ /* Empty the bind address list. */
sctp_bind_addr_clean(bp); sctp_bind_addr_clean(bp);
...@@ -159,7 +160,7 @@ void sctp_bind_addr_free(sctp_bind_addr_t *bp) ...@@ -159,7 +160,7 @@ void sctp_bind_addr_free(sctp_bind_addr_t *bp)
} }
/* Add an address to the bind address list in the SCTP_bind_addr structure. */ /* Add an address to the bind address list in the SCTP_bind_addr structure. */
int sctp_add_bind_addr(sctp_bind_addr_t *bp, union sctp_addr *new, int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
int gfp) int gfp)
{ {
struct sockaddr_storage_list *addr; struct sockaddr_storage_list *addr;
...@@ -187,7 +188,7 @@ int sctp_add_bind_addr(sctp_bind_addr_t *bp, union sctp_addr *new, ...@@ -187,7 +188,7 @@ int sctp_add_bind_addr(sctp_bind_addr_t *bp, union sctp_addr *new,
/* Delete an address from the bind address list in the SCTP_bind_addr /* Delete an address from the bind address list in the SCTP_bind_addr
* structure. * structure.
*/ */
int sctp_del_bind_addr(sctp_bind_addr_t *bp, union sctp_addr *del_addr) int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
{ {
struct list_head *pos, *temp; struct list_head *pos, *temp;
struct sockaddr_storage_list *addr; struct sockaddr_storage_list *addr;
...@@ -212,7 +213,7 @@ int sctp_del_bind_addr(sctp_bind_addr_t *bp, union sctp_addr *del_addr) ...@@ -212,7 +213,7 @@ int sctp_del_bind_addr(sctp_bind_addr_t *bp, union sctp_addr *del_addr)
* *
* The second argument is the return value for the length. * The second argument is the return value for the length.
*/ */
union sctp_params sctp_bind_addrs_to_raw(const sctp_bind_addr_t *bp, union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
int *addrs_len, int gfp) int *addrs_len, int gfp)
{ {
union sctp_params addrparms; union sctp_params addrparms;
...@@ -261,7 +262,7 @@ union sctp_params sctp_bind_addrs_to_raw(const sctp_bind_addr_t *bp, ...@@ -261,7 +262,7 @@ union sctp_params sctp_bind_addrs_to_raw(const sctp_bind_addr_t *bp,
* Create an address list out of the raw address list format (IPv4 and IPv6 * Create an address list out of the raw address list format (IPv4 and IPv6
* address parameters). * address parameters).
*/ */
int sctp_raw_to_bind_addrs(sctp_bind_addr_t *bp, __u8 *raw_addr_list, int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
int addrs_len, __u16 port, int gfp) int addrs_len, __u16 port, int gfp)
{ {
sctp_addr_param_t *rawaddr; sctp_addr_param_t *rawaddr;
...@@ -307,7 +308,8 @@ int sctp_raw_to_bind_addrs(sctp_bind_addr_t *bp, __u8 *raw_addr_list, ...@@ -307,7 +308,8 @@ int sctp_raw_to_bind_addrs(sctp_bind_addr_t *bp, __u8 *raw_addr_list,
********************************************************************/ ********************************************************************/
/* Does this contain a specified address? Allow wildcarding. */ /* Does this contain a specified address? Allow wildcarding. */
int sctp_bind_addr_match(sctp_bind_addr_t *bp, const union sctp_addr *addr, int sctp_bind_addr_match(struct sctp_bind_addr *bp,
const union sctp_addr *addr,
struct sctp_opt *opt) struct sctp_opt *opt)
{ {
struct sockaddr_storage_list *laddr; struct sockaddr_storage_list *laddr;
...@@ -323,7 +325,8 @@ int sctp_bind_addr_match(sctp_bind_addr_t *bp, const union sctp_addr *addr, ...@@ -323,7 +325,8 @@ int sctp_bind_addr_match(sctp_bind_addr_t *bp, const union sctp_addr *addr,
} }
/* Copy out addresses from the global local address list. */ /* Copy out addresses from the global local address list. */
static int sctp_copy_one_addr(sctp_bind_addr_t *dest, union sctp_addr *addr, static int sctp_copy_one_addr(struct sctp_bind_addr *dest,
union sctp_addr *addr,
sctp_scope_t scope, int gfp, int flags) sctp_scope_t scope, int gfp, int flags)
{ {
struct sctp_protocol *proto = sctp_get_protocol(); struct sctp_protocol *proto = sctp_get_protocol();
......
...@@ -315,7 +315,7 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep, ...@@ -315,7 +315,7 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
{ {
struct list_head *pos; struct list_head *pos;
struct sockaddr_storage_list *addr; struct sockaddr_storage_list *addr;
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
sctp_read_lock(&ep->base.addr_lock); sctp_read_lock(&ep->base.addr_lock);
bp = &ep->base.bind_addr; bp = &ep->base.bind_addr;
...@@ -339,7 +339,7 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep) ...@@ -339,7 +339,7 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep)
struct sctp_association *asoc; struct sctp_association *asoc;
struct sock *sk; struct sock *sk;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sctp_inq *inqueue; struct sctp_inq *inqueue;
sctp_subtype_t subtype; sctp_subtype_t subtype;
sctp_state_t state; sctp_state_t state;
......
...@@ -106,7 +106,7 @@ int sctp_rcv(struct sk_buff *skb) ...@@ -106,7 +106,7 @@ int sctp_rcv(struct sk_buff *skb)
struct sctp_endpoint *ep = NULL; struct sctp_endpoint *ep = NULL;
struct sctp_ep_common *rcvr; struct sctp_ep_common *rcvr;
struct sctp_transport *transport = NULL; struct sctp_transport *transport = NULL;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sctphdr *sh; struct sctphdr *sh;
union sctp_addr src; union sctp_addr src;
union sctp_addr dest; union sctp_addr dest;
...@@ -250,13 +250,13 @@ int sctp_rcv(struct sk_buff *skb) ...@@ -250,13 +250,13 @@ int sctp_rcv(struct sk_buff *skb)
*/ */
int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
{ {
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sctp_inq *inqueue; struct sctp_inq *inqueue;
/* One day chunk will live inside the skb, but for /* One day chunk will live inside the skb, but for
* now this works. * now this works.
*/ */
chunk = (sctp_chunk_t *) skb; chunk = (struct sctp_chunk *) skb;
inqueue = &chunk->rcvr->inqueue; inqueue = &chunk->rcvr->inqueue;
sctp_inq_push(inqueue, chunk); sctp_inq_push(inqueue, chunk);
......
...@@ -75,10 +75,10 @@ struct sctp_inq *sctp_inq_new(void) ...@@ -75,10 +75,10 @@ struct sctp_inq *sctp_inq_new(void)
/* Release the memory associated with an SCTP inqueue. */ /* Release the memory associated with an SCTP inqueue. */
void sctp_inq_free(struct sctp_inq *queue) void sctp_inq_free(struct sctp_inq *queue)
{ {
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
/* Empty the queue. */ /* Empty the queue. */
while ((chunk = (sctp_chunk_t *) skb_dequeue(&queue->in))) while ((chunk = (struct sctp_chunk *) skb_dequeue(&queue->in)))
sctp_free_chunk(chunk); sctp_free_chunk(chunk);
/* If there is a packet which is currently being worked on, /* If there is a packet which is currently being worked on,
...@@ -96,7 +96,7 @@ void sctp_inq_free(struct sctp_inq *queue) ...@@ -96,7 +96,7 @@ void sctp_inq_free(struct sctp_inq *queue)
/* Put a new packet in an SCTP inqueue. /* Put a new packet in an SCTP inqueue.
* We assume that packet->sctp_hdr is set and in host byte order. * We assume that packet->sctp_hdr is set and in host byte order.
*/ */
void sctp_inq_push(struct sctp_inq *q, sctp_chunk_t *packet) void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *packet)
{ {
/* Directly call the packet handling routine. */ /* Directly call the packet handling routine. */
...@@ -114,9 +114,9 @@ void sctp_inq_push(struct sctp_inq *q, sctp_chunk_t *packet) ...@@ -114,9 +114,9 @@ void sctp_inq_push(struct sctp_inq *q, sctp_chunk_t *packet)
* WARNING: If you need to put the chunk on another queue, you need to * WARNING: If you need to put the chunk on another queue, you need to
* make a shallow copy (clone) of it. * make a shallow copy (clone) of it.
*/ */
sctp_chunk_t *sctp_inq_pop(struct sctp_inq *queue) struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
{ {
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
sctp_chunkhdr_t *ch = NULL; sctp_chunkhdr_t *ch = NULL;
/* The assumption is that we are safe to process the chunks /* The assumption is that we are safe to process the chunks
...@@ -149,7 +149,7 @@ sctp_chunk_t *sctp_inq_pop(struct sctp_inq *queue) ...@@ -149,7 +149,7 @@ sctp_chunk_t *sctp_inq_pop(struct sctp_inq *queue)
return NULL; return NULL;
chunk = queue->in_progress = chunk = queue->in_progress =
(sctp_chunk_t *) skb_dequeue(&queue->in); (struct sctp_chunk *) skb_dequeue(&queue->in);
/* This is the first chunk in the packet. */ /* This is the first chunk in the packet. */
chunk->singleton = 1; chunk->singleton = 1;
......
...@@ -246,7 +246,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1, ...@@ -246,7 +246,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
void sctp_v6_get_saddr(struct sctp_association *asoc, struct dst_entry *dst, void sctp_v6_get_saddr(struct sctp_association *asoc, struct dst_entry *dst,
union sctp_addr *daddr, union sctp_addr *saddr) union sctp_addr *daddr, union sctp_addr *saddr)
{ {
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
rwlock_t *addr_lock; rwlock_t *addr_lock;
struct sockaddr_storage_list *laddr; struct sockaddr_storage_list *laddr;
struct list_head *pos; struct list_head *pos;
......
...@@ -327,7 +327,6 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -327,7 +327,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
sh->vtag = htonl(packet->vtag); sh->vtag = htonl(packet->vtag);
sh->checksum = 0; sh->checksum = 0;
/* 2) Calculate the Adler-32 checksum of the whole packet, /* 2) Calculate the Adler-32 checksum of the whole packet,
* including the SCTP common header and all the * including the SCTP common header and all the
* chunks. * chunks.
...@@ -358,10 +357,11 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -358,10 +357,11 @@ int sctp_packet_transmit(struct sctp_packet *packet)
*/ */
SCTP_DEBUG_PRINTK("***sctp_transmit_packet***\n"); SCTP_DEBUG_PRINTK("***sctp_transmit_packet***\n");
while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) { while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) {
chunk->num_times_sent++;
chunk->sent_at = jiffies;
if (sctp_chunk_is_data(chunk)) { if (sctp_chunk_is_data(chunk)) {
sctp_chunk_assign_tsn(chunk);
if (!chunk->has_tsn) {
sctp_chunk_assign_tsn(chunk);
/* 6.3.1 C4) When data is in flight and when allowed /* 6.3.1 C4) When data is in flight and when allowed
* by rule C5, a new RTT measurement MUST be made each * by rule C5, a new RTT measurement MUST be made each
...@@ -369,23 +369,27 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -369,23 +369,27 @@ int sctp_packet_transmit(struct sctp_packet *packet)
* SHOULD be made no more than once per round-trip * SHOULD be made no more than once per round-trip
* for a given destination transport address. * for a given destination transport address.
*/ */
if ((1 == chunk->num_times_sent) &&
(!tp->rto_pending)) { if (!tp->rto_pending) {
chunk->rtt_in_progress = 1; chunk->rtt_in_progress = 1;
tp->rto_pending = 1; tp->rto_pending = 1;
} }
} else
chunk->resent = 1;
chunk->sent_at = jiffies;
has_data = 1; has_data = 1;
} }
padding = WORD_ROUND(chunk->skb->len) - chunk->skb->len; padding = WORD_ROUND(chunk->skb->len) - chunk->skb->len;
if (padding) if (padding)
memset(skb_put(chunk->skb, padding), 0, padding); memset(skb_put(chunk->skb, padding), 0, padding);
crc32 = sctp_update_copy_cksum(skb_put(nskb, chunk->skb->len), crc32 = sctp_update_copy_cksum(skb_put(nskb, chunk->skb->len),
chunk->skb->data, chunk->skb->data,
chunk->skb->len, crc32); chunk->skb->len, crc32);
SCTP_DEBUG_PRINTK("%s %p[%s] %s 0x%x, %s %d, %s %d, %s %d, " SCTP_DEBUG_PRINTK("%s %p[%s] %s 0x%x, %s %d, %s %d, %s %d\n",
"%s %d\n",
"*** Chunk", chunk, "*** Chunk", chunk,
sctp_cname(SCTP_ST_CHUNK( sctp_cname(SCTP_ST_CHUNK(
chunk->chunk_hdr->type)), chunk->chunk_hdr->type)),
...@@ -394,7 +398,6 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -394,7 +398,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
ntohl(chunk->subh.data_hdr->tsn) : 0, ntohl(chunk->subh.data_hdr->tsn) : 0,
"length", ntohs(chunk->chunk_hdr->length), "length", ntohs(chunk->chunk_hdr->length),
"chunk->skb->len", chunk->skb->len, "chunk->skb->len", chunk->skb->len,
"num_times_sent", chunk->num_times_sent,
"rtt_in_progress", chunk->rtt_in_progress); "rtt_in_progress", chunk->rtt_in_progress);
/* /*
......
...@@ -143,14 +143,14 @@ void sctp_outq_teardown(struct sctp_outq *q) ...@@ -143,14 +143,14 @@ void sctp_outq_teardown(struct sctp_outq *q)
{ {
struct sctp_transport *transport; struct sctp_transport *transport;
struct list_head *lchunk, *pos, *temp; struct list_head *lchunk, *pos, *temp;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
/* Throw away unacknowledged chunks. */ /* Throw away unacknowledged chunks. */
list_for_each(pos, &q->asoc->peer.transport_addr_list) { list_for_each(pos, &q->asoc->peer.transport_addr_list) {
transport = list_entry(pos, struct sctp_transport, transports); transport = list_entry(pos, struct sctp_transport, transports);
while ((lchunk = sctp_list_dequeue(&transport->transmitted))) { while ((lchunk = sctp_list_dequeue(&transport->transmitted))) {
chunk = list_entry(lchunk, sctp_chunk_t, chunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list); transmitted_list);
/* Generate a SEND FAILED event. */ /* Generate a SEND FAILED event. */
...@@ -167,14 +167,16 @@ void sctp_outq_teardown(struct sctp_outq *q) ...@@ -167,14 +167,16 @@ void sctp_outq_teardown(struct sctp_outq *q)
/* Throw away chunks that have been gap ACKed. */ /* Throw away chunks that have been gap ACKed. */
list_for_each_safe(lchunk, temp, &q->sacked) { list_for_each_safe(lchunk, temp, &q->sacked) {
list_del(lchunk); list_del(lchunk);
chunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); chunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
sctp_free_chunk(chunk); sctp_free_chunk(chunk);
} }
/* Throw away any chunks in the retransmit queue. */ /* Throw away any chunks in the retransmit queue. */
list_for_each_safe(lchunk, temp, &q->retransmit) { list_for_each_safe(lchunk, temp, &q->retransmit) {
list_del(lchunk); list_del(lchunk);
chunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); chunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
sctp_free_chunk(chunk); sctp_free_chunk(chunk);
} }
...@@ -194,7 +196,7 @@ void sctp_outq_teardown(struct sctp_outq *q) ...@@ -194,7 +196,7 @@ void sctp_outq_teardown(struct sctp_outq *q)
q->error = 0; q->error = 0;
/* Throw away any leftover control chunks. */ /* Throw away any leftover control chunks. */
while ((chunk = (sctp_chunk_t *) skb_dequeue(&q->control))) while ((chunk = (struct sctp_chunk *) skb_dequeue(&q->control)))
sctp_free_chunk(chunk); sctp_free_chunk(chunk);
} }
...@@ -210,7 +212,7 @@ void sctp_outq_free(struct sctp_outq *q) ...@@ -210,7 +212,7 @@ void sctp_outq_free(struct sctp_outq *q)
} }
/* Put a new chunk in an sctp_outq. */ /* Put a new chunk in an sctp_outq. */
int sctp_outq_tail(struct sctp_outq *q, sctp_chunk_t *chunk) int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
{ {
int error = 0; int error = 0;
...@@ -276,15 +278,16 @@ int sctp_outq_tail(struct sctp_outq *q, sctp_chunk_t *chunk) ...@@ -276,15 +278,16 @@ int sctp_outq_tail(struct sctp_outq *q, sctp_chunk_t *chunk)
void sctp_retransmit_insert(struct list_head *tlchunk, struct sctp_outq *q) void sctp_retransmit_insert(struct list_head *tlchunk, struct sctp_outq *q)
{ {
struct list_head *rlchunk; struct list_head *rlchunk;
sctp_chunk_t *tchunk, *rchunk; struct sctp_chunk *tchunk, *rchunk;
__u32 ttsn, rtsn; __u32 ttsn, rtsn;
int done = 0; int done = 0;
tchunk = list_entry(tlchunk, sctp_chunk_t, transmitted_list); tchunk = list_entry(tlchunk, struct sctp_chunk, transmitted_list);
ttsn = ntohl(tchunk->subh.data_hdr->tsn); ttsn = ntohl(tchunk->subh.data_hdr->tsn);
list_for_each(rlchunk, &q->retransmit) { list_for_each(rlchunk, &q->retransmit) {
rchunk = list_entry(rlchunk, sctp_chunk_t, transmitted_list); rchunk = list_entry(rlchunk, struct sctp_chunk,
transmitted_list);
rtsn = ntohl(rchunk->subh.data_hdr->tsn); rtsn = ntohl(rchunk->subh.data_hdr->tsn);
if (TSN_lt(ttsn, rtsn)) { if (TSN_lt(ttsn, rtsn)) {
list_add(tlchunk, rlchunk->prev); list_add(tlchunk, rlchunk->prev);
...@@ -303,11 +306,12 @@ void sctp_retransmit_mark(struct sctp_outq *q, ...@@ -303,11 +306,12 @@ void sctp_retransmit_mark(struct sctp_outq *q,
__u8 fast_retransmit) __u8 fast_retransmit)
{ {
struct list_head *lchunk, *ltemp; struct list_head *lchunk, *ltemp;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
/* Walk through the specified transmitted queue. */ /* Walk through the specified transmitted queue. */
list_for_each_safe(lchunk, ltemp, &transport->transmitted) { list_for_each_safe(lchunk, ltemp, &transport->transmitted) {
chunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); chunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
/* If we are doing retransmission due to a fast retransmit, /* If we are doing retransmission due to a fast retransmit,
* only the chunk's that are marked for fast retransmit * only the chunk's that are marked for fast retransmit
...@@ -416,7 +420,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -416,7 +420,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
struct list_head *lchunk; struct list_head *lchunk;
struct sctp_transport *transport = pkt->transport; struct sctp_transport *transport = pkt->transport;
sctp_xmit_t status; sctp_xmit_t status;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sctp_association *asoc; struct sctp_association *asoc;
int error = 0; int error = 0;
...@@ -442,7 +446,8 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -442,7 +446,8 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
lchunk = sctp_list_dequeue(lqueue); lchunk = sctp_list_dequeue(lqueue);
while (lchunk) { while (lchunk) {
chunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); chunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
/* Make sure that Gap Acked TSNs are not retransmitted. A /* Make sure that Gap Acked TSNs are not retransmitted. A
* simple approach is just to move such TSNs out of the * simple approach is just to move such TSNs out of the
...@@ -582,7 +587,7 @@ void sctp_xmit_frag(struct sctp_outq *q, struct sctp_chunk *pos, ...@@ -582,7 +587,7 @@ void sctp_xmit_frag(struct sctp_outq *q, struct sctp_chunk *pos,
* of all the other fragments in the 'frag_list' field. * of all the other fragments in the 'frag_list' field.
*/ */
void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt, void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt,
sctp_chunk_t *frag) struct sctp_chunk *frag)
{ {
struct sctp_association *asoc = frag->asoc; struct sctp_association *asoc = frag->asoc;
struct list_head *lfrag, *frag_list; struct list_head *lfrag, *frag_list;
...@@ -606,7 +611,7 @@ void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -606,7 +611,7 @@ void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt,
/* Transmit the rest of fragments. */ /* Transmit the rest of fragments. */
frag_list = &frag->frag_list; frag_list = &frag->frag_list;
list_for_each(lfrag, frag_list) { list_for_each(lfrag, frag_list) {
frag = list_entry(lfrag, sctp_chunk_t, frag_list); frag = list_entry(lfrag, struct sctp_chunk, frag_list);
sctp_xmit_frag(q, pos, pkt, frag, tsn++); sctp_xmit_frag(q, pos, pkt, frag, tsn++);
} }
} }
...@@ -615,7 +620,7 @@ void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -615,7 +620,7 @@ void sctp_xmit_fragmented_chunks(struct sctp_outq *q, struct sctp_packet *pkt,
* fragments. It returns the first fragment with the frag_list field holding * fragments. It returns the first fragment with the frag_list field holding
* the remaining fragments. * the remaining fragments.
*/ */
sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk, struct sctp_chunk *sctp_fragment_chunk(struct sctp_chunk *chunk,
size_t max_frag_data_len) size_t max_frag_data_len)
{ {
struct sctp_association *asoc = chunk->asoc; struct sctp_association *asoc = chunk->asoc;
...@@ -623,7 +628,7 @@ sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk, ...@@ -623,7 +628,7 @@ sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk,
struct sctp_sndrcvinfo *sinfo = &chunk->sinfo; struct sctp_sndrcvinfo *sinfo = &chunk->sinfo;
__u16 chunk_data_len = sctp_data_size(chunk); __u16 chunk_data_len = sctp_data_size(chunk);
__u16 ssn = ntohs(chunk->subh.data_hdr->ssn); __u16 ssn = ntohs(chunk->subh.data_hdr->ssn);
sctp_chunk_t *first_frag, *frag; struct sctp_chunk *first_frag, *frag;
struct list_head *frag_list; struct list_head *frag_list;
int nfrags; int nfrags;
__u8 old_flags, flags; __u8 old_flags, flags;
...@@ -700,7 +705,7 @@ sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk, ...@@ -700,7 +705,7 @@ sctp_chunk_t *sctp_fragment_chunk(sctp_chunk_t *chunk,
/* Free all the fragments off the first one. */ /* Free all the fragments off the first one. */
flist = &first_frag->frag_list; flist = &first_frag->frag_list;
while (NULL != (lfrag = sctp_list_dequeue(flist))) { while (NULL != (lfrag = sctp_list_dequeue(flist))) {
frag = list_entry(lfrag, sctp_chunk_t, frag_list); frag = list_entry(lfrag, struct sctp_chunk, frag_list);
sctp_free_chunk(frag); sctp_free_chunk(frag);
} }
...@@ -735,7 +740,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) ...@@ -735,7 +740,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
struct sk_buff_head *queue; struct sk_buff_head *queue;
struct sctp_transport *transport = NULL; struct sctp_transport *transport = NULL;
struct sctp_transport *new_transport; struct sctp_transport *new_transport;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
sctp_xmit_t status; sctp_xmit_t status;
int error = 0; int error = 0;
int start_timer = 0; int start_timer = 0;
...@@ -762,7 +767,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) ...@@ -762,7 +767,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
} }
queue = &q->control; queue = &q->control;
while ((chunk = (sctp_chunk_t *)skb_dequeue(queue))) { while ((chunk = (struct sctp_chunk *)skb_dequeue(queue))) {
/* Pick the right transport to use. */ /* Pick the right transport to use. */
new_transport = chunk->transport; new_transport = chunk->transport;
...@@ -980,7 +985,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) ...@@ -980,7 +985,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
break; break;
case SCTP_XMIT_MUST_FRAG: { case SCTP_XMIT_MUST_FRAG: {
sctp_chunk_t *frag; struct sctp_chunk *frag;
frag = sctp_fragment_chunk(chunk, frag = sctp_fragment_chunk(chunk,
packet->transport->asoc->frag_point); packet->transport->asoc->frag_point);
...@@ -1101,7 +1106,7 @@ static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack, ...@@ -1101,7 +1106,7 @@ static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack,
{ {
struct list_head *ltransport, *lchunk; struct list_head *ltransport, *lchunk;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
__u32 highest_new_tsn, tsn; __u32 highest_new_tsn, tsn;
struct list_head *transport_list = &asoc->peer.transport_addr_list; struct list_head *transport_list = &asoc->peer.transport_addr_list;
...@@ -1111,7 +1116,7 @@ static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack, ...@@ -1111,7 +1116,7 @@ static __u32 sctp_highest_new_tsn(sctp_sackhdr_t *sack,
transport = list_entry(ltransport, struct sctp_transport, transport = list_entry(ltransport, struct sctp_transport,
transports); transports);
list_for_each(lchunk, &transport->transmitted) { list_for_each(lchunk, &transport->transmitted) {
chunk = list_entry(lchunk, sctp_chunk_t, chunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list); transmitted_list);
tsn = ntohl(chunk->subh.data_hdr->tsn); tsn = ntohl(chunk->subh.data_hdr->tsn);
...@@ -1134,7 +1139,7 @@ int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack) ...@@ -1134,7 +1139,7 @@ int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack)
{ {
struct sctp_association *asoc = q->asoc; struct sctp_association *asoc = q->asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *tchunk; struct sctp_chunk *tchunk;
struct list_head *lchunk, *transport_list, *pos; struct list_head *lchunk, *transport_list, *pos;
sctp_sack_variable_t *frags = sack->variable; sctp_sack_variable_t *frags = sack->variable;
__u32 sack_ctsn, ctsn, tsn; __u32 sack_ctsn, ctsn, tsn;
...@@ -1149,7 +1154,7 @@ int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack) ...@@ -1149,7 +1154,7 @@ int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack)
/* Get the highest TSN in the sack. */ /* Get the highest TSN in the sack. */
highest_tsn = sack_ctsn + highest_tsn = sack_ctsn +
ntohs(frags[ntohs(sack->num_gap_ack_blocks) - 1].gab.end); ntohs(frags[ntohs(sack->num_gap_ack_blocks) - 1].gab.end);
if (TSN_lt(asoc->highest_sacked, highest_tsn)) { if (TSN_lt(asoc->highest_sacked, highest_tsn)) {
highest_new_tsn = highest_tsn; highest_new_tsn = highest_tsn;
...@@ -1191,7 +1196,8 @@ int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack) ...@@ -1191,7 +1196,8 @@ int sctp_outq_sack(struct sctp_outq *q, sctp_sackhdr_t *sack)
/* Throw away stuff rotting on the sack queue. */ /* Throw away stuff rotting on the sack queue. */
list_for_each(lchunk, &q->sacked) { list_for_each(lchunk, &q->sacked) {
tchunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); tchunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
tsn = ntohl(tchunk->subh.data_hdr->tsn); tsn = ntohl(tchunk->subh.data_hdr->tsn);
if (TSN_lte(tsn, ctsn)) { if (TSN_lte(tsn, ctsn)) {
lchunk = lchunk->prev; lchunk = lchunk->prev;
...@@ -1264,7 +1270,7 @@ static void sctp_check_transmitted(struct sctp_outq *q, ...@@ -1264,7 +1270,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
__u32 highest_new_tsn_in_sack) __u32 highest_new_tsn_in_sack)
{ {
struct list_head *lchunk; struct list_head *lchunk;
sctp_chunk_t *tchunk; struct sctp_chunk *tchunk;
struct list_head tlist; struct list_head tlist;
__u32 tsn; __u32 tsn;
__u32 sack_ctsn; __u32 sack_ctsn;
...@@ -1294,7 +1300,8 @@ static void sctp_check_transmitted(struct sctp_outq *q, ...@@ -1294,7 +1300,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
/* The while loop will skip empty transmitted queues. */ /* The while loop will skip empty transmitted queues. */
while (NULL != (lchunk = sctp_list_dequeue(transmitted_queue))) { while (NULL != (lchunk = sctp_list_dequeue(transmitted_queue))) {
tchunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); tchunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
tsn = ntohl(tchunk->subh.data_hdr->tsn); tsn = ntohl(tchunk->subh.data_hdr->tsn);
if (sctp_acked(sack, tsn)) { if (sctp_acked(sack, tsn)) {
...@@ -1315,9 +1322,9 @@ static void sctp_check_transmitted(struct sctp_outq *q, ...@@ -1315,9 +1322,9 @@ static void sctp_check_transmitted(struct sctp_outq *q,
* first instance of the packet or a later * first instance of the packet or a later
* instance). * instance).
*/ */
if ((!tchunk->tsn_gap_acked) && if (!tchunk->tsn_gap_acked &&
(1 == tchunk->num_times_sent) && !tchunk->resent &&
(tchunk->rtt_in_progress)) { tchunk->rtt_in_progress) {
rtt = jiffies - tchunk->sent_at; rtt = jiffies - tchunk->sent_at;
sctp_transport_update_rto(transport, sctp_transport_update_rto(transport,
rtt); rtt);
...@@ -1557,7 +1564,8 @@ static void sctp_check_transmitted(struct sctp_outq *q, ...@@ -1557,7 +1564,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
* acked by the Cumulative TSN Ack. * acked by the Cumulative TSN Ack.
*/ */
while (NULL != (lchunk = sctp_list_dequeue(&tlist))) { while (NULL != (lchunk = sctp_list_dequeue(&tlist))) {
tchunk = list_entry(lchunk, sctp_chunk_t, transmitted_list); tchunk = list_entry(lchunk, struct sctp_chunk,
transmitted_list);
tsn = ntohl(tchunk->subh.data_hdr->tsn); tsn = ntohl(tchunk->subh.data_hdr->tsn);
/* RFC 2960 7.2.4, sctpimpguide-05 2.8.2 M3) Examine all /* RFC 2960 7.2.4, sctpimpguide-05 2.8.2 M3) Examine all
......
...@@ -393,7 +393,7 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, ...@@ -393,7 +393,7 @@ struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
{ {
struct rtable *rt; struct rtable *rt;
struct flowi fl; struct flowi fl;
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
rwlock_t *addr_lock; rwlock_t *addr_lock;
struct sockaddr_storage_list *laddr; struct sockaddr_storage_list *laddr;
struct list_head *pos; struct list_head *pos;
......
...@@ -97,7 +97,7 @@ static const sctp_ecn_capable_param_t ecap_param = { ...@@ -97,7 +97,7 @@ static const sctp_ecn_capable_param_t ecap_param = {
* provided chunk, as most cause codes will be embedded inside an * provided chunk, as most cause codes will be embedded inside an
* abort chunk. * abort chunk.
*/ */
void sctp_init_cause(sctp_chunk_t *chunk, __u16 cause_code, void sctp_init_cause(struct sctp_chunk *chunk, __u16 cause_code,
const void *payload, size_t paylen) const void *payload, size_t paylen)
{ {
sctp_errhdr_t err; sctp_errhdr_t err;
...@@ -158,14 +158,14 @@ void sctp_init_cause(sctp_chunk_t *chunk, __u16 cause_code, ...@@ -158,14 +158,14 @@ void sctp_init_cause(sctp_chunk_t *chunk, __u16 cause_code,
* Host Name Address (Note 3) Optional 11 * Host Name Address (Note 3) Optional 11
* Supported Address Types (Note 4) Optional 12 * Supported Address Types (Note 4) Optional 12
*/ */
sctp_chunk_t *sctp_make_init(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
const sctp_bind_addr_t *bp, const struct sctp_bind_addr *bp,
int gfp, int vparam_len) int gfp, int vparam_len)
{ {
sctp_inithdr_t init; sctp_inithdr_t init;
union sctp_params addrs; union sctp_params addrs;
size_t chunksize; size_t chunksize;
sctp_chunk_t *retval = NULL; struct sctp_chunk *retval = NULL;
int num_types, addrs_len = 0; int num_types, addrs_len = 0;
struct sctp_opt *sp; struct sctp_opt *sp;
sctp_supported_addrs_param_t sat; sctp_supported_addrs_param_t sat;
...@@ -235,12 +235,12 @@ sctp_chunk_t *sctp_make_init(const struct sctp_association *asoc, ...@@ -235,12 +235,12 @@ sctp_chunk_t *sctp_make_init(const struct sctp_association *asoc,
return retval; return retval;
} }
sctp_chunk_t *sctp_make_init_ack(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
int gfp, int unkparam_len) int gfp, int unkparam_len)
{ {
sctp_inithdr_t initack; sctp_inithdr_t initack;
sctp_chunk_t *retval; struct sctp_chunk *retval;
union sctp_params addrs; union sctp_params addrs;
int addrs_len; int addrs_len;
sctp_cookie_param_t *cookie; sctp_cookie_param_t *cookie;
...@@ -348,10 +348,10 @@ sctp_chunk_t *sctp_make_init_ack(const struct sctp_association *asoc, ...@@ -348,10 +348,10 @@ sctp_chunk_t *sctp_make_init_ack(const struct sctp_association *asoc,
* An implementation SHOULD make the cookie as small as possible * An implementation SHOULD make the cookie as small as possible
* to insure interoperability. * to insure interoperability.
*/ */
sctp_chunk_t *sctp_make_cookie_echo(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *asoc,
const sctp_chunk_t *chunk) const struct sctp_chunk *chunk)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
void *cookie; void *cookie;
int cookie_len; int cookie_len;
...@@ -399,10 +399,10 @@ sctp_chunk_t *sctp_make_cookie_echo(const struct sctp_association *asoc, ...@@ -399,10 +399,10 @@ sctp_chunk_t *sctp_make_cookie_echo(const struct sctp_association *asoc,
* *
* Set to zero on transmit and ignored on receipt. * Set to zero on transmit and ignored on receipt.
*/ */
sctp_chunk_t *sctp_make_cookie_ack(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *asoc,
const sctp_chunk_t *chunk) const struct sctp_chunk *chunk)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
retval = sctp_make_chunk(asoc, SCTP_CID_COOKIE_ACK, 0, 0); retval = sctp_make_chunk(asoc, SCTP_CID_COOKIE_ACK, 0, 0);
...@@ -444,11 +444,11 @@ sctp_chunk_t *sctp_make_cookie_ack(const struct sctp_association *asoc, ...@@ -444,11 +444,11 @@ sctp_chunk_t *sctp_make_cookie_ack(const struct sctp_association *asoc,
* *
* Note: The CWR is considered a Control chunk. * Note: The CWR is considered a Control chunk.
*/ */
sctp_chunk_t *sctp_make_cwr(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_cwr(const struct sctp_association *asoc,
const __u32 lowest_tsn, const __u32 lowest_tsn,
const sctp_chunk_t *chunk) const struct sctp_chunk *chunk)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
sctp_cwrhdr_t cwr; sctp_cwrhdr_t cwr;
cwr.lowest_tsn = htonl(lowest_tsn); cwr.lowest_tsn = htonl(lowest_tsn);
...@@ -479,10 +479,10 @@ sctp_chunk_t *sctp_make_cwr(const struct sctp_association *asoc, ...@@ -479,10 +479,10 @@ sctp_chunk_t *sctp_make_cwr(const struct sctp_association *asoc,
} }
/* Make an ECNE chunk. This is a congestion experienced report. */ /* Make an ECNE chunk. This is a congestion experienced report. */
sctp_chunk_t *sctp_make_ecne(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_ecne(const struct sctp_association *asoc,
const __u32 lowest_tsn) const __u32 lowest_tsn)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
sctp_ecnehdr_t ecne; sctp_ecnehdr_t ecne;
ecne.lowest_tsn = htonl(lowest_tsn); ecne.lowest_tsn = htonl(lowest_tsn);
...@@ -500,25 +500,27 @@ sctp_chunk_t *sctp_make_ecne(const struct sctp_association *asoc, ...@@ -500,25 +500,27 @@ sctp_chunk_t *sctp_make_ecne(const struct sctp_association *asoc,
/* Make a DATA chunk for the given association from the provided /* Make a DATA chunk for the given association from the provided
* parameters. However, do not populate the data payload. * parameters. However, do not populate the data payload.
*/ */
sctp_chunk_t *sctp_make_datafrag_empty(struct sctp_association *asoc, struct sctp_chunk *sctp_make_datafrag_empty(struct sctp_association *asoc,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int data_len, __u8 flags, __u16 ssn) int data_len, __u8 flags, __u16 ssn)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
sctp_datahdr_t dp; sctp_datahdr_t dp;
int chunk_len; int chunk_len;
/* We assign the TSN as LATE as possible, not here when /* We assign the TSN as LATE as possible, not here when
* creating the chunk. * creating the chunk.
*/ */
dp.tsn= 1000000; /* This marker is a debugging aid. */ dp.tsn = 0;
dp.stream = htons(sinfo->sinfo_stream); dp.stream = htons(sinfo->sinfo_stream);
dp.ppid = htonl(sinfo->sinfo_ppid); dp.ppid = htonl(sinfo->sinfo_ppid);
dp.ssn = htons(ssn);
/* Set the flags for an unordered send. */ /* Set the flags for an unordered send. */
if (sinfo->sinfo_flags & MSG_UNORDERED) if (sinfo->sinfo_flags & MSG_UNORDERED) {
flags |= SCTP_DATA_UNORDERED; flags |= SCTP_DATA_UNORDERED;
dp.ssn = 0;
} else
dp.ssn = htons(ssn);
chunk_len = sizeof(dp) + data_len; chunk_len = sizeof(dp) + data_len;
retval = sctp_make_chunk(asoc, SCTP_CID_DATA, flags, chunk_len); retval = sctp_make_chunk(asoc, SCTP_CID_DATA, flags, chunk_len);
...@@ -535,12 +537,12 @@ sctp_chunk_t *sctp_make_datafrag_empty(struct sctp_association *asoc, ...@@ -535,12 +537,12 @@ sctp_chunk_t *sctp_make_datafrag_empty(struct sctp_association *asoc,
/* Make a DATA chunk for the given association. Populate the data /* Make a DATA chunk for the given association. Populate the data
* payload. * payload.
*/ */
sctp_chunk_t *sctp_make_datafrag(struct sctp_association *asoc, struct sctp_chunk *sctp_make_datafrag(struct sctp_association *asoc,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int data_len, const __u8 *data, int data_len, const __u8 *data,
__u8 flags, __u16 ssn) __u8 flags, __u16 ssn)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
retval = sctp_make_datafrag_empty(asoc, sinfo, data_len, flags, ssn); retval = sctp_make_datafrag_empty(asoc, sinfo, data_len, flags, ssn);
if (retval) if (retval)
...@@ -552,11 +554,11 @@ sctp_chunk_t *sctp_make_datafrag(struct sctp_association *asoc, ...@@ -552,11 +554,11 @@ sctp_chunk_t *sctp_make_datafrag(struct sctp_association *asoc,
/* Make a DATA chunk for the given association to ride on stream id /* Make a DATA chunk for the given association to ride on stream id
* 'stream', with a payload id of 'payload', and a body of 'data'. * 'stream', with a payload id of 'payload', and a body of 'data'.
*/ */
sctp_chunk_t *sctp_make_data(struct sctp_association *asoc, struct sctp_chunk *sctp_make_data(struct sctp_association *asoc,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int data_len, const __u8 *data) int data_len, const __u8 *data)
{ {
sctp_chunk_t *retval = NULL; struct sctp_chunk *retval = NULL;
retval = sctp_make_data_empty(asoc, sinfo, data_len); retval = sctp_make_data_empty(asoc, sinfo, data_len);
if (retval) if (retval)
...@@ -569,7 +571,7 @@ sctp_chunk_t *sctp_make_data(struct sctp_association *asoc, ...@@ -569,7 +571,7 @@ sctp_chunk_t *sctp_make_data(struct sctp_association *asoc,
* hold 'data_len' octets of data. We use this version when we need * hold 'data_len' octets of data. We use this version when we need
* to build the message AFTER allocating memory. * to build the message AFTER allocating memory.
*/ */
sctp_chunk_t *sctp_make_data_empty(struct sctp_association *asoc, struct sctp_chunk *sctp_make_data_empty(struct sctp_association *asoc,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
int data_len) int data_len)
{ {
...@@ -582,9 +584,9 @@ sctp_chunk_t *sctp_make_data_empty(struct sctp_association *asoc, ...@@ -582,9 +584,9 @@ sctp_chunk_t *sctp_make_data_empty(struct sctp_association *asoc,
* association. This reports on which TSN's we've seen to date, * association. This reports on which TSN's we've seen to date,
* including duplicates and gaps. * including duplicates and gaps.
*/ */
sctp_chunk_t *sctp_make_sack(const struct sctp_association *asoc) struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
sctp_sackhdr_t sack; sctp_sackhdr_t sack;
sctp_gap_ack_block_t gab; sctp_gap_ack_block_t gab;
int length; int length;
...@@ -679,9 +681,9 @@ sctp_chunk_t *sctp_make_sack(const struct sctp_association *asoc) ...@@ -679,9 +681,9 @@ sctp_chunk_t *sctp_make_sack(const struct sctp_association *asoc)
} }
/* Make a SHUTDOWN chunk. */ /* Make a SHUTDOWN chunk. */
sctp_chunk_t *sctp_make_shutdown(const struct sctp_association *asoc) struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
sctp_shutdownhdr_t shut; sctp_shutdownhdr_t shut;
__u32 ctsn; __u32 ctsn;
...@@ -699,10 +701,10 @@ sctp_chunk_t *sctp_make_shutdown(const struct sctp_association *asoc) ...@@ -699,10 +701,10 @@ sctp_chunk_t *sctp_make_shutdown(const struct sctp_association *asoc)
return retval; return retval;
} }
sctp_chunk_t *sctp_make_shutdown_ack(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc,
const sctp_chunk_t *chunk) const struct sctp_chunk *chunk)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
retval = sctp_make_chunk(asoc, SCTP_CID_SHUTDOWN_ACK, 0, 0); retval = sctp_make_chunk(asoc, SCTP_CID_SHUTDOWN_ACK, 0, 0);
...@@ -721,10 +723,11 @@ sctp_chunk_t *sctp_make_shutdown_ack(const struct sctp_association *asoc, ...@@ -721,10 +723,11 @@ sctp_chunk_t *sctp_make_shutdown_ack(const struct sctp_association *asoc,
return retval; return retval;
} }
sctp_chunk_t *sctp_make_shutdown_complete(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_shutdown_complete(
const sctp_chunk_t *chunk) const struct sctp_association *asoc,
const struct sctp_chunk *chunk)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
__u8 flags = 0; __u8 flags = 0;
/* Maybe set the T-bit if we have no association. */ /* Maybe set the T-bit if we have no association. */
...@@ -751,11 +754,11 @@ sctp_chunk_t *sctp_make_shutdown_complete(const struct sctp_association *asoc, ...@@ -751,11 +754,11 @@ sctp_chunk_t *sctp_make_shutdown_complete(const struct sctp_association *asoc,
/* Create an ABORT. Note that we set the T bit if we have no /* Create an ABORT. Note that we set the T bit if we have no
* association. * association.
*/ */
sctp_chunk_t *sctp_make_abort(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_abort(const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
const size_t hint) const size_t hint)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
__u8 flags = 0; __u8 flags = 0;
/* Maybe set the T-bit if we have no association. */ /* Maybe set the T-bit if we have no association. */
...@@ -779,10 +782,11 @@ sctp_chunk_t *sctp_make_abort(const struct sctp_association *asoc, ...@@ -779,10 +782,11 @@ sctp_chunk_t *sctp_make_abort(const struct sctp_association *asoc,
} }
/* Helper to create ABORT with a NO_USER_DATA error. */ /* Helper to create ABORT with a NO_USER_DATA error. */
sctp_chunk_t *sctp_make_abort_no_data(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_abort_no_data(
const sctp_chunk_t *chunk, __u32 tsn) const struct sctp_association *asoc,
const struct sctp_chunk *chunk, __u32 tsn)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
__u32 payload; __u32 payload;
retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t)
...@@ -813,11 +817,11 @@ sctp_chunk_t *sctp_make_abort_no_data(const struct sctp_association *asoc, ...@@ -813,11 +817,11 @@ sctp_chunk_t *sctp_make_abort_no_data(const struct sctp_association *asoc,
} }
/* Helper to create ABORT with a SCTP_ERROR_USER_ABORT error. */ /* Helper to create ABORT with a SCTP_ERROR_USER_ABORT error. */
sctp_chunk_t *sctp_make_abort_user(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
const struct msghdr *msg) const struct msghdr *msg)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
void *payload = NULL, *payoff; void *payload = NULL, *payoff;
size_t paylen; size_t paylen;
struct iovec *iov = msg->msg_iov; struct iovec *iov = msg->msg_iov;
...@@ -860,11 +864,11 @@ sctp_chunk_t *sctp_make_abort_user(const struct sctp_association *asoc, ...@@ -860,11 +864,11 @@ sctp_chunk_t *sctp_make_abort_user(const struct sctp_association *asoc,
} }
/* Make a HEARTBEAT chunk. */ /* Make a HEARTBEAT chunk. */
sctp_chunk_t *sctp_make_heartbeat(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc,
const struct sctp_transport *transport, const struct sctp_transport *transport,
const void *payload, const size_t paylen) const void *payload, const size_t paylen)
{ {
sctp_chunk_t *retval = sctp_make_chunk(asoc, SCTP_CID_HEARTBEAT, struct sctp_chunk *retval = sctp_make_chunk(asoc, SCTP_CID_HEARTBEAT,
0, paylen); 0, paylen);
if (!retval) if (!retval)
...@@ -880,15 +884,16 @@ sctp_chunk_t *sctp_make_heartbeat(const struct sctp_association *asoc, ...@@ -880,15 +884,16 @@ sctp_chunk_t *sctp_make_heartbeat(const struct sctp_association *asoc,
return retval; return retval;
} }
sctp_chunk_t *sctp_make_heartbeat_ack(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
const void *payload, const size_t paylen) const void *payload, const size_t paylen)
{ {
sctp_chunk_t *retval = sctp_make_chunk(asoc, SCTP_CID_HEARTBEAT_ACK, struct sctp_chunk *retval;
0, paylen);
retval = sctp_make_chunk(asoc, SCTP_CID_HEARTBEAT_ACK, 0, paylen);
if (!retval) if (!retval)
goto nodata; goto nodata;
retval->subh.hbs_hdr = sctp_addto_chunk(retval, paylen, payload); retval->subh.hbs_hdr = sctp_addto_chunk(retval, paylen, payload);
/* RFC 2960 6.4 Multi-homed SCTP Endpoints /* RFC 2960 6.4 Multi-homed SCTP Endpoints
...@@ -910,11 +915,12 @@ sctp_chunk_t *sctp_make_heartbeat_ack(const struct sctp_association *asoc, ...@@ -910,11 +915,12 @@ sctp_chunk_t *sctp_make_heartbeat_ack(const struct sctp_association *asoc,
/* Create an Operation Error chunk with the specified space reserved. /* Create an Operation Error chunk with the specified space reserved.
* This routine can be used for containing multiple causes in the chunk. * This routine can be used for containing multiple causes in the chunk.
*/ */
sctp_chunk_t *sctp_make_op_error_space(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_op_error_space(
const sctp_chunk_t *chunk, const struct sctp_association *asoc,
size_t size) const struct sctp_chunk *chunk,
size_t size)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
retval = sctp_make_chunk(asoc, SCTP_CID_ERROR, 0, retval = sctp_make_chunk(asoc, SCTP_CID_ERROR, 0,
sizeof(sctp_errhdr_t) + size); sizeof(sctp_errhdr_t) + size);
...@@ -937,13 +943,14 @@ sctp_chunk_t *sctp_make_op_error_space(const struct sctp_association *asoc, ...@@ -937,13 +943,14 @@ sctp_chunk_t *sctp_make_op_error_space(const struct sctp_association *asoc,
} }
/* Create an Operation Error chunk. */ /* Create an Operation Error chunk. */
sctp_chunk_t *sctp_make_op_error(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
__u16 cause_code, const void *payload, __u16 cause_code, const void *payload,
size_t paylen) size_t paylen)
{ {
sctp_chunk_t *retval = sctp_make_op_error_space(asoc, chunk, paylen); struct sctp_chunk *retval;
retval = sctp_make_op_error_space(asoc, chunk, paylen);
if (!retval) if (!retval)
goto nodata; goto nodata;
...@@ -960,15 +967,15 @@ sctp_chunk_t *sctp_make_op_error(const struct sctp_association *asoc, ...@@ -960,15 +967,15 @@ sctp_chunk_t *sctp_make_op_error(const struct sctp_association *asoc,
/* Turn an skb into a chunk. /* Turn an skb into a chunk.
* FIXME: Eventually move the structure directly inside the skb->cb[]. * FIXME: Eventually move the structure directly inside the skb->cb[].
*/ */
sctp_chunk_t *sctp_chunkify(struct sk_buff *skb, struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
const struct sctp_association *asoc, const struct sctp_association *asoc,
struct sock *sk) struct sock *sk)
{ {
sctp_chunk_t *retval = t_new(sctp_chunk_t, GFP_ATOMIC); struct sctp_chunk *retval = t_new(struct sctp_chunk, GFP_ATOMIC);
if (!retval) if (!retval)
goto nodata; goto nodata;
memset(retval, 0, sizeof(sctp_chunk_t)); memset(retval, 0, sizeof(struct sctp_chunk));
if (!sk) { if (!sk) {
SCTP_DEBUG_PRINTK("chunkifying skb %p w/o an sk\n", skb); SCTP_DEBUG_PRINTK("chunkifying skb %p w/o an sk\n", skb);
...@@ -976,7 +983,7 @@ sctp_chunk_t *sctp_chunkify(struct sk_buff *skb, ...@@ -976,7 +983,7 @@ sctp_chunk_t *sctp_chunkify(struct sk_buff *skb,
retval->skb = skb; retval->skb = skb;
retval->asoc = (struct sctp_association *)asoc; retval->asoc = (struct sctp_association *)asoc;
retval->num_times_sent = 0; retval->resent = 0;
retval->has_tsn = 0; retval->has_tsn = 0;
retval->has_ssn = 0; retval->has_ssn = 0;
retval->rtt_in_progress = 0; retval->rtt_in_progress = 0;
...@@ -1006,7 +1013,7 @@ sctp_chunk_t *sctp_chunkify(struct sk_buff *skb, ...@@ -1006,7 +1013,7 @@ sctp_chunk_t *sctp_chunkify(struct sk_buff *skb,
} }
/* Set chunk->source and dest based on the IP header in chunk->skb. */ /* Set chunk->source and dest based on the IP header in chunk->skb. */
void sctp_init_addrs(sctp_chunk_t *chunk, union sctp_addr *src, void sctp_init_addrs(struct sctp_chunk *chunk, union sctp_addr *src,
union sctp_addr *dest) union sctp_addr *dest)
{ {
memcpy(&chunk->source, src, sizeof(union sctp_addr)); memcpy(&chunk->source, src, sizeof(union sctp_addr));
...@@ -1014,7 +1021,7 @@ void sctp_init_addrs(sctp_chunk_t *chunk, union sctp_addr *src, ...@@ -1014,7 +1021,7 @@ void sctp_init_addrs(sctp_chunk_t *chunk, union sctp_addr *src,
} }
/* Extract the source address from a chunk. */ /* Extract the source address from a chunk. */
const union sctp_addr *sctp_source(const sctp_chunk_t *chunk) const union sctp_addr *sctp_source(const struct sctp_chunk *chunk)
{ {
/* If we have a known transport, use that. */ /* If we have a known transport, use that. */
if (chunk->transport) { if (chunk->transport) {
...@@ -1028,10 +1035,10 @@ const union sctp_addr *sctp_source(const sctp_chunk_t *chunk) ...@@ -1028,10 +1035,10 @@ const union sctp_addr *sctp_source(const sctp_chunk_t *chunk)
/* Create a new chunk, setting the type and flags headers from the /* Create a new chunk, setting the type and flags headers from the
* arguments, reserving enough space for a 'paylen' byte payload. * arguments, reserving enough space for a 'paylen' byte payload.
*/ */
sctp_chunk_t *sctp_make_chunk(const struct sctp_association *asoc, struct sctp_chunk *sctp_make_chunk(const struct sctp_association *asoc,
__u8 type, __u8 flags, int paylen) __u8 type, __u8 flags, int paylen)
{ {
sctp_chunk_t *retval; struct sctp_chunk *retval;
sctp_chunkhdr_t *chunk_hdr; sctp_chunkhdr_t *chunk_hdr;
struct sk_buff *skb; struct sk_buff *skb;
struct sock *sk; struct sock *sk;
...@@ -1068,7 +1075,7 @@ sctp_chunk_t *sctp_make_chunk(const struct sctp_association *asoc, ...@@ -1068,7 +1075,7 @@ sctp_chunk_t *sctp_make_chunk(const struct sctp_association *asoc,
} }
/* Release the memory occupied by a chunk. */ /* Release the memory occupied by a chunk. */
void sctp_free_chunk(sctp_chunk_t *chunk) void sctp_free_chunk(struct sctp_chunk *chunk)
{ {
/* Make sure that we are not on any list. */ /* Make sure that we are not on any list. */
skb_unlink((struct sk_buff *) chunk); skb_unlink((struct sk_buff *) chunk);
...@@ -1085,7 +1092,7 @@ void sctp_free_chunk(sctp_chunk_t *chunk) ...@@ -1085,7 +1092,7 @@ void sctp_free_chunk(sctp_chunk_t *chunk)
/* Append bytes to the end of a chunk. Will panic if chunk is not big /* Append bytes to the end of a chunk. Will panic if chunk is not big
* enough. * enough.
*/ */
void *sctp_addto_chunk(sctp_chunk_t *chunk, int len, const void *data) void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
{ {
void *target; void *target;
void *padding; void *padding;
...@@ -1109,7 +1116,7 @@ void *sctp_addto_chunk(sctp_chunk_t *chunk, int len, const void *data) ...@@ -1109,7 +1116,7 @@ void *sctp_addto_chunk(sctp_chunk_t *chunk, int len, const void *data)
* chunk is not big enough. * chunk is not big enough.
* Returns a kernel err value. * Returns a kernel err value.
*/ */
static int sctp_user_addto_chunk(sctp_chunk_t *chunk, int off, int len, static int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
struct iovec *data) struct iovec *data)
{ {
__u8 *target; __u8 *target;
...@@ -1138,8 +1145,6 @@ static int sctp_user_addto_chunk(sctp_chunk_t *chunk, int off, int len, ...@@ -1138,8 +1145,6 @@ static int sctp_user_addto_chunk(sctp_chunk_t *chunk, int off, int len,
* with a reasonable guess than always doing our fragmentation on the * with a reasonable guess than always doing our fragmentation on the
* soft-interrupt. * soft-interrupt.
*/ */
int sctp_datachunks_from_user(struct sctp_association *asoc, int sctp_datachunks_from_user(struct sctp_association *asoc,
const struct sctp_sndrcvinfo *sinfo, const struct sctp_sndrcvinfo *sinfo,
struct msghdr *msg, int msg_len, struct msghdr *msg, int msg_len,
...@@ -1147,7 +1152,7 @@ int sctp_datachunks_from_user(struct sctp_association *asoc, ...@@ -1147,7 +1152,7 @@ int sctp_datachunks_from_user(struct sctp_association *asoc,
{ {
int max, whole, i, offset, over, err; int max, whole, i, offset, over, err;
int len, first_len; int len, first_len;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
__u8 frag; __u8 frag;
/* What is a reasonable fragmentation point right now? */ /* What is a reasonable fragmentation point right now? */
...@@ -1247,7 +1252,7 @@ int sctp_datachunks_from_user(struct sctp_association *asoc, ...@@ -1247,7 +1252,7 @@ int sctp_datachunks_from_user(struct sctp_association *asoc,
nomem: nomem:
err = -ENOMEM; err = -ENOMEM;
errout: errout:
while ((chunk = (sctp_chunk_t *)__skb_dequeue(chunks))) while ((chunk = (struct sctp_chunk *)__skb_dequeue(chunks)))
sctp_free_chunk(chunk); sctp_free_chunk(chunk);
out: out:
return err; return err;
...@@ -1256,7 +1261,7 @@ int sctp_datachunks_from_user(struct sctp_association *asoc, ...@@ -1256,7 +1261,7 @@ int sctp_datachunks_from_user(struct sctp_association *asoc,
/* Helper function to assign a TSN if needed. This assumes that both /* Helper function to assign a TSN if needed. This assumes that both
* the data_hdr and association have already been assigned. * the data_hdr and association have already been assigned.
*/ */
void sctp_chunk_assign_ssn(sctp_chunk_t *chunk) void sctp_chunk_assign_ssn(struct sctp_chunk *chunk)
{ {
__u16 ssn; __u16 ssn;
__u16 sid; __u16 sid;
...@@ -1283,7 +1288,7 @@ void sctp_chunk_assign_ssn(sctp_chunk_t *chunk) ...@@ -1283,7 +1288,7 @@ void sctp_chunk_assign_ssn(sctp_chunk_t *chunk)
/* Helper function to assign a TSN if needed. This assumes that both /* Helper function to assign a TSN if needed. This assumes that both
* the data_hdr and association have already been assigned. * the data_hdr and association have already been assigned.
*/ */
void sctp_chunk_assign_tsn(sctp_chunk_t *chunk) void sctp_chunk_assign_tsn(struct sctp_chunk *chunk)
{ {
if (!chunk->has_tsn) { if (!chunk->has_tsn) {
/* This is the last possible instant to /* This is the last possible instant to
...@@ -1346,7 +1351,7 @@ struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *ep, ...@@ -1346,7 +1351,7 @@ struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *ep,
*/ */
sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
const sctp_chunk_t *init_chunk, const struct sctp_chunk *init_chunk,
int *cookie_len, int *cookie_len,
const __u8 *raw_addrs, int addrs_len) const __u8 *raw_addrs, int addrs_len)
{ {
...@@ -1400,9 +1405,9 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, ...@@ -1400,9 +1405,9 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
ntohs(init_chunk->chunk_hdr->length)); ntohs(init_chunk->chunk_hdr->length));
/* Copy the raw local address list of the association. */ /* Copy the raw local address list of the association. */
memcpy((__u8 *)&cookie->c.peer_init[0] + memcpy((__u8 *)&cookie->c.peer_init[0] +
ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len); ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len);
if (sctp_sk(ep->base.sk)->hmac) { if (sctp_sk(ep->base.sk)->hmac) {
/* Sign the message. */ /* Sign the message. */
sg.page = virt_to_page(&cookie->c); sg.page = virt_to_page(&cookie->c);
...@@ -1410,8 +1415,8 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, ...@@ -1410,8 +1415,8 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
sg.length = bodysize; sg.length = bodysize;
keylen = SCTP_SECRET_SIZE; keylen = SCTP_SECRET_SIZE;
key = (char *)ep->secret_key[ep->current_key]; key = (char *)ep->secret_key[ep->current_key];
sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen,
&sg, 1, cookie->signature); &sg, 1, cookie->signature);
} }
...@@ -1423,8 +1428,8 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, ...@@ -1423,8 +1428,8 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
struct sctp_association *sctp_unpack_cookie( struct sctp_association *sctp_unpack_cookie(
const struct sctp_endpoint *ep, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, int gfp, struct sctp_chunk *chunk, int gfp,
int *error, sctp_chunk_t **errp) int *error, struct sctp_chunk **errp)
{ {
struct sctp_association *retval = NULL; struct sctp_association *retval = NULL;
sctp_signed_cookie_t *cookie; sctp_signed_cookie_t *cookie;
...@@ -1457,7 +1462,7 @@ struct sctp_association *sctp_unpack_cookie( ...@@ -1457,7 +1462,7 @@ struct sctp_association *sctp_unpack_cookie(
cookie = chunk->subh.cookie_hdr; cookie = chunk->subh.cookie_hdr;
bear_cookie = &cookie->c; bear_cookie = &cookie->c;
if (!sctp_sk(ep->base.sk)->hmac) if (!sctp_sk(ep->base.sk)->hmac)
goto no_hmac; goto no_hmac;
/* Check the signature. */ /* Check the signature. */
...@@ -1468,16 +1473,16 @@ struct sctp_association *sctp_unpack_cookie( ...@@ -1468,16 +1473,16 @@ struct sctp_association *sctp_unpack_cookie(
key = (char *)ep->secret_key[ep->current_key]; key = (char *)ep->secret_key[ep->current_key];
memset(digest, 0x00, sizeof(digest)); memset(digest, 0x00, sizeof(digest));
sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg, sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg,
1, digest); 1, digest);
if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) { if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) {
/* Try the previous key. */ /* Try the previous key. */
key = (char *)ep->secret_key[ep->last_key]; key = (char *)ep->secret_key[ep->last_key];
memset(digest, 0x00, sizeof(digest)); memset(digest, 0x00, sizeof(digest));
sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen,
&sg, 1, digest); &sg, 1, digest);
if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) { if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) {
/* Yikes! Still bad signature! */ /* Yikes! Still bad signature! */
*error = -SCTP_IERROR_BAD_SIG; *error = -SCTP_IERROR_BAD_SIG;
...@@ -1540,7 +1545,7 @@ struct sctp_association *sctp_unpack_cookie( ...@@ -1540,7 +1545,7 @@ struct sctp_association *sctp_unpack_cookie(
/* Also, add the destination address. */ /* Also, add the destination address. */
if (list_empty(&retval->base.bind_addr.address_list)) { if (list_empty(&retval->base.bind_addr.address_list)) {
sctp_add_bind_addr(&retval->base.bind_addr, &chunk->dest, sctp_add_bind_addr(&retval->base.bind_addr, &chunk->dest,
GFP_ATOMIC); GFP_ATOMIC);
} }
...@@ -1578,8 +1583,8 @@ struct __sctp_missing { ...@@ -1578,8 +1583,8 @@ struct __sctp_missing {
*/ */
static int sctp_process_missing_param(const struct sctp_association *asoc, static int sctp_process_missing_param(const struct sctp_association *asoc,
sctp_param_t paramtype, sctp_param_t paramtype,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_chunk_t **errp) struct sctp_chunk **errp)
{ {
struct __sctp_missing report; struct __sctp_missing report;
__u16 len; __u16 len;
...@@ -1605,8 +1610,8 @@ static int sctp_process_missing_param(const struct sctp_association *asoc, ...@@ -1605,8 +1610,8 @@ static int sctp_process_missing_param(const struct sctp_association *asoc,
/* Report an Invalid Mandatory Parameter. */ /* Report an Invalid Mandatory Parameter. */
static int sctp_process_inv_mandatory(const struct sctp_association *asoc, static int sctp_process_inv_mandatory(const struct sctp_association *asoc,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_chunk_t **errp) struct sctp_chunk **errp)
{ {
/* Invalid Mandatory Parameter Error has no payload. */ /* Invalid Mandatory Parameter Error has no payload. */
...@@ -1625,8 +1630,8 @@ static int sctp_process_inv_mandatory(const struct sctp_association *asoc, ...@@ -1625,8 +1630,8 @@ static int sctp_process_inv_mandatory(const struct sctp_association *asoc,
*/ */
static int sctp_process_hn_param(const struct sctp_association *asoc, static int sctp_process_hn_param(const struct sctp_association *asoc,
union sctp_params param, union sctp_params param,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_chunk_t **errp) struct sctp_chunk **errp)
{ {
__u16 len = ntohs(param.p->length); __u16 len = ntohs(param.p->length);
...@@ -1670,8 +1675,8 @@ static int sctp_process_hn_param(const struct sctp_association *asoc, ...@@ -1670,8 +1675,8 @@ static int sctp_process_hn_param(const struct sctp_association *asoc,
*/ */
static int sctp_process_unk_param(const struct sctp_association *asoc, static int sctp_process_unk_param(const struct sctp_association *asoc,
union sctp_params param, union sctp_params param,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_chunk_t **errp) struct sctp_chunk **errp)
{ {
int retval = 1; int retval = 1;
...@@ -1733,8 +1738,8 @@ static int sctp_process_unk_param(const struct sctp_association *asoc, ...@@ -1733,8 +1738,8 @@ static int sctp_process_unk_param(const struct sctp_association *asoc,
static int sctp_verify_param(const struct sctp_association *asoc, static int sctp_verify_param(const struct sctp_association *asoc,
union sctp_params param, union sctp_params param,
sctp_cid_t cid, sctp_cid_t cid,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_chunk_t **err_chunk) struct sctp_chunk **err_chunk)
{ {
int retval = 1; int retval = 1;
...@@ -1771,8 +1776,8 @@ static int sctp_verify_param(const struct sctp_association *asoc, ...@@ -1771,8 +1776,8 @@ static int sctp_verify_param(const struct sctp_association *asoc,
int sctp_verify_init(const struct sctp_association *asoc, int sctp_verify_init(const struct sctp_association *asoc,
sctp_cid_t cid, sctp_cid_t cid,
sctp_init_chunk_t *peer_init, sctp_init_chunk_t *peer_init,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_chunk_t **errp) struct sctp_chunk **errp)
{ {
union sctp_params param; union sctp_params param;
int has_cookie = 0; int has_cookie = 0;
......
...@@ -81,11 +81,11 @@ static void sctp_do_ecn_ce_work(struct sctp_association *asoc, ...@@ -81,11 +81,11 @@ static void sctp_do_ecn_ce_work(struct sctp_association *asoc,
* This element represents the lowest TSN number in the datagram * This element represents the lowest TSN number in the datagram
* that was originally marked with the CE bit. * that was originally marked with the CE bit.
*/ */
static sctp_chunk_t *sctp_do_ecn_ecne_work(struct sctp_association *asoc, static struct sctp_chunk *sctp_do_ecn_ecne_work(struct sctp_association *asoc,
__u32 lowest_tsn, __u32 lowest_tsn,
sctp_chunk_t *chunk) struct sctp_chunk *chunk)
{ {
sctp_chunk_t *repl; struct sctp_chunk *repl;
/* Our previously transmitted packet ran into some congestion /* Our previously transmitted packet ran into some congestion
* so we should take action by reducing cwnd and ssthresh * so we should take action by reducing cwnd and ssthresh
...@@ -528,7 +528,7 @@ static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds, ...@@ -528,7 +528,7 @@ static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
struct sctp_association *asoc, struct sctp_association *asoc,
struct sctp_transport *t, struct sctp_transport *t,
sctp_chunk_t *chunk) struct sctp_chunk *chunk)
{ {
sctp_sender_hb_info_t *hbinfo; sctp_sender_hb_info_t *hbinfo;
...@@ -596,7 +596,7 @@ static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds, ...@@ -596,7 +596,7 @@ static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
*/ */
static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds, static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
struct sctp_association *asoc, struct sctp_association *asoc,
sctp_chunk_t *chunk) struct sctp_chunk *chunk)
{ {
struct sctp_transport *t; struct sctp_transport *t;
...@@ -810,8 +810,8 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -810,8 +810,8 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
int error = 0; int error = 0;
int force; int force;
sctp_cmd_t *cmd; sctp_cmd_t *cmd;
sctp_chunk_t *new_obj; struct sctp_chunk *new_obj;
sctp_chunk_t *chunk = NULL; struct sctp_chunk *chunk = NULL;
struct sctp_packet *packet; struct sctp_packet *packet;
struct list_head *pos; struct list_head *pos;
struct timer_list *timer; struct timer_list *timer;
...@@ -819,8 +819,8 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, ...@@ -819,8 +819,8 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
struct sctp_transport *t; struct sctp_transport *t;
sctp_sackhdr_t sackh; sctp_sackhdr_t sackh;
if(SCTP_EVENT_T_TIMEOUT != event_type) if (SCTP_EVENT_T_TIMEOUT != event_type)
chunk = (sctp_chunk_t *) event_arg; chunk = (struct sctp_chunk *) event_arg;
/* Note: This whole file is a huge candidate for rework. /* Note: This whole file is a huge candidate for rework.
* For example, each command could either have its own handler, so * For example, each command could either have its own handler, so
......
...@@ -101,7 +101,7 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep, ...@@ -101,7 +101,7 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
/* RFC 2960 6.10 Bundling /* RFC 2960 6.10 Bundling
...@@ -185,10 +185,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep, ...@@ -185,10 +185,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_chunk_t *repl; struct sctp_chunk *repl;
struct sctp_association *new_asoc; struct sctp_association *new_asoc;
sctp_chunk_t *err_chunk; struct sctp_chunk *err_chunk;
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_unrecognized_param_t *unk_param; sctp_unrecognized_param_t *unk_param;
struct sock *sk; struct sock *sk;
...@@ -361,10 +361,10 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, ...@@ -361,10 +361,10 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_init_chunk_t *initchunk; sctp_init_chunk_t *initchunk;
__u32 init_tag; __u32 init_tag;
sctp_chunk_t *err_chunk; struct sctp_chunk *err_chunk;
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_disposition_t ret; sctp_disposition_t ret;
...@@ -386,7 +386,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, ...@@ -386,7 +386,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
* error and close the association by transmitting an ABORT. * error and close the association by transmitting an ABORT.
*/ */
if (!init_tag) { if (!init_tag) {
sctp_chunk_t *reply = sctp_make_abort(asoc, chunk, 0); struct sctp_chunk *reply = sctp_make_abort(asoc, chunk, 0);
if (!reply) if (!reply)
goto nomem; goto nomem;
...@@ -519,13 +519,13 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, ...@@ -519,13 +519,13 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
const sctp_subtype_t type, void *arg, const sctp_subtype_t type, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
struct sctp_association *new_asoc; struct sctp_association *new_asoc;
sctp_init_chunk_t *peer_init; sctp_init_chunk_t *peer_init;
sctp_chunk_t *repl; struct sctp_chunk *repl;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
int error = 0; int error = 0;
sctp_chunk_t *err_chk_p; struct sctp_chunk *err_chk_p;
/* If the packet is an OOTB packet which is temporarily on the /* If the packet is an OOTB packet which is temporarily on the
* control endpoint, respond with an ABORT. * control endpoint, respond with an ABORT.
...@@ -704,7 +704,7 @@ sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep, ...@@ -704,7 +704,7 @@ sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct sctp_transport *transport = (struct sctp_transport *) arg; struct sctp_transport *transport = (struct sctp_transport *) arg;
sctp_chunk_t *reply; struct sctp_chunk *reply;
sctp_sender_hb_info_t hbinfo; sctp_sender_hb_info_t hbinfo;
size_t paylen = 0; size_t paylen = 0;
...@@ -801,8 +801,8 @@ sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep, ...@@ -801,8 +801,8 @@ sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_chunk_t *reply; struct sctp_chunk *reply;
size_t paylen = 0; size_t paylen = 0;
/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
...@@ -868,7 +868,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, ...@@ -868,7 +868,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
union sctp_addr from_addr; union sctp_addr from_addr;
struct sctp_transport *link; struct sctp_transport *link;
sctp_sender_hb_info_t *hbinfo; sctp_sender_hb_info_t *hbinfo;
...@@ -919,7 +919,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, ...@@ -919,7 +919,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
* condition. * condition.
*/ */
static int sctp_sf_send_restart_abort(union sctp_addr *ssa, static int sctp_sf_send_restart_abort(union sctp_addr *ssa,
sctp_chunk_t *init, struct sctp_chunk *init,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
int len; int len;
...@@ -971,7 +971,7 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa, ...@@ -971,7 +971,7 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa,
*/ */
static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc, static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *init, struct sctp_chunk *init,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct sctp_transport *new_addr, *addr; struct sctp_transport *new_addr, *addr;
...@@ -1112,10 +1112,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1112,10 +1112,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
void *arg, sctp_cmd_seq_t *commands) void *arg, sctp_cmd_seq_t *commands)
{ {
sctp_disposition_t retval; sctp_disposition_t retval;
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_chunk_t *repl; struct sctp_chunk *repl;
struct sctp_association *new_asoc; struct sctp_association *new_asoc;
sctp_chunk_t *err_chunk; struct sctp_chunk *err_chunk;
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_unrecognized_param_t *unk_param; sctp_unrecognized_param_t *unk_param;
int len; int len;
...@@ -1377,13 +1377,13 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const struct sctp_endpoint *ep, ...@@ -1377,13 +1377,13 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const struct sctp_endpoint *ep,
*/ */
static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep, static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc) struct sctp_association *new_asoc)
{ {
sctp_init_chunk_t *peer_init; sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
sctp_chunk_t *repl; struct sctp_chunk *repl;
/* new_asoc is a brand-new association, so these are not yet /* new_asoc is a brand-new association, so these are not yet
* side effects--it is safe to run them here. * side effects--it is safe to run them here.
...@@ -1444,13 +1444,13 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep, ...@@ -1444,13 +1444,13 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep,
/* This case represents an initialization collision. */ /* This case represents an initialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep, static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc) struct sctp_association *new_asoc)
{ {
sctp_init_chunk_t *peer_init; sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
sctp_chunk_t *repl; struct sctp_chunk *repl;
/* new_asoc is a brand-new association, so these are not yet /* new_asoc is a brand-new association, so these are not yet
* side effects--it is safe to run them here. * side effects--it is safe to run them here.
...@@ -1508,7 +1508,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep, ...@@ -1508,7 +1508,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep,
/* This case represents an intialization collision. */ /* This case represents an intialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_c(const struct sctp_endpoint *ep, static sctp_disposition_t sctp_sf_do_dupcook_c(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc) struct sctp_association *new_asoc)
{ {
...@@ -1529,12 +1529,12 @@ static sctp_disposition_t sctp_sf_do_dupcook_c(const struct sctp_endpoint *ep, ...@@ -1529,12 +1529,12 @@ static sctp_disposition_t sctp_sf_do_dupcook_c(const struct sctp_endpoint *ep,
/* This case represents an intialization collision. */ /* This case represents an intialization collision. */
static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep, static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc) struct sctp_association *new_asoc)
{ {
struct sctp_ulpevent *ev = NULL; struct sctp_ulpevent *ev = NULL;
sctp_chunk_t *repl; struct sctp_chunk *repl;
/* Clarification from Implementor's Guide: /* Clarification from Implementor's Guide:
* D) When both local and remote tags match the endpoint should * D) When both local and remote tags match the endpoint should
...@@ -1610,11 +1610,11 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep, ...@@ -1610,11 +1610,11 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_disposition_t retval; sctp_disposition_t retval;
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
struct sctp_association *new_asoc; struct sctp_association *new_asoc;
int error = 0; int error = 0;
char action; char action;
sctp_chunk_t *err_chk_p; struct sctp_chunk *err_chk_p;
/* "Decode" the chunk. We have no optional parameters so we /* "Decode" the chunk. We have no optional parameters so we
* are in good shape. * are in good shape.
...@@ -1708,7 +1708,7 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort( ...@@ -1708,7 +1708,7 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort(
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
if (!sctp_vtag_verify_either(chunk, asoc)) if (!sctp_vtag_verify_either(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands); return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
...@@ -1731,7 +1731,7 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep, ...@@ -1731,7 +1731,7 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
if (!sctp_vtag_verify_either(chunk, asoc)) if (!sctp_vtag_verify_either(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands); return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
...@@ -1785,7 +1785,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const struct sctp_endpoint *ep, ...@@ -1785,7 +1785,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_errhdr_t *err; sctp_errhdr_t *err;
err = (sctp_errhdr_t *)(chunk->skb->data); err = (sctp_errhdr_t *)(chunk->skb->data);
...@@ -1839,14 +1839,14 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep, ...@@ -1839,14 +1839,14 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
time_t stale; time_t stale;
sctp_cookie_preserve_param_t bht; sctp_cookie_preserve_param_t bht;
sctp_errhdr_t *err; sctp_errhdr_t *err;
struct list_head *pos; struct list_head *pos;
struct sctp_transport *t; struct sctp_transport *t;
sctp_chunk_t *reply; struct sctp_chunk *reply;
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
int attempts; int attempts;
attempts = asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1; attempts = asoc->counters[SCTP_COUNTER_INIT_ERROR] + 1;
...@@ -1881,7 +1881,7 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep, ...@@ -1881,7 +1881,7 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
bht.lifespan_increment = htonl(stale); bht.lifespan_increment = htonl(stale);
/* Build that new INIT chunk. */ /* Build that new INIT chunk. */
bp = (sctp_bind_addr_t *) &asoc->base.bind_addr; bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht)); reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht));
if (!reply) if (!reply)
goto nomem; goto nomem;
...@@ -1954,7 +1954,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep, ...@@ -1954,7 +1954,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
__u16 error = SCTP_ERROR_NO_ERROR; __u16 error = SCTP_ERROR_NO_ERROR;
if (!sctp_vtag_verify_either(chunk, asoc)) if (!sctp_vtag_verify_either(chunk, asoc))
...@@ -1985,7 +1985,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep, ...@@ -1985,7 +1985,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
__u16 error = SCTP_ERROR_NO_ERROR; __u16 error = SCTP_ERROR_NO_ERROR;
if (!sctp_vtag_verify_either(chunk, asoc)) if (!sctp_vtag_verify_either(chunk, asoc))
...@@ -2064,7 +2064,7 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep, ...@@ -2064,7 +2064,7 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_shutdownhdr_t *sdh; sctp_shutdownhdr_t *sdh;
sctp_disposition_t disposition; sctp_disposition_t disposition;
...@@ -2119,8 +2119,8 @@ sctp_disposition_t sctp_sf_do_9_2_reshutack(const struct sctp_endpoint *ep, ...@@ -2119,8 +2119,8 @@ sctp_disposition_t sctp_sf_do_9_2_reshutack(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = (sctp_chunk_t *) arg; struct sctp_chunk *chunk = (struct sctp_chunk *) arg;
sctp_chunk_t *reply; struct sctp_chunk *reply;
reply = sctp_make_shutdown_ack(asoc, chunk); reply = sctp_make_shutdown_ack(asoc, chunk);
if (NULL == reply) if (NULL == reply)
...@@ -2174,7 +2174,7 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep, ...@@ -2174,7 +2174,7 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_cwrhdr_t *cwr; sctp_cwrhdr_t *cwr;
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
* that the value in the Verification Tag field of the * that the value in the Verification Tag field of the
...@@ -2230,7 +2230,7 @@ sctp_disposition_t sctp_sf_do_ecne(const struct sctp_endpoint *ep, ...@@ -2230,7 +2230,7 @@ sctp_disposition_t sctp_sf_do_ecne(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_ecnehdr_t *ecne; sctp_ecnehdr_t *ecne;
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
* that the value in the Verification Tag field of the * that the value in the Verification Tag field of the
...@@ -2287,9 +2287,9 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep, ...@@ -2287,9 +2287,9 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_datahdr_t *data_hdr; sctp_datahdr_t *data_hdr;
sctp_chunk_t *err; struct sctp_chunk *err;
size_t datalen; size_t datalen;
sctp_verb_t deliver; sctp_verb_t deliver;
int tmp; int tmp;
...@@ -2545,9 +2545,9 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep, ...@@ -2545,9 +2545,9 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_datahdr_t *data_hdr; sctp_datahdr_t *data_hdr;
sctp_chunk_t *err; struct sctp_chunk *err;
size_t datalen; size_t datalen;
int tmp; int tmp;
__u32 tsn; __u32 tsn;
...@@ -2720,7 +2720,7 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep, ...@@ -2720,7 +2720,7 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_sackhdr_t *sackh; sctp_sackhdr_t *sackh;
__u32 ctsn; __u32 ctsn;
...@@ -2782,8 +2782,8 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep, ...@@ -2782,8 +2782,8 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct sctp_packet *packet = NULL; struct sctp_packet *packet = NULL;
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_chunk_t *abort; struct sctp_chunk *abort;
packet = sctp_ootb_pkt_new(asoc, chunk); packet = sctp_ootb_pkt_new(asoc, chunk);
...@@ -2827,7 +2827,7 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep, ...@@ -2827,7 +2827,7 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
while (chunk->chunk_end > chunk->skb->data) { while (chunk->chunk_end > chunk->skb->data) {
...@@ -2864,8 +2864,8 @@ sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep, ...@@ -2864,8 +2864,8 @@ sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_chunk_t *reply; struct sctp_chunk *reply;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
/* 10.2 H) SHUTDOWN COMPLETE notification /* 10.2 H) SHUTDOWN COMPLETE notification
...@@ -2932,7 +2932,7 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, ...@@ -2932,7 +2932,7 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
struct sk_buff *skb = chunk->skb; struct sk_buff *skb = chunk->skb;
sctp_chunkhdr_t *ch; sctp_chunkhdr_t *ch;
__u8 *ch_end; __u8 *ch_end;
...@@ -2984,8 +2984,8 @@ sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep, ...@@ -2984,8 +2984,8 @@ sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct sctp_packet *packet = NULL; struct sctp_packet *packet = NULL;
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_chunk_t *shut; struct sctp_chunk *shut;
packet = sctp_ootb_pkt_new(asoc, chunk); packet = sctp_ootb_pkt_new(asoc, chunk);
...@@ -3069,8 +3069,8 @@ sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep, ...@@ -3069,8 +3069,8 @@ sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *unk_chunk = arg; struct sctp_chunk *unk_chunk = arg;
sctp_chunk_t *err_chunk; struct sctp_chunk *err_chunk;
sctp_chunkhdr_t *hdr; sctp_chunkhdr_t *hdr;
SCTP_DEBUG_PRINTK("Processing the unknown chunk id %d.\n", type.chunk); SCTP_DEBUG_PRINTK("Processing the unknown chunk id %d.\n", type.chunk);
...@@ -3206,7 +3206,7 @@ sctp_disposition_t lucky(const struct sctp_endpoint *ep, ...@@ -3206,7 +3206,7 @@ sctp_disposition_t lucky(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
* that the value in the Verification Tag field of the * that the value in the Verification Tag field of the
...@@ -3243,7 +3243,7 @@ sctp_disposition_t other_stupid(const struct sctp_endpoint *ep, ...@@ -3243,7 +3243,7 @@ sctp_disposition_t other_stupid(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
/* 8.5 When receiving an SCTP packet, the endpoint MUST ensure /* 8.5 When receiving an SCTP packet, the endpoint MUST ensure
* that the value in the Verification Tag field of the * that the value in the Verification Tag field of the
...@@ -3348,7 +3348,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep, ...@@ -3348,7 +3348,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *repl; struct sctp_chunk *repl;
/* The comment below says that we enter COOKIE-WAIT AFTER /* The comment below says that we enter COOKIE-WAIT AFTER
* sending the INIT, but that doesn't actually work in our * sending the INIT, but that doesn't actually work in our
...@@ -3454,7 +3454,7 @@ sctp_disposition_t sctp_sf_do_prm_send(const struct sctp_endpoint *ep, ...@@ -3454,7 +3454,7 @@ sctp_disposition_t sctp_sf_do_prm_send(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(chunk)); sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(chunk));
return SCTP_DISPOSITION_CONSUME; return SCTP_DISPOSITION_CONSUME;
...@@ -3564,7 +3564,7 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort( ...@@ -3564,7 +3564,7 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(
* if necessary to fill gaps. * if necessary to fill gaps.
*/ */
struct msghdr *msg = arg; struct msghdr *msg = arg;
sctp_chunk_t *abort; struct sctp_chunk *abort;
sctp_disposition_t retval; sctp_disposition_t retval;
retval = SCTP_DISPOSITION_CONSUME; retval = SCTP_DISPOSITION_CONSUME;
...@@ -3697,7 +3697,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort( ...@@ -3697,7 +3697,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct msghdr *msg = arg; struct msghdr *msg = arg;
sctp_chunk_t *abort; struct sctp_chunk *abort;
sctp_disposition_t retval; sctp_disposition_t retval;
/* Stop T1-init timer */ /* Stop T1-init timer */
...@@ -3909,7 +3909,7 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown( ...@@ -3909,7 +3909,7 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown(
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *reply; struct sctp_chunk *reply;
/* Once all its outstanding data has been acknowledged, the /* Once all its outstanding data has been acknowledged, the
* endpoint shall send a SHUTDOWN chunk to its peer including * endpoint shall send a SHUTDOWN chunk to its peer including
...@@ -3971,8 +3971,8 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown_ack( ...@@ -3971,8 +3971,8 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *chunk = (sctp_chunk_t *) arg; struct sctp_chunk *chunk = (struct sctp_chunk *) arg;
sctp_chunk_t *reply; struct sctp_chunk *reply;
/* If it has no more outstanding DATA chunks, the SHUTDOWN receiver /* If it has no more outstanding DATA chunks, the SHUTDOWN receiver
* shall send a SHUTDOWN ACK ... * shall send a SHUTDOWN ACK ...
...@@ -4152,8 +4152,8 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const struct sctp_endpoint *ep, ...@@ -4152,8 +4152,8 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *repl; struct sctp_chunk *repl;
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
sctp_event_timeout_t timer = (sctp_event_timeout_t) arg; sctp_event_timeout_t timer = (sctp_event_timeout_t) arg;
int timeout; int timeout;
int attempts; int attempts;
...@@ -4168,7 +4168,7 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const struct sctp_endpoint *ep, ...@@ -4168,7 +4168,7 @@ sctp_disposition_t sctp_sf_t1_timer_expire(const struct sctp_endpoint *ep,
(attempts < asoc->max_init_attempts)) { (attempts < asoc->max_init_attempts)) {
switch (timer) { switch (timer) {
case SCTP_EVENT_TIMEOUT_T1_INIT: case SCTP_EVENT_TIMEOUT_T1_INIT:
bp = (sctp_bind_addr_t *) &asoc->base.bind_addr; bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0); repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0);
break; break;
...@@ -4219,7 +4219,7 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep, ...@@ -4219,7 +4219,7 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *reply = NULL; struct sctp_chunk *reply = NULL;
SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); SCTP_DEBUG_PRINTK("Timer T2 expired.\n");
if (asoc->overall_error_count >= asoc->overall_error_threshold) { if (asoc->overall_error_count >= asoc->overall_error_threshold) {
...@@ -4279,7 +4279,7 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep, ...@@ -4279,7 +4279,7 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep,
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
sctp_chunk_t *reply = NULL; struct sctp_chunk *reply = NULL;
SCTP_DEBUG_PRINTK("Timer T5 expired.\n"); SCTP_DEBUG_PRINTK("Timer T5 expired.\n");
...@@ -4399,7 +4399,7 @@ sctp_disposition_t sctp_sf_timer_ignore(const struct sctp_endpoint *ep, ...@@ -4399,7 +4399,7 @@ sctp_disposition_t sctp_sf_timer_ignore(const struct sctp_endpoint *ep,
********************************************************************/ ********************************************************************/
/* Pull the SACK chunk based on the SACK header. */ /* Pull the SACK chunk based on the SACK header. */
sctp_sackhdr_t *sctp_sm_pull_sack(sctp_chunk_t *chunk) sctp_sackhdr_t *sctp_sm_pull_sack(struct sctp_chunk *chunk)
{ {
sctp_sackhdr_t *sack; sctp_sackhdr_t *sack;
__u16 num_blocks; __u16 num_blocks;
...@@ -4423,12 +4423,12 @@ sctp_sackhdr_t *sctp_sm_pull_sack(sctp_chunk_t *chunk) ...@@ -4423,12 +4423,12 @@ sctp_sackhdr_t *sctp_sm_pull_sack(sctp_chunk_t *chunk)
*/ */
struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep, struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
sctp_chunk_t *chunk, struct sctp_chunk *chunk,
const void *payload, const void *payload,
size_t paylen) size_t paylen)
{ {
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_chunk_t *abort; struct sctp_chunk *abort;
packet = sctp_ootb_pkt_new(asoc, chunk); packet = sctp_ootb_pkt_new(asoc, chunk);
...@@ -4458,7 +4458,7 @@ struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep, ...@@ -4458,7 +4458,7 @@ struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep,
/* Allocate a packet for responding in the OOTB conditions. */ /* Allocate a packet for responding in the OOTB conditions. */
struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc, struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc,
const sctp_chunk_t *chunk) const struct sctp_chunk *chunk)
{ {
struct sctp_packet *packet; struct sctp_packet *packet;
struct sctp_transport *transport; struct sctp_transport *transport;
...@@ -4524,9 +4524,9 @@ void sctp_ootb_pkt_free(struct sctp_packet *packet) ...@@ -4524,9 +4524,9 @@ void sctp_ootb_pkt_free(struct sctp_packet *packet)
/* Send a stale cookie error when a invalid COOKIE ECHO chunk is found */ /* Send a stale cookie error when a invalid COOKIE ECHO chunk is found */
void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep, void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
const sctp_chunk_t *chunk, const struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
sctp_chunk_t *err_chunk) struct sctp_chunk *err_chunk)
{ {
struct sctp_packet *packet; struct sctp_packet *packet;
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
/* Forward declarations for internal helper functions. */ /* Forward declarations for internal helper functions. */
static int sctp_writeable(struct sock *sk); static int sctp_writeable(struct sock *sk);
static inline int sctp_wspace(struct sctp_association *asoc); static inline int sctp_wspace(struct sctp_association *asoc);
static inline void sctp_set_owner_w(sctp_chunk_t *chunk); static inline void sctp_set_owner_w(struct sctp_chunk *chunk);
static void sctp_wfree(struct sk_buff *skb); static void sctp_wfree(struct sk_buff *skb);
static int sctp_wait_for_sndbuf(struct sctp_association *, long *timeo_p, static int sctp_wait_for_sndbuf(struct sctp_association *, long *timeo_p,
int msg_len); int msg_len);
...@@ -195,7 +195,7 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) ...@@ -195,7 +195,7 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
{ {
struct sctp_opt *sp = sctp_sk(sk); struct sctp_opt *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
sctp_bind_addr_t *bp = &ep->base.bind_addr; struct sctp_bind_addr *bp = &ep->base.bind_addr;
struct sctp_af *af; struct sctp_af *af;
unsigned short snum; unsigned short snum;
int ret = 0; int ret = 0;
...@@ -488,7 +488,7 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt) ...@@ -488,7 +488,7 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr_storage *addrs, int addrcnt)
struct sctp_opt *sp = sctp_sk(sk); struct sctp_opt *sp = sctp_sk(sk);
struct sctp_endpoint *ep = sp->ep; struct sctp_endpoint *ep = sp->ep;
int cnt; int cnt;
sctp_bind_addr_t *bp = &ep->base.bind_addr; struct sctp_bind_addr *bp = &ep->base.bind_addr;
int retval = 0; int retval = 0;
union sctp_addr saveaddr; union sctp_addr saveaddr;
...@@ -750,7 +750,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -750,7 +750,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *new_asoc=NULL, *asoc=NULL; struct sctp_association *new_asoc=NULL, *asoc=NULL;
struct sctp_transport *transport; struct sctp_transport *transport;
sctp_chunk_t *chunk = NULL; struct sctp_chunk *chunk = NULL;
union sctp_addr to; union sctp_addr to;
struct sockaddr *msg_name = NULL; struct sockaddr *msg_name = NULL;
struct sctp_sndrcvinfo default_sinfo = { 0 }; struct sctp_sndrcvinfo default_sinfo = { 0 };
...@@ -1020,7 +1020,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -1020,7 +1020,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
} }
/* Now send the (possibly) fragmented message. */ /* Now send the (possibly) fragmented message. */
while ((chunk = (sctp_chunk_t *)__skb_dequeue(&chunks))) { while ((chunk = (struct sctp_chunk *)__skb_dequeue(&chunks))) {
/* Do accounting for the write space. */ /* Do accounting for the write space. */
sctp_set_owner_w(chunk); sctp_set_owner_w(chunk);
...@@ -2177,7 +2177,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len, ...@@ -2177,7 +2177,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
char *optval, int *optlen) char *optval, int *optlen)
{ {
sctp_assoc_t id; sctp_assoc_t id;
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
struct sctp_association *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
int cnt = 0; int cnt = 0;
...@@ -2215,7 +2215,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len, ...@@ -2215,7 +2215,7 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
static int sctp_getsockopt_local_addrs(struct sock *sk, int len, static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
char *optval, int *optlen) char *optval, int *optlen)
{ {
sctp_bind_addr_t *bp; struct sctp_bind_addr *bp;
struct sctp_association *asoc; struct sctp_association *asoc;
struct list_head *pos; struct list_head *pos;
int cnt = 0; int cnt = 0;
...@@ -3200,7 +3200,7 @@ static inline int sctp_wspace(struct sctp_association *asoc) ...@@ -3200,7 +3200,7 @@ static inline int sctp_wspace(struct sctp_association *asoc)
* destructor in the data chunk skb for the purpose of the sndbuf space * destructor in the data chunk skb for the purpose of the sndbuf space
* tracking. * tracking.
*/ */
static inline void sctp_set_owner_w(sctp_chunk_t *chunk) static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
{ {
struct sctp_association *asoc = chunk->asoc; struct sctp_association *asoc = chunk->asoc;
struct sock *sk = asoc->base.sk; struct sock *sk = asoc->base.sk;
...@@ -3210,7 +3210,7 @@ static inline void sctp_set_owner_w(sctp_chunk_t *chunk) ...@@ -3210,7 +3210,7 @@ static inline void sctp_set_owner_w(sctp_chunk_t *chunk)
chunk->skb->destructor = sctp_wfree; chunk->skb->destructor = sctp_wfree;
/* Save the chunk pointer in skb for sctp_wfree to use later. */ /* Save the chunk pointer in skb for sctp_wfree to use later. */
*((sctp_chunk_t **)(chunk->skb->cb)) = chunk; *((struct sctp_chunk **)(chunk->skb->cb)) = chunk;
asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk); asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk);
sk->wmem_queued += SCTP_DATA_SNDSIZE(chunk); sk->wmem_queued += SCTP_DATA_SNDSIZE(chunk);
...@@ -3248,11 +3248,11 @@ static void __sctp_write_space(struct sctp_association *asoc) ...@@ -3248,11 +3248,11 @@ static void __sctp_write_space(struct sctp_association *asoc)
static void sctp_wfree(struct sk_buff *skb) static void sctp_wfree(struct sk_buff *skb)
{ {
struct sctp_association *asoc; struct sctp_association *asoc;
sctp_chunk_t *chunk; struct sctp_chunk *chunk;
struct sock *sk; struct sock *sk;
/* Get the saved chunk pointer. */ /* Get the saved chunk pointer. */
chunk = *((sctp_chunk_t **)(skb->cb)); chunk = *((struct sctp_chunk **)(skb->cb));
asoc = chunk->asoc; asoc = chunk->asoc;
sk = asoc->base.sk; sk = asoc->base.sk;
asoc->sndbuf_used -= SCTP_DATA_SNDSIZE(chunk); asoc->sndbuf_used -= SCTP_DATA_SNDSIZE(chunk);
......
...@@ -316,7 +316,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( ...@@ -316,7 +316,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
* error formats. * error formats.
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_remote_error( struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
const struct sctp_association *asoc, sctp_chunk_t *chunk, const struct sctp_association *asoc, struct sctp_chunk *chunk,
__u16 flags, int gfp) __u16 flags, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
...@@ -420,7 +420,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error( ...@@ -420,7 +420,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
* 5.3.1.4 SCTP_SEND_FAILED * 5.3.1.4 SCTP_SEND_FAILED
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_send_failed( struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
const struct sctp_association *asoc, sctp_chunk_t *chunk, const struct sctp_association *asoc, struct sctp_chunk *chunk,
__u16 flags, __u32 error, int gfp) __u16 flags, __u32 error, int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
...@@ -588,7 +588,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( ...@@ -588,7 +588,8 @@ struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
* 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
*/ */
struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
sctp_chunk_t *chunk, int gfp) struct sctp_chunk *chunk,
int gfp)
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
struct sctp_sndrcvinfo *info; struct sctp_sndrcvinfo *info;
......
...@@ -118,7 +118,7 @@ void sctp_ulpq_free(struct sctp_ulpq *ulpq) ...@@ -118,7 +118,7 @@ void sctp_ulpq_free(struct sctp_ulpq *ulpq)
} }
/* Process an incoming DATA chunk. */ /* Process an incoming DATA chunk. */
int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, sctp_chunk_t *chunk, int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
int gfp) int gfp)
{ {
struct sk_buff_head temp; struct sk_buff_head temp;
......
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