diff options
| author | Sridhar Samudrala <sri@us.ibm.com> | 2003-05-06 02:52:20 -0700 |
|---|---|---|
| committer | Sridhar Samudrala <sri@us.ibm.com> | 2003-05-06 02:52:20 -0700 |
| commit | 3e446c25a5181ec4ea5a43928bd0aa73c5f853fb (patch) | |
| tree | d08dc20eea1a20ae6d43f68a88332673501d0e7c /include | |
| parent | efeed5ae7f1e4a06abb331da64a7c14de52b5ac9 (diff) | |
| parent | 09593bb6e686dfc8760b8479cf8c16bc8f0889f4 (diff) | |
Manual merge.
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/sctp/command.h | 2 | ||||
| -rw-r--r-- | include/net/sctp/constants.h | 56 | ||||
| -rw-r--r-- | include/net/sctp/sctp.h | 146 | ||||
| -rw-r--r-- | include/net/sctp/sm.h | 140 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 273 | ||||
| -rw-r--r-- | include/net/sctp/tsnmap.h | 2 | ||||
| -rw-r--r-- | include/net/sctp/ulpevent.h | 37 | ||||
| -rw-r--r-- | include/net/sctp/ulpqueue.h | 7 | ||||
| -rw-r--r-- | include/net/sctp/user.h | 4 |
9 files changed, 391 insertions, 276 deletions
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index f730dd55f5ad..1320363d12d2 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -182,7 +182,7 @@ typedef struct { /* Create a new sctp_command_sequence. * Return NULL if creating a new sequence fails. */ -sctp_cmd_seq_t *sctp_new_cmd_seq(int priority); +sctp_cmd_seq_t *sctp_new_cmd_seq(int gfp); /* Initialize a block of memory as a command sequence. * Return 0 if the initialization fails. diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 0d6a20a7390e..9cdd0e551c19 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -6,46 +6,42 @@ * * This file is part of the SCTP kernel reference Implementation * - * This file is part of the implementation of the add-IP extension, - * based on <draft-ietf-tsvwg-addip-sctp-02.txt> June 29, 2001, - * for the SCTP kernel reference Implementation. - * - * The SCTP reference implementation is free software; + * The SCTP reference implementation is free software; * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * - * the SCTP reference implementation is distributed in the hope that it - * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * The SCTP reference implementation is distributed in the hope that it + * will be useful, but WITHOUT ANY WARRANTY; without even the implied * ************************ - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU CC; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * - * Please send any bug reports or fixes you make to one of the following email - * addresses: + * Please send any bug reports or fixes you make to the + * email address(es): + * lksctp developers <lksctp-developers@lists.sourceforge.net> + * + * Or submit a bug report through the following website: + * http://www.sf.net/projects/lksctp * - * La Monte H.P. Yarroll <piggy@acm.org> - * Karl Knutson <karl@athena.chicago.il.us> - * Randall Stewart <randall@stewart.chicago.il.us> - * Ken Morneau <kmorneau@cisco.com> - * Qiaobing Xie <qxie1@motorola.com> - * Xingang Guo <xingang.guo@intel.com> - * Sridhar Samudrala <samudrala@us.ibm.com> - * Daisy Chang <daisyc@us.ibm.com> + * Written or modified by: + * La Monte H.P. Yarroll <piggy@acm.org> + * Karl Knutson <karl@athena.chicago.il.us> + * Randall Stewart <randall@stewart.chicago.il.us> + * Ken Morneau <kmorneau@cisco.com> + * Qiaobing Xie <qxie1@motorola.com> + * Xingang Guo <xingang.guo@intel.com> + * Sridhar Samudrala <samudrala@us.ibm.com> + * Daisy Chang <daisyc@us.ibm.com> * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. - * - * There are still LOTS of bugs in this code... I always run on the motto - * "it is a wonder any code ever works :)" - * - * */ #ifndef __sctp_constants_h__ @@ -220,7 +216,7 @@ typedef enum { * - A socket in SCTP_SS_LISTENING state indicates that it is willing to * accept new associations, but cannot initiate the creation of new ones. * - A socket in SCTP_SS_ESTABLISHED state indicates that it has a single - * association in ESTABLISHED state. + * association. */ typedef enum { SCTP_SS_CLOSED = TCP_CLOSE, @@ -336,10 +332,18 @@ typedef enum { #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ -#define SCTP_COOKIE_MULTIPLE 64 /* Pad out our cookie to make our hash +#define SCTP_COOKIE_MULTIPLE 32 /* Pad out our cookie to make our hash * functions simpler to write. */ +#if defined (CONFIG_SCTP_HMAC_MD5) +#define SCTP_COOKIE_HMAC_ALG "md5" +#elif defined (CONFIG_SCTP_HMAC_SHA1) +#define SCTP_COOKIE_HMAC_ALG "sha1" +#else +#define SCTP_COOKIE_HMAC_ALG NULL +#endif + /* These return values describe the success or failure of a number of * routines which form the lower interface to SCTP_outqueue. */ diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index f964badf7062..501e41da70a3 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -125,65 +125,61 @@ extern struct sctp_protocol sctp_proto; extern struct sock *sctp_get_ctl_sock(void); extern int sctp_copy_local_addr_list(struct sctp_protocol *, struct sctp_bind_addr *, - sctp_scope_t, int priority, int flags); + sctp_scope_t, int gfp, int flags); extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); extern int sctp_register_pf(struct sctp_pf *, sa_family_t); /* * sctp/socket.c */ -extern int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); -extern int sctp_inet_listen(struct socket *sock, int backlog); -extern void sctp_write_space(struct sock *sk); -extern unsigned int sctp_poll(struct file *file, struct socket *sock, +int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); +int sctp_inet_listen(struct socket *sock, int backlog); +void sctp_write_space(struct sock *sk); +unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait); /* * sctp/primitive.c */ -extern int sctp_primitive_ASSOCIATE(sctp_association_t *, void *arg); -extern int sctp_primitive_SHUTDOWN(sctp_association_t *, void *arg); -extern int sctp_primitive_ABORT(sctp_association_t *, void *arg); -extern int sctp_primitive_SEND(sctp_association_t *, void *arg); -extern int sctp_primitive_REQUESTHEARTBEAT(sctp_association_t *, void *arg); +int sctp_primitive_ASSOCIATE(struct sctp_association *, void *arg); +int sctp_primitive_SHUTDOWN(struct sctp_association *, void *arg); +int sctp_primitive_ABORT(struct sctp_association *, void *arg); +int sctp_primitive_SEND(struct sctp_association *, void *arg); +int sctp_primitive_REQUESTHEARTBEAT(struct sctp_association *, void *arg); /* * sctp/crc32c.c */ -extern __u32 sctp_start_cksum(__u8 *ptr, __u16 count); -extern __u32 sctp_update_cksum(__u8 *ptr, __u16 count, __u32 cksum); -extern __u32 sctp_end_cksum(__u32 cksum); +__u32 sctp_start_cksum(__u8 *ptr, __u16 count); +__u32 sctp_update_cksum(__u8 *ptr, __u16 count, __u32 cksum); +__u32 sctp_end_cksum(__u32 cksum); +__u32 sctp_update_copy_cksum(__u8 *, __u8 *, __u16 count, __u32 cksum); /* * sctp/input.c */ -extern int sctp_rcv(struct sk_buff *skb); -extern void sctp_v4_err(struct sk_buff *skb, u32 info); -extern void sctp_hash_established(sctp_association_t *); -extern void __sctp_hash_established(sctp_association_t *); -extern void sctp_unhash_established(sctp_association_t *); -extern void __sctp_unhash_established(sctp_association_t *); -extern void sctp_hash_endpoint(sctp_endpoint_t *); -extern void __sctp_hash_endpoint(sctp_endpoint_t *); -extern void sctp_unhash_endpoint(sctp_endpoint_t *); -extern void __sctp_unhash_endpoint(sctp_endpoint_t *); -extern sctp_association_t *__sctp_lookup_association(const union sctp_addr *, - const union sctp_addr *, - struct sctp_transport **); -extern struct sock *sctp_err_lookup(int family, struct sk_buff *, - struct sctphdr *, struct sctp_endpoint **, - struct sctp_association **, - struct sctp_transport **); -extern void sctp_err_finish(struct sock *, struct sctp_endpoint *, +int sctp_rcv(struct sk_buff *skb); +void sctp_v4_err(struct sk_buff *skb, u32 info); +void sctp_hash_established(struct sctp_association *); +void __sctp_hash_established(struct sctp_association *); +void sctp_unhash_established(struct sctp_association *); +void __sctp_unhash_established(struct sctp_association *); +void sctp_hash_endpoint(struct sctp_endpoint *); +void __sctp_hash_endpoint(struct sctp_endpoint *); +void sctp_unhash_endpoint(struct sctp_endpoint *); +void __sctp_unhash_endpoint(struct sctp_endpoint *); +struct sctp_association *__sctp_lookup_association( + const union sctp_addr *, + const union sctp_addr *, + struct sctp_transport **); +struct sock *sctp_err_lookup(int family, struct sk_buff *, + struct sctphdr *, struct sctp_endpoint **, + struct sctp_association **, + struct sctp_transport **); +void sctp_err_finish(struct sock *, struct sctp_endpoint *, struct sctp_association *); -extern void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, - struct sctp_transport *t, __u32 pmtu); -/* - * sctp/hashdriver.c - */ -extern void sctp_hash_digest(const char *secret, const int secret_len, - const char *text, const int text_len, - __u8 *digest); +void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, + struct sctp_transport *t, __u32 pmtu); /* * Section: Macros, externs, and inlines @@ -281,6 +277,7 @@ extern atomic_t sctp_dbg_objcnt_chunk; extern atomic_t sctp_dbg_objcnt_bind_addr; extern atomic_t sctp_dbg_objcnt_addr; extern atomic_t sctp_dbg_objcnt_ssnmap; +extern atomic_t sctp_dbg_objcnt_datamsg; /* Macros to atomically increment/decrement objcnt counters. */ #define SCTP_DBG_OBJCNT_INC(name) \ @@ -296,8 +293,8 @@ atomic_t sctp_dbg_objcnt_## name = ATOMIC_INIT(0) #define SCTP_DBG_OBJCNT_ENTRY(name) \ {.label= #name, .counter= &sctp_dbg_objcnt_## name} -extern void sctp_dbg_objcnt_init(void); -extern void sctp_dbg_objcnt_exit(void); +void sctp_dbg_objcnt_init(void); +void sctp_dbg_objcnt_exit(void); #else @@ -310,8 +307,8 @@ static inline void sctp_dbg_objcnt_exit(void) { return; } #endif /* CONFIG_SCTP_DBG_OBJCOUNT */ #if defined CONFIG_SYSCTL -extern void sctp_sysctl_register(void); -extern void sctp_sysctl_unregister(void); +void sctp_sysctl_register(void); +void sctp_sysctl_unregister(void); #else static inline void sctp_sysctl_register(void) { return; } static inline void sctp_sysctl_unregister(void) { return; } @@ -322,9 +319,9 @@ static inline void sctp_sysctl_unregister(void) { return; } #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -extern int sctp_v6_init(void); -extern void sctp_v6_exit(void); -extern void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, +int sctp_v6_init(void); +void sctp_v6_exit(void); +void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, int type, int code, int offset, __u32 info); #else /* #ifdef defined(CONFIG_IPV6) */ @@ -334,15 +331,26 @@ static inline void sctp_v6_exit(void) { return; } #endif /* #if defined(CONFIG_IPV6) */ +/* Some wrappers, in case crypto not available. */ +#if defined (CONFIG_CRYPTO_HMAC) +#define sctp_crypto_alloc_tfm crypto_alloc_tfm +#define sctp_crypto_free_tfm crypto_free_tfm +#define sctp_crypto_hmac crypto_hmac +#else +#define sctp_crypto_alloc_tfm(x...) NULL +#define sctp_crypto_free_tfm(x...) +#define sctp_crypto_hmac(x...) +#endif + + /* Map an association to an assoc_id. */ -static inline sctp_assoc_t sctp_assoc2id(const sctp_association_t *asoc) +static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) { return (sctp_assoc_t) asoc; } - /* Look up the association by its id. */ -sctp_association_t *sctp_id2assoc(struct sock *sk, sctp_assoc_t id); +struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id); /* A macro to walk a list of skbs. */ @@ -422,12 +430,16 @@ static inline __s32 sctp_jitter(__u32 rto) } /* Break down data chunks at this point. */ -static inline int sctp_frag_point(int pmtu) +static inline int sctp_frag_point(const struct sctp_opt *sp, int pmtu) { - pmtu -= SCTP_IP_OVERHEAD + sizeof(struct sctp_data_chunk); - pmtu -= sizeof(struct sctp_sack_chunk); + int frag = pmtu; + frag -= SCTP_IP_OVERHEAD + sizeof(struct sctp_data_chunk); + frag -= sizeof(struct sctp_sack_chunk); - return pmtu; + if (sp->user_frag) + frag = min_t(int, frag, sp->user_frag); + + return frag; } /* Walk through a list of TLV parameters. Don't trust the @@ -475,7 +487,7 @@ static inline void tv_add(const struct timeval *entered, struct timeval *leaved) extern struct proto sctp_prot; extern struct proc_dir_entry *proc_net_sctp; -extern void sctp_put_port(struct sock *sk); +void sctp_put_port(struct sock *sk); /* Static inline functions. */ @@ -501,10 +513,10 @@ static inline int ipver2af(__u8 ipver) /* Perform some sanity checks. */ static inline int sctp_sanity_check(void) { - SCTP_ASSERT(sizeof(struct sctp_ulpevent) <= + SCTP_ASSERT(sizeof(struct sctp_ulpevent) <= sizeof(((struct sk_buff *)0)->cb), "SCTP: ulpevent does not fit in skb!\n", return 0); - + return 1; } @@ -566,4 +578,26 @@ struct sctp6_sock { #define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp) +/* Is a socket of this style? */ +#define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) +int static inline __sctp_style(const struct sock *sk, sctp_socket_type_t style) +{ + return sctp_sk(sk)->type == style; +} + +/* Is the association in this state? */ +#define sctp_state(asoc, state) __sctp_state((asoc), (SCTP_STATE_##state)) +int static inline __sctp_state(const struct sctp_association *asoc, + sctp_state_t state) +{ + return asoc->state == state; +} + +/* Is the socket in this state? */ +#define sctp_sstate(sk, state) __sctp_sstate((sk), (SCTP_SS_##state)) +int static inline __sctp_sstate(const struct sock *sk, sctp_sock_state_t state) +{ + return sk->state == state; +} + #endif /* __net_sctp_h__ */ diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 6b9a30330630..787d77832290 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -6,10 +6,6 @@ * * This file is part of the SCTP kernel reference Implementation * - * This file is part of the implementation of the add-IP extension, - * based on <draft-ietf-tsvwg-addip-sctp-02.txt> June 29, 2001, - * for the SCTP kernel reference Implementation. - * * These are definitions needed by the state machine. * * The SCTP reference implementation is free software; @@ -50,7 +46,6 @@ * be incorporated into the next SCTP release. */ - #include <linux/types.h> #include <linux/compiler.h> #include <linux/slab.h> @@ -81,8 +76,8 @@ typedef struct { int action; } sctp_sm_command_t; -typedef sctp_disposition_t (sctp_state_fn_t) (const sctp_endpoint_t *, - const sctp_association_t *, +typedef sctp_disposition_t (sctp_state_fn_t) (const struct sctp_endpoint *, + const struct sctp_association *, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *); @@ -209,109 +204,104 @@ __u32 sctp_generate_verification_tag(void); void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); /* Prototypes for chunk-building functions. */ -sctp_chunk_t *sctp_make_init(const sctp_association_t *, - const sctp_bind_addr_t *, - int priority, int vparam_len); -sctp_chunk_t *sctp_make_init_ack(const sctp_association_t *, - const sctp_chunk_t *, - const int priority, +struct sctp_chunk *sctp_make_init(const struct sctp_association *, + const struct sctp_bind_addr *, + int gfp, int vparam_len); +struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *, + const struct sctp_chunk *, + const int gfp, const int unkparam_len); -sctp_chunk_t *sctp_make_cookie_echo(const sctp_association_t *, - const sctp_chunk_t *); -sctp_chunk_t *sctp_make_cookie_ack(const sctp_association_t *, - const sctp_chunk_t *); -sctp_chunk_t *sctp_make_cwr(const sctp_association_t *, +struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *, + const struct sctp_chunk *); +struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *, + const struct sctp_chunk *); +struct sctp_chunk *sctp_make_cwr(const struct sctp_association *, const __u32 lowest_tsn, - const sctp_chunk_t *); -sctp_chunk_t *sctp_make_datafrag(sctp_association_t *, + const struct sctp_chunk *); +struct sctp_chunk *sctp_make_datafrag(struct sctp_association *, const struct sctp_sndrcvinfo *sinfo, int len, const __u8 *data, __u8 flags, __u16 ssn); -sctp_chunk_t * sctp_make_datafrag_empty(sctp_association_t *, +struct sctp_chunk * sctp_make_datafrag_empty(struct sctp_association *, const struct sctp_sndrcvinfo *sinfo, int len, const __u8 flags, __u16 ssn); -sctp_chunk_t *sctp_make_data(sctp_association_t *, +struct sctp_chunk *sctp_make_data(struct sctp_association *, const struct sctp_sndrcvinfo *sinfo, int len, const __u8 *data); -sctp_chunk_t *sctp_make_data_empty(sctp_association_t *, +struct sctp_chunk *sctp_make_data_empty(struct sctp_association *, const struct sctp_sndrcvinfo *, int len); -sctp_chunk_t *sctp_make_ecne(const sctp_association_t *, +struct sctp_chunk *sctp_make_ecne(const struct sctp_association *, const __u32); -sctp_chunk_t *sctp_make_sack(const sctp_association_t *); -sctp_chunk_t *sctp_make_shutdown(const sctp_association_t *asoc); -sctp_chunk_t *sctp_make_shutdown_ack(const sctp_association_t *asoc, - const sctp_chunk_t *); -sctp_chunk_t *sctp_make_shutdown_complete(const sctp_association_t *, - const sctp_chunk_t *); -void sctp_init_cause(sctp_chunk_t *, __u16 cause, const void *, size_t); -sctp_chunk_t *sctp_make_abort(const sctp_association_t *, - const sctp_chunk_t *, +struct sctp_chunk *sctp_make_sack(const struct sctp_association *); +struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc); +struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc, + const struct sctp_chunk *); +struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *, + const struct sctp_chunk *); +void sctp_init_cause(struct sctp_chunk *, __u16 cause, const void *, size_t); +struct sctp_chunk *sctp_make_abort(const struct sctp_association *, + const struct sctp_chunk *, const size_t hint); -sctp_chunk_t *sctp_make_abort_no_data(const sctp_association_t *, - const sctp_chunk_t *, +struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *, + const struct sctp_chunk *, __u32 tsn); -sctp_chunk_t *sctp_make_abort_user(const sctp_association_t *, - const sctp_chunk_t *, +struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *, + const struct sctp_chunk *, const struct msghdr *); -sctp_chunk_t *sctp_make_heartbeat(const sctp_association_t *, +struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, const struct sctp_transport *, const void *payload, const size_t paylen); -sctp_chunk_t *sctp_make_heartbeat_ack(const sctp_association_t *, - const sctp_chunk_t *, +struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, + const struct sctp_chunk *, const void *payload, const size_t paylen); -sctp_chunk_t *sctp_make_op_error(const sctp_association_t *, - const sctp_chunk_t *chunk, +struct sctp_chunk *sctp_make_op_error(const struct sctp_association *, + const struct sctp_chunk *chunk, __u16 cause_code, const void *payload, size_t paylen); -void sctp_chunk_assign_tsn(sctp_chunk_t *); -void sctp_chunk_assign_ssn(sctp_chunk_t *); -int sctp_datachunks_from_user(sctp_association_t *, - const struct sctp_sndrcvinfo *, - struct msghdr *, int len, - struct sk_buff_head *); - +void sctp_chunk_assign_tsn(struct sctp_chunk *); +void sctp_chunk_assign_ssn(struct sctp_chunk *); /* Prototypes for statetable processing. */ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, sctp_state_t state, - sctp_endpoint_t *, - sctp_association_t *asoc, + struct sctp_endpoint *, + struct sctp_association *asoc, void *event_arg, - int priority); + int gfp); int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, sctp_state_t state, - sctp_endpoint_t *, - sctp_association_t *asoc, + struct sctp_endpoint *, + struct sctp_association *asoc, void *event_arg, sctp_disposition_t status, sctp_cmd_seq_t *commands, - int priority); + int gfp); /* 2nd level prototypes */ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, sctp_state_t state, - sctp_endpoint_t *ep, - sctp_association_t *asoc, + struct sctp_endpoint *ep, + struct sctp_association *asoc, void *event_arg, sctp_disposition_t status, sctp_cmd_seq_t *retval, - int priority); + int gfp); -int sctp_gen_sack(sctp_association_t *, int force, sctp_cmd_seq_t *); -void sctp_do_TSNdup(sctp_association_t *, sctp_chunk_t *, long gap); +int sctp_gen_sack(struct sctp_association *, int force, sctp_cmd_seq_t *); +void sctp_do_TSNdup(struct sctp_association *, struct sctp_chunk *, long gap); void sctp_generate_t3_rtx_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 *, const struct sctp_association *, struct sctp_chunk *chunk, @@ -325,21 +315,21 @@ sctp_cookie_param_t * sctp_pack_cookie(const struct sctp_endpoint *, const struct sctp_association *, const struct sctp_chunk *, int *cookie_len, const __u8 *, int addrs_len); -sctp_association_t *sctp_unpack_cookie(const sctp_endpoint_t *, - const sctp_association_t *, - sctp_chunk_t *, int priority, int *err, - sctp_chunk_t **err_chk_p); -int sctp_addip_addr_config(sctp_association_t *, sctp_param_t, +struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *, + const struct sctp_association *, + struct sctp_chunk *, int gfp, int *err, + struct sctp_chunk **err_chk_p); +int sctp_addip_addr_config(struct sctp_association *, sctp_param_t, struct sockaddr_storage*, int); -void sctp_send_stale_cookie_err(const sctp_endpoint_t *ep, - const sctp_association_t *asoc, - const sctp_chunk_t *chunk, +void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep, + const struct sctp_association *asoc, + const struct sctp_chunk *chunk, sctp_cmd_seq_t *commands, - sctp_chunk_t *err_chunk); + struct sctp_chunk *err_chunk); /* 3rd level prototypes */ -__u32 sctp_generate_tag(const sctp_endpoint_t *); -__u32 sctp_generate_tsn(const sctp_endpoint_t *); +__u32 sctp_generate_tag(const struct sctp_endpoint *); +__u32 sctp_generate_tsn(const struct sctp_endpoint *); /* 4th level prototypes */ void sctp_param2sockaddr(union sctp_addr *addr, sctp_addr_param_t *, @@ -361,7 +351,7 @@ extern sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES]; /* 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; @@ -449,8 +439,8 @@ 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. */ static inline int -sctp_vtag_verify_either(const sctp_chunk_t *chunk, - const sctp_association_t *asoc) +sctp_vtag_verify_either(const struct sctp_chunk *chunk, + const struct sctp_association *asoc) { /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 * diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 5cf74d3c2882..e804c52c82fc 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -70,7 +70,6 @@ union sctp_addr { struct sockaddr sa; }; - /* Forward declarations for data structures. */ struct sctp_protocol; struct sctp_endpoint; @@ -83,14 +82,9 @@ struct sctp_outq; struct sctp_bind_addr; struct sctp_ulpq; struct sctp_opt; -struct sctp_endpoint_common; +struct sctp_ep_common; struct sctp_ssnmap; -typedef struct sctp_endpoint sctp_endpoint_t; -typedef struct sctp_association sctp_association_t; -typedef struct sctp_chunk sctp_chunk_t; -typedef struct sctp_bind_addr sctp_bind_addr_t; -typedef struct sctp_endpoint_common sctp_endpoint_common_t; #include <net/sctp/tsnmap.h> #include <net/sctp/ulpevent.h> @@ -114,7 +108,7 @@ typedef struct sctp_bind_hashbucket { /* Used for hashing all associations. */ typedef struct sctp_hashbucket { rwlock_t lock; - sctp_endpoint_common_t *chain; + struct sctp_ep_common *chain; } sctp_hashbucket_t __attribute__((__aligned__(8))); @@ -235,7 +229,9 @@ struct sctp_af { int saddr); void (*from_sk) (union sctp_addr *, struct sock *sk); - void (*to_sk) (union sctp_addr *, + void (*to_sk_saddr) (union sctp_addr *, + struct sock *sk); + void (*to_sk_daddr) (union sctp_addr *, struct sock *sk); int (*addr_valid) (union sctp_addr *); sctp_scope_t (*scope) (union sctp_addr *); @@ -243,6 +239,7 @@ struct sctp_af { int (*is_any) (const union sctp_addr *); int (*available) (const union sctp_addr *); int (*skb_iif) (const struct sk_buff *sk); + int (*is_ce) (const struct sk_buff *sk); __u16 net_header_len; int sockaddr_len; sa_family_t sa_family; @@ -283,8 +280,11 @@ struct sctp_opt { /* PF_ family specific functions. */ struct sctp_pf *pf; + /* Access to HMAC transform. */ + struct crypto_tfm *hmac; + /* What is our base endpointer? */ - sctp_endpoint_t *ep; + struct sctp_endpoint *ep; /* Various Socket Options. */ __u16 default_stream; @@ -293,10 +293,12 @@ struct sctp_opt { struct sctp_rtoinfo rtoinfo; struct sctp_paddrparams paddrparam; struct sctp_event_subscribe subscribe; + int user_frag; __u32 autoclose; __u8 nodelay; __u8 disable_fragments; __u8 pd_mode; + __u8 v4mapped; /* Receive to here while partial delivery is in effect. */ struct sk_buff_head pd_lobby; @@ -448,6 +450,37 @@ static inline __u16 sctp_ssn_next(struct sctp_stream *stream, __u16 id) return stream->ssn[id]++; } +/* Structure to track chunk fragments that have been acked, but peer + * fragments of the same message have not. + */ +struct sctp_datamsg { + /* Chunks waiting to be submitted to lower layer. */ + struct list_head chunks; + /* Chunks that have been transmitted. */ + struct list_head track; + /* Reference counting. */ + atomic_t refcnt; + /* When is this message no longer interesting to the peer? */ + unsigned long expires_at; + /* Did the messenge fail to send? */ + int send_error; + char send_failed; + /* Control whether fragments from this message can expire. */ + char can_expire; +}; + +struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, + struct sctp_sndrcvinfo *, + struct msghdr *, int len); +struct sctp_datamsg *sctp_datamsg_new(int gfp); +void sctp_datamsg_put(struct sctp_datamsg *); +void sctp_datamsg_hold(struct sctp_datamsg *); +void sctp_datamsg_free(struct sctp_datamsg *); +void sctp_datamsg_track(struct sctp_chunk *); +void sctp_datamsg_assign(struct sctp_datamsg *, struct sctp_chunk *); +void sctp_datamsg_fail(struct sctp_chunk *, int error); +int sctp_datamsg_expires(struct sctp_chunk *); + /* RFC2960 1.4 Key Terms * @@ -462,9 +495,10 @@ struct sctp_chunk { * three elements of struct sk_buff. This allows us to reuse * all the skb_* queue management functions. */ - sctp_chunk_t *next; - sctp_chunk_t *prev; + struct sctp_chunk *next; + struct sctp_chunk *prev; struct sk_buff_head *list; + atomic_t refcnt; /* This is our link to the per-transport transmitted list. */ struct list_head transmitted_list; @@ -514,43 +548,52 @@ struct sctp_chunk { struct sctp_association *asoc; /* What endpoint received this chunk? */ - sctp_endpoint_common_t *rcvr; + struct sctp_ep_common *rcvr; /* We fill this in if we are calculating RTT. */ unsigned long sent_at; - __u8 rtt_in_progress; /* Is this chunk used for RTT calculation? */ - __u8 num_times_sent; /* How man times did we send this? */ - __u8 has_tsn; /* Does this chunk have a TSN yet? */ - __u8 has_ssn; /* Does this chunk have a SSN yet? */ - __u8 singleton; /* Was this the only 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 pdiscard; /* Discard the whole packet now? */ - __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ - __u8 fast_retransmit; /* Is this chunk fast retransmitted? */ - __u8 tsn_missing_report; /* Data chunk missing counter. */ - /* What is the origin IP address for this chunk? */ union sctp_addr source; /* Destination address for this chunk. */ union sctp_addr dest; + /* For outbound message, track all fragments for SEND_FAILED. */ + struct sctp_datamsg *msg; + /* For an inbound chunk, this tells us where it came from. * For an outbound chunk, it tells us where we'd like it to * go. It is NULL if we have no preference. */ struct sctp_transport *transport; + + __u8 rtt_in_progress; /* Is this chunk used for RTT calculation? */ + __u8 resent; /* Has this chunk ever been retransmitted. */ + __u8 has_tsn; /* Does this chunk have a TSN yet? */ + __u8 has_ssn; /* Does this chunk have a SSN yet? */ + __u8 singleton; /* Was this the only 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 pdiscard; /* Discard the whole packet now? */ + __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ + __u8 fast_retransmit; /* Is this chunk fast retransmitted? */ + __u8 tsn_missing_report; /* Data chunk missing counter. */ }; -sctp_chunk_t *sctp_make_chunk(const struct sctp_association *, __u8 type, - __u8 flags, int size); -void sctp_free_chunk(sctp_chunk_t *); -void *sctp_addto_chunk(sctp_chunk_t *chunk, int len, const void *data); -sctp_chunk_t *sctp_chunkify(struct sk_buff *, const struct sctp_association *, - struct sock *); -void sctp_init_addrs(sctp_chunk_t *, union sctp_addr *, union sctp_addr *); -const union sctp_addr *sctp_source(const sctp_chunk_t *chunk); +void sctp_chunk_hold(struct sctp_chunk *); +void sctp_chunk_put(struct sctp_chunk *); +int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, + struct iovec *data); +struct sctp_chunk *sctp_make_chunk(const struct sctp_association *, __u8 type, + __u8 flags, int size); +void sctp_chunk_free(struct sctp_chunk *); +void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); +struct sctp_chunk *sctp_chunkify(struct sk_buff *, + const struct sctp_association *, + struct sock *); +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. */ /* sin_family -- AF_INET or AF_INET6 @@ -562,7 +605,7 @@ struct sockaddr_storage_list { 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 * transmission. @@ -619,7 +662,7 @@ typedef struct sctp_packet *(sctp_outq_ohandler_config_t) int ecn_capable, sctp_packet_phandler_t *get_prepend_chunk); 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 *); sctp_outq_ohandler_init_t sctp_packet_init; @@ -697,7 +740,6 @@ struct sctp_transport { */ int rto_pending; - /* * These are the congestion stats. */ @@ -771,9 +813,6 @@ struct sctp_transport { */ int max_retrans; - /* We use this name for debugging output... */ - char *debug_name; - /* Per : A timer used by each destination. * Destination : * Timer : @@ -799,6 +838,35 @@ struct sctp_transport { struct list_head send_ready; int malloced; /* Is this structure kfree()able? */ + + /* State information saved for SFR_CACC algorithm. The key + * idea in SFR_CACC is to maintain state at the sender on a + * per-destination basis when a changeover happens. + * char changeover_active; + * char cycling_changeover; + * __u32 next_tsn_at_change; + * char cacc_saw_newack; + */ + struct { + /* An unsigned integer, which stores the next TSN to be + * used by the sender, at the moment of changeover. + */ + __u32 next_tsn_at_change; + + /* A flag which indicates the occurrence of a changeover */ + char changeover_active; + + /* A glag which indicates whether the change of primary is + * the first switch to this destination address during an + * active switch. + */ + char cycling_changeover; + + /* A temporary flag, which is used during the processing of + * a SACK to estimate the causative TSN(s)'s group. + */ + char cacc_saw_newack; + } cacc; }; struct sctp_transport *sctp_transport_new(const union sctp_addr *, int); @@ -831,7 +899,7 @@ struct sctp_inq { /* This is the packet which is currently off the in queue and is * 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 * messages. @@ -844,7 +912,7 @@ struct sctp_inq { struct sctp_inq *sctp_inq_new(void); void sctp_inq_init(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 *); void sctp_inq_set_th_handler(struct sctp_inq *, void (*)(void *), void *); @@ -904,18 +972,21 @@ struct sctp_outq { /* How many unackd bytes do we have in-flight? */ __u32 outstanding_bytes; + /* Corked? */ + char cork; + /* Is this structure empty? */ - int empty; + char empty; /* Are we kfree()able? */ - int malloced; + char malloced; }; struct sctp_outq *sctp_outq_new(struct sctp_association *); void sctp_outq_init(struct sctp_association *, struct sctp_outq *); void sctp_outq_teardown(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_sack(struct sctp_outq *, sctp_sackhdr_t *); int sctp_outq_is_empty(const struct sctp_outq *); @@ -926,10 +997,16 @@ int sctp_outq_set_output_handlers(struct sctp_outq *, sctp_outq_ohandler_t build, sctp_outq_ohandler_force_t force); void sctp_outq_restart(struct sctp_outq *); + void sctp_retransmit(struct sctp_outq *, struct sctp_transport *, sctp_retransmit_reason_t); void sctp_retransmit_mark(struct sctp_outq *, struct sctp_transport *, __u8); - +int sctp_outq_uncork(struct sctp_outq *); +/* Uncork and flush an outqueue. */ +static inline void sctp_outq_cork(struct sctp_outq *q) +{ + q->cork = 1; +} /* These bind address data fields common between endpoints and associations */ struct sctp_bind_addr { @@ -952,15 +1029,16 @@ struct sctp_bind_addr { int malloced; /* Are we kfree()able? */ }; -sctp_bind_addr_t *sctp_bind_addr_new(int gfp_mask); -void sctp_bind_addr_init(sctp_bind_addr_t *, __u16 port); -void sctp_bind_addr_free(sctp_bind_addr_t *); -int sctp_bind_addr_copy(sctp_bind_addr_t *dest, const sctp_bind_addr_t *src, +struct sctp_bind_addr *sctp_bind_addr_new(int gfp_mask); +void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); +void sctp_bind_addr_free(struct sctp_bind_addr *); +int sctp_bind_addr_copy(struct sctp_bind_addr *dest, + const struct sctp_bind_addr *src, 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 sctp_del_bind_addr(sctp_bind_addr_t *, union sctp_addr *); -int sctp_bind_addr_match(sctp_bind_addr_t *, const union sctp_addr *, +int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); +int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, struct sctp_opt *); union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, int *addrs_len, int gfp); @@ -973,7 +1051,7 @@ int sctp_is_any(const union sctp_addr *addr); int sctp_addr_is_valid(const union sctp_addr *addr); -/* What type of sctp_endpoint_common? */ +/* What type of endpoint? */ typedef enum { SCTP_EP_TYPE_SOCKET, SCTP_EP_TYPE_ASSOCIATION, @@ -995,10 +1073,10 @@ typedef enum { * */ -struct sctp_endpoint_common { +struct sctp_ep_common { /* Fields to help us manage our entries in the hash tables. */ - sctp_endpoint_common_t *next; - sctp_endpoint_common_t **pprev; + struct sctp_ep_common *next; + struct sctp_ep_common **pprev; int hashent; /* Runtime type information. What kind of endpoint is this? */ @@ -1024,7 +1102,7 @@ struct sctp_endpoint_common { * bind_addr.port is our shared port number. * 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. */ rwlock_t addr_lock; @@ -1052,12 +1130,7 @@ struct sctp_endpoint_common { struct sctp_endpoint { /* Common substructure for endpoint and association. */ - sctp_endpoint_common_t base; - - /* These are the system-wide defaults and other stuff which is - * endpoint-independent. - */ - struct sctp_protocol *proto; + struct sctp_ep_common base; /* Associations: A list of current associations and mappings * to the data consumers for each association. This @@ -1092,28 +1165,29 @@ struct sctp_endpoint { }; /* Recover the outter endpoint structure. */ -static inline sctp_endpoint_t *sctp_ep(sctp_endpoint_common_t *base) +static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base) { - sctp_endpoint_t *ep; + struct sctp_endpoint *ep; - ep = container_of(base, sctp_endpoint_t, base); + ep = container_of(base, struct sctp_endpoint, base); return ep; } /* These are function signatures for manipulating endpoints. */ -sctp_endpoint_t *sctp_endpoint_new(struct sctp_protocol *, struct sock *, int); -sctp_endpoint_t *sctp_endpoint_init(struct sctp_endpoint *, - struct sctp_protocol *, - struct sock *, int gfp); -void sctp_endpoint_free(sctp_endpoint_t *); -void sctp_endpoint_put(sctp_endpoint_t *); -void sctp_endpoint_hold(sctp_endpoint_t *); -void sctp_endpoint_add_asoc(sctp_endpoint_t *, struct sctp_association *asoc); -struct sctp_association *sctp_endpoint_lookup_assoc(const sctp_endpoint_t *ep, - const union sctp_addr *paddr, - struct sctp_transport **); -int sctp_endpoint_is_peeled_off(sctp_endpoint_t *, const union sctp_addr *); -sctp_endpoint_t *sctp_endpoint_is_match(sctp_endpoint_t *, +struct sctp_endpoint *sctp_endpoint_new(struct sock *, int); +struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *, + struct sock *, int gfp); +void sctp_endpoint_free(struct sctp_endpoint *); +void sctp_endpoint_put(struct sctp_endpoint *); +void sctp_endpoint_hold(struct sctp_endpoint *); +void sctp_endpoint_add_asoc(struct sctp_endpoint *, struct sctp_association *); +struct sctp_association *sctp_endpoint_lookup_assoc( + const struct sctp_endpoint *ep, + const union sctp_addr *paddr, + struct sctp_transport **); +int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, + const union sctp_addr *); +struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, const union sctp_addr *); int sctp_has_association(const union sctp_addr *laddr, const union sctp_addr *paddr); @@ -1126,8 +1200,8 @@ int sctp_process_init(struct sctp_association *, sctp_cid_t cid, sctp_init_chunk_t *init, int gfp); int sctp_process_param(struct sctp_association *, union sctp_params param, const union sctp_addr *from, int gfp); -__u32 sctp_generate_tag(const sctp_endpoint_t *); -__u32 sctp_generate_tsn(const sctp_endpoint_t *); +__u32 sctp_generate_tag(const struct sctp_endpoint *); +__u32 sctp_generate_tsn(const struct sctp_endpoint *); /* RFC2960 @@ -1150,7 +1224,7 @@ struct sctp_association { * In this context, it represents the associations's view * of the local endpoint of the association. */ - sctp_endpoint_common_t base; + struct sctp_ep_common base; /* Associations on the same socket. */ struct list_head asocs; @@ -1162,7 +1236,7 @@ struct sctp_association { __u32 eyecatcher; /* This is our parent endpoint. */ - sctp_endpoint_t *ep; + struct sctp_endpoint *ep; /* These are those association elements needed in the cookie. */ sctp_cookie_t c; @@ -1337,7 +1411,6 @@ struct sctp_association { /* The largest timeout or RTO value to use in attempting an INIT */ __u16 max_init_timeo; - int timeouts[SCTP_NUM_TIMEOUT_TYPES]; struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; @@ -1438,9 +1511,6 @@ struct sctp_association { */ struct sctp_ulpq ulpq; - /* Need to send an ECNE Chunk? */ - int need_ecne; - /* Last TSN that caused an ECNE Chunk to be sent. */ __u32 last_ecne_tsn; @@ -1453,9 +1523,6 @@ struct sctp_association { /* Number of seconds of idle time before an association is closed. */ __u32 autoclose; - /* Name for debugging output... */ - char *debug_name; - /* These are to support * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses * and Enforcement of Flow and Message Limits" @@ -1463,8 +1530,7 @@ struct sctp_association { * or "ADDIP" for short. */ - /* Is the ADDIP extension enabled for this association? */ - int addip_enable; + /* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks * @@ -1480,7 +1546,7 @@ struct sctp_association { * [This is our one-and-only-one ASCONF in flight. If we do * 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. * @@ -1495,7 +1561,7 @@ struct sctp_association { * [This is our saved ASCONF-ACK. We invalidate it when a new * 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. * @@ -1548,6 +1614,15 @@ struct sctp_association { * after reaching 4294967295. */ __u32 addip_serial; + + /* Is the ADDIP extension enabled for this association? */ + char addip_enable; + + /* Need to send an ECNE Chunk? */ + char need_ecne; + + /* Is it a temporary association? */ + char temp; }; @@ -1559,7 +1634,7 @@ enum { }; /* Recover the outter association structure. */ -static inline struct sctp_association *sctp_assoc(sctp_endpoint_common_t *base) +static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base) { struct sctp_association *asoc; @@ -1571,10 +1646,10 @@ static inline struct sctp_association *sctp_assoc(sctp_endpoint_common_t *base) struct sctp_association * -sctp_association_new(const sctp_endpoint_t *, const struct sock *, +sctp_association_new(const struct sctp_endpoint *, const struct sock *, sctp_scope_t scope, int gfp); struct sctp_association * -sctp_association_init(struct sctp_association *, const sctp_endpoint_t *, +sctp_association_init(struct sctp_association *, const struct sctp_endpoint *, const struct sock *, sctp_scope_t scope, int gfp); void sctp_association_free(struct sctp_association *); @@ -1614,8 +1689,8 @@ int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, int sctp_cmp_addr_exact(const union sctp_addr *ss1, const union sctp_addr *ss2); -sctp_chunk_t *sctp_get_ecne_prepend(struct sctp_association *asoc); -sctp_chunk_t *sctp_get_no_prepend(struct sctp_association *asoc); +struct sctp_chunk *sctp_get_ecne_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. */ typedef struct sctp_cmsgs { diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h index 61e26a90abf4..103d111ea040 100644 --- a/include/net/sctp/tsnmap.h +++ b/include/net/sctp/tsnmap.h @@ -114,7 +114,7 @@ struct sctp_tsnmap_iter { }; /* Create a new tsnmap. */ -struct sctp_tsnmap *sctp_tsnmap_new(__u16 len, __u32 init_tsn, int priority); +struct sctp_tsnmap *sctp_tsnmap_new(__u16 len, __u32 init_tsn, int gfp); /* Dispose of a tsnmap. */ void sctp_tsnmap_free(struct sctp_tsnmap *); diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index d508ca47ea4d..d3ad0c86583d 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h @@ -10,13 +10,15 @@ * sctp_ulpevent type is used to carry information from the state machine * upwards to the ULP. * - * The SCTP reference implementation is free software; + * This file is part of the SCTP kernel reference Implementation + * + * The SCTP reference implementation is free software; * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * - * the SCTP reference implementation is distributed in the hope that it + * The SCTP reference implementation is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without even the implied * ************************ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -27,12 +29,17 @@ * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * - * Please send any bug reports or fixes you make to one of the - * following email addresses: + * Please send any bug reports or fixes you make to the + * email address(es): + * lksctp developers <lksctp-developers@lists.sourceforge.net> + * + * Or submit a bug report through the following website: + * http://www.sf.net/projects/lksctp * - * Jon Grimm <jgrimm@us.ibm.com> - * La Monte H.P. Yarroll <piggy@acm.org> - * Karl Knutson <karl@athena.chicago.il.us> + * Written or modified by: + * Jon Grimm <jgrimm@us.ibm.com> + * La Monte H.P. Yarroll <piggy@acm.org> + * Karl Knutson <karl@athena.chicago.il.us> * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. @@ -64,7 +71,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb) return (struct sctp_ulpevent *)skb->cb; } -struct sctp_ulpevent *sctp_ulpevent_new(int size, int flags, int priority); +struct sctp_ulpevent *sctp_ulpevent_new(int size, int flags, int gfp); struct sctp_ulpevent *sctp_ulpevent_init(struct sctp_ulpevent *, int flags); void sctp_ulpevent_free(struct sctp_ulpevent *); int sctp_ulpevent_is_notification(const struct sctp_ulpevent *); @@ -76,7 +83,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( __u16 error, __u16 outbound, __u16 inbound, - int priority); + int gfp); struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( const struct sctp_association *asoc, @@ -84,32 +91,32 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( int flags, int state, int error, - int priority); + int gfp); struct sctp_ulpevent *sctp_ulpevent_make_remote_error( const struct sctp_association *asoc, struct sctp_chunk *chunk, __u16 flags, - int priority); + int gfp); struct sctp_ulpevent *sctp_ulpevent_make_send_failed( const struct sctp_association *asoc, struct sctp_chunk *chunk, __u16 flags, __u32 error, - int priority); + int gfp); struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( const struct sctp_association *asoc, __u16 flags, - int priority); + int gfp); struct sctp_ulpevent *sctp_ulpevent_make_pdapi( const struct sctp_association *asoc, - __u32 indication, int priority); + __u32 indication, int gfp); struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, struct sctp_chunk *chunk, - int priority); + int gfp); void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, struct msghdr *); diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index 334dbf1138ef..69541c80301e 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h @@ -50,14 +50,15 @@ struct sctp_ulpq { char malloced; char pd_mode; - sctp_association_t *asoc; + struct sctp_association *asoc; struct sk_buff_head reasm; struct sk_buff_head lobby; }; /* Prototypes. */ -struct sctp_ulpq *sctp_ulpq_new(sctp_association_t *asoc, int priority); -struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, sctp_association_t *); +struct sctp_ulpq *sctp_ulpq_new(struct sctp_association *asoc, int gfp); +struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, + struct sctp_association *); void sctp_ulpq_free(struct sctp_ulpq *); /* Add a new DATA chunk for processing. */ diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index e8cf2aedec87..5494148e0b10 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h @@ -110,6 +110,10 @@ enum sctp_optname { #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS SCTP_NODELAY, /* Get/set nodelay option. */ #define SCTP_NODELAY SCTP_NODELAY + SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ +#define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR + SCTP_MAXSEG, /* Get/set maximum fragment. */ +#define SCTP_MAXSEG SCTP_MAXSEG }; |
