diff options
| author | Jon Grimm <jgrimm@touki.austin.ibm.com> | 2003-03-17 19:59:29 -0600 |
|---|---|---|
| committer | Jon Grimm <jgrimm@touki.austin.ibm.com> | 2003-03-17 19:59:29 -0600 |
| commit | c219cdceabe23ad0168bb00a61c98f3835c1298a (patch) | |
| tree | d6c017659aa46bab7c36eea985cf6f21a387f8d4 /include/net | |
| parent | b486a58170b495d67f3c5a57e3cdd0c89e089b54 (diff) | |
| parent | 74f53f9a1fa2832e89e28d77fa3d4b2217d0949b (diff) | |
Merge touki.austin.ibm.com:/home/jgrimm/bk/linux-2.5.65
into touki.austin.ibm.com:/home/jgrimm/bk/lksctp-2.5.work
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/sctp/command.h | 16 | ||||
| -rw-r--r-- | include/net/sctp/constants.h | 22 | ||||
| -rw-r--r-- | include/net/sctp/sctp.h | 49 | ||||
| -rw-r--r-- | include/net/sctp/sm.h | 46 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 56 | ||||
| -rw-r--r-- | include/net/sctp/user.h | 2 |
6 files changed, 87 insertions, 104 deletions
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 6603202d91f7..f730dd55f5ad 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -110,13 +110,13 @@ typedef union { sctp_event_timeout_t to; sctp_counter_t counter; void *ptr; - sctp_chunk_t *chunk; - sctp_association_t *asoc; + struct sctp_chunk *chunk; + struct sctp_association *asoc; struct sctp_transport *transport; - sctp_bind_addr_t *bp; + struct sctp_bind_addr *bp; sctp_init_chunk_t *init; struct sctp_ulpevent *ulpevent; - sctp_packet_t *packet; + struct sctp_packet *packet; sctp_sackhdr_t *sackh; } sctp_arg_t; @@ -158,13 +158,13 @@ SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) SCTP_ARG_CONSTRUCTOR(COUNTER, sctp_counter_t, counter) SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) -SCTP_ARG_CONSTRUCTOR(CHUNK, sctp_chunk_t *, chunk) -SCTP_ARG_CONSTRUCTOR(ASOC, sctp_association_t *, asoc) +SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) +SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) -SCTP_ARG_CONSTRUCTOR(BA, sctp_bind_addr_t *, bp) +SCTP_ARG_CONSTRUCTOR(BA, struct sctp_bind_addr *, bp) SCTP_ARG_CONSTRUCTOR(PEER_INIT, sctp_init_chunk_t *, init) SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) -SCTP_ARG_CONSTRUCTOR(PACKET, sctp_packet_t *, packet) +SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) typedef struct { diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 3cc94d900f95..8ddc88ed69fd 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -210,14 +210,19 @@ typedef enum { /* These are values for sk->state. * For a UDP-style SCTP socket, the states are defined as follows - * (at this point of time, may change later after more discussions: FIXME) - * A socket in SCTP_SS_UNCONNECTED state indicates that it is not willing - * to accept new associations, but it can initiate the creation of new - * ones. - * A socket in SCTP_SS_LISTENING state indicates that it is willing to - * accept new associations and can initiate the creation of new ones. - * A socket in SCTP_SS_ESTABLISHED state indicates that it is a peeled off - * socket with one association. + * - A socket in SCTP_SS_CLOSED state indicates that it is not willing to + * accept new associations, but it can initiate the creation of new ones. + * - A socket in SCTP_SS_LISTENING state indicates that it is willing to + * accept new associations and can initiate the creation of new ones. + * - A socket in SCTP_SS_ESTABLISHED state indicates that it is a peeled off + * socket with one association. + * For a TCP-style SCTP socket, the states are defined as follows + * - A socket in SCTP_SS_CLOSED state indicates that it is not willing to + * accept new associations, but it can initiate the creation of new ones. + * - 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. */ typedef enum { SCTP_SS_CLOSED = TCP_CLOSE, @@ -345,6 +350,7 @@ typedef enum { SCTP_XMIT_PMTU_FULL, SCTP_XMIT_RWND_FULL, SCTP_XMIT_MUST_FRAG, + SCTP_XMIT_NAGLE_DELAY, } sctp_xmit_t; /* These are the commands for manipulating transports. */ diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index b2e19ebde563..27a69518c2f9 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -121,9 +121,10 @@ /* * sctp_protocol.c */ -extern sctp_protocol_t sctp_proto; +extern struct sctp_protocol sctp_proto; extern struct sock *sctp_get_ctl_sock(void); -extern int sctp_copy_local_addr_list(sctp_protocol_t *, sctp_bind_addr_t *, +extern int sctp_copy_local_addr_list(struct sctp_protocol *, + struct sctp_bind_addr *, sctp_scope_t, int priority, 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); @@ -312,30 +313,21 @@ static inline void sctp_sysctl_unregister(void) { return; } #endif +/* Size of Supported Address Parameter for 'x' address types. */ +#define SCTP_SAT_LEN(x) (sizeof(struct sctp_paramhdr) + (x) * sizeof(__u16)) + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) extern int sctp_v6_init(void); extern void sctp_v6_exit(void); - static inline int sctp_ipv6_addr_type(const struct in6_addr *addr) { return ipv6_addr_type((struct in6_addr*) addr); } -#define SCTP_SAT_LEN (sizeof(sctp_paramhdr_t) + 2 * sizeof(__u16)) - -/* Note: These V6 macros are obsolescent. */ -/* Use this macro to enclose code fragments which are V6-dependent. */ -#define SCTP_V6(m...) m -#define SCTP_V6_SUPPORT 1 - #else /* #ifdef defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ #define sctp_ipv6_addr_type(a) 0 -#define SCTP_SAT_LEN (sizeof(sctp_paramhdr_t) + 1 * sizeof(__u16)) -#define SCTP_V6(m...) /* Do nothing. */ -#undef SCTP_V6_SUPPORT - static inline int sctp_v6_init(void) { return 0; } static inline void sctp_v6_exit(void) { return; } @@ -348,25 +340,10 @@ static inline sctp_assoc_t sctp_assoc2id(const sctp_association_t *asoc) return (sctp_assoc_t) asoc; } + /* Look up the association by its id. */ -static inline sctp_association_t *sctp_id2assoc(const struct sock *sk, sctp_assoc_t id) -{ - sctp_association_t *asoc = NULL; - - /* First, verify that this is a kernel address. */ - if (sctp_is_valid_kaddr((unsigned long) id)) { - sctp_association_t *temp = (sctp_association_t *) id; - - /* Verify that this _is_ an sctp_association_t - * data structure and if so, that the socket matches. - */ - if ((SCTP_ASSOC_EYECATCHER == temp->eyecatcher) && - (temp->base.sk == sk)) - asoc = temp; - } +sctp_association_t *sctp_id2assoc(struct sock *sk, sctp_assoc_t id); - return asoc; -} /* A macro to walk a list of skbs. */ #define sctp_skb_for_each(pos, head, tmp) \ @@ -494,7 +471,7 @@ extern void sctp_put_port(struct sock *sk); /* Static inline functions. */ /* Return the SCTP protocol structure. */ -static inline sctp_protocol_t *sctp_get_protocol(void) +static inline struct sctp_protocol *sctp_get_protocol(void) { return &sctp_proto; } @@ -523,21 +500,21 @@ static inline int ipver2af(__u8 ipver) /* This is the hash function for the SCTP port hash table. */ static inline int sctp_phashfn(__u16 lport) { - sctp_protocol_t *sctp_proto = sctp_get_protocol(); + struct sctp_protocol *sctp_proto = sctp_get_protocol(); return (lport & (sctp_proto->port_hashsize - 1)); } /* This is the hash function for the endpoint hash table. */ static inline int sctp_ep_hashfn(__u16 lport) { - sctp_protocol_t *sctp_proto = sctp_get_protocol(); + struct sctp_protocol *sctp_proto = sctp_get_protocol(); return (lport & (sctp_proto->ep_hashsize - 1)); } /* This is the hash function for the association hash table. */ static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) { - sctp_protocol_t *sctp_proto = sctp_get_protocol(); + struct sctp_protocol *sctp_proto = sctp_get_protocol(); int h = (lport << 16) + rport; h ^= h>>8; return (h & (sctp_proto->assoc_hashsize - 1)); @@ -549,7 +526,7 @@ static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) */ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) { - sctp_protocol_t *sctp_proto = sctp_get_protocol(); + struct sctp_protocol *sctp_proto = sctp_get_protocol(); int h = (lport << 16) + rport; h ^= vtag; return (h & (sctp_proto->assoc_hashsize-1)); diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 7b08e90a102a..16737eda8d8c 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -3,40 +3,40 @@ * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001-2002 International Business Machines Corp. - * + * * 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; - * you can redistribute it and/or modify it under the terms of + * + * 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. * 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. - * + * Boston, MA 02111-1307, USA. + * * Please send any bug reports or fixes you make to the * email addresses: * lksctp developers <lksctp-developers@lists.sourceforge.net> - * + * * Or submit a bug report through the following website: * http://www.sf.net/projects/lksctp * - * Written or modified by: + * Written or modified by: * La Monte H.P. Yarroll <piggy@acm.org> * Karl Knutson <karl@athena.chicago.il.us> * Xingang Guo <xingang.guo@intel.com> @@ -313,18 +313,18 @@ 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_packet_t *sctp_abort_pkt_new(const sctp_endpoint_t *ep, - const sctp_association_t *asoc, - sctp_chunk_t *chunk, - const void *payload, - size_t paylen); -sctp_packet_t *sctp_ootb_pkt_new(const sctp_association_t *asoc, - const sctp_chunk_t *chunk); -void sctp_ootb_pkt_free(sctp_packet_t *packet); +struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *, + const struct sctp_association *, + struct sctp_chunk *chunk, + const void *payload, + size_t paylen); +struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *, + const struct sctp_chunk *); +void sctp_ootb_pkt_free(struct sctp_packet *); sctp_cookie_param_t * -sctp_pack_cookie(const sctp_endpoint_t *, const sctp_association_t *, - const sctp_chunk_t *, int *cookie_len, +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 *, diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index cf6cec92f88f..913c4769b343 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -86,10 +86,8 @@ struct sctp_opt; struct sctp_endpoint_common; struct sctp_ssnmap; -typedef struct sctp_protocol sctp_protocol_t; typedef struct sctp_endpoint sctp_endpoint_t; typedef struct sctp_association sctp_association_t; -typedef struct sctp_packet sctp_packet_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; @@ -222,7 +220,7 @@ struct sctp_af { void (*get_saddr) (struct sctp_association *asoc, struct dst_entry *dst, union sctp_addr *daddr, - union sctp_addr *saddr); + union sctp_addr *saddr); void (*copy_addrlist) (struct list_head *, struct net_device *); void (*dst_saddr) (union sctp_addr *saddr, @@ -262,6 +260,9 @@ struct sctp_pf { const union sctp_addr *, struct sctp_opt *); int (*bind_verify) (struct sctp_opt *, union sctp_addr *); + int (*supported_addrs)(const struct sctp_opt *, __u16 *); + struct sock *(*create_accept_sk) (struct sock *sk, + struct sctp_association *asoc); struct sctp_af *af; }; @@ -366,8 +367,6 @@ typedef struct sctp_signed_cookie { sctp_cookie_t c; } sctp_signed_cookie_t; - - /* This is another convenience type to allocate memory for address * params for the maximum size and pass such structures around * internally. @@ -604,26 +603,26 @@ struct sctp_packet { typedef int (sctp_outq_thandler_t)(struct sctp_outq *, void *); typedef int (sctp_outq_ehandler_t)(struct sctp_outq *); -typedef sctp_packet_t *(sctp_outq_ohandler_init_t) - (sctp_packet_t *, +typedef struct sctp_packet *(sctp_outq_ohandler_init_t) + (struct sctp_packet *, struct sctp_transport *, __u16 sport, __u16 dport); -typedef sctp_packet_t *(sctp_outq_ohandler_config_t) - (sctp_packet_t *, +typedef struct sctp_packet *(sctp_outq_ohandler_config_t) + (struct sctp_packet *, __u32 vtag, int ecn_capable, sctp_packet_phandler_t *get_prepend_chunk); -typedef sctp_xmit_t (sctp_outq_ohandler_t)(sctp_packet_t *, +typedef sctp_xmit_t (sctp_outq_ohandler_t)(struct sctp_packet *, sctp_chunk_t *); -typedef int (sctp_outq_ohandler_force_t)(sctp_packet_t *); +typedef int (sctp_outq_ohandler_force_t)(struct sctp_packet *); sctp_outq_ohandler_init_t sctp_packet_init; sctp_outq_ohandler_config_t sctp_packet_config; sctp_outq_ohandler_t sctp_packet_append_chunk; sctp_outq_ohandler_t sctp_packet_transmit_chunk; sctp_outq_ohandler_force_t sctp_packet_transmit; -void sctp_packet_free(sctp_packet_t *); +void sctp_packet_free(struct sctp_packet *); /* This represents a remote transport address. @@ -789,7 +788,7 @@ struct sctp_transport { struct list_head transmitted; /* We build bundle-able packets for this transport here. */ - sctp_packet_t packet; + struct sctp_packet packet; /* This is the list of transports that have chunks to send. */ struct list_head send_ready; @@ -865,12 +864,11 @@ void sctp_inq_set_th_handler(struct sctp_inq *, void (*)(void *), void *); struct sctp_outq { sctp_association_t *asoc; - /* BUG: This really should be an array of streams. - * This really holds a list of chunks (one stream). - * FIXME: If true, why so? - */ + /* Data pending that has never been transmitted. */ struct sk_buff_head out; + unsigned out_qlen; /* Total length of queued data chunks. */ + /* These are control chunks we want to send. */ struct sk_buff_head control; @@ -885,7 +883,7 @@ struct sctp_outq { struct list_head retransmit; /* Call these functions to send chunks down to the next lower - * layer. This is always SCTP_packet, but we separate the two + * layer. This is always sctp_packet, but we separate the two * structures to make testing simpler. */ sctp_outq_ohandler_init_t *init_output; @@ -1098,8 +1096,9 @@ static inline sctp_endpoint_t *sctp_ep(sctp_endpoint_common_t *base) } /* These are function signatures for manipulating endpoints. */ -sctp_endpoint_t *sctp_endpoint_new(sctp_protocol_t *, struct sock *, int); -sctp_endpoint_t *sctp_endpoint_init(sctp_endpoint_t *, sctp_protocol_t *, +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 priority); void sctp_endpoint_free(sctp_endpoint_t *); void sctp_endpoint_put(sctp_endpoint_t *); @@ -1111,7 +1110,6 @@ sctp_association_t *sctp_endpoint_lookup_assoc(const sctp_endpoint_t *ep, int sctp_endpoint_is_peeled_off(sctp_endpoint_t *, const union sctp_addr *); sctp_endpoint_t *sctp_endpoint_is_match(sctp_endpoint_t *, const union sctp_addr *); - int sctp_has_association(const union sctp_addr *laddr, const union sctp_addr *paddr); @@ -1587,7 +1585,7 @@ struct sctp_transport *sctp_assoc_lookup_paddr(const sctp_association_t *, struct sctp_transport *sctp_assoc_add_peer(sctp_association_t *, const union sctp_addr *address, const int priority); -void sctp_assoc_control_transport(sctp_association_t *, +void sctp_assoc_control_transport(struct sctp_association *, struct sctp_transport *, sctp_transport_cmd_t, sctp_sn_error_t); struct sctp_transport *sctp_assoc_lookup_tsn(sctp_association_t *, __u32); @@ -1597,14 +1595,14 @@ struct sctp_transport *sctp_assoc_is_match(sctp_association_t *, void sctp_assoc_migrate(sctp_association_t *, struct sock *); void sctp_assoc_update(sctp_association_t *dst, sctp_association_t *src); -__u32 __sctp_association_get_next_tsn(sctp_association_t *); -__u32 __sctp_association_get_tsn_block(sctp_association_t *, int); -__u16 __sctp_association_get_next_ssn(sctp_association_t *, __u16 sid); - -void sctp_assoc_sync_pmtu(sctp_association_t *); -void sctp_assoc_rwnd_increase(sctp_association_t *, int); -void sctp_assoc_rwnd_decrease(sctp_association_t *, int); +__u32 sctp_association_get_next_tsn(struct sctp_association *); +__u32 sctp_association_get_tsn_block(struct sctp_association *, int); +void sctp_assoc_sync_pmtu(struct sctp_association *); +void sctp_assoc_rwnd_increase(struct sctp_association *, int); +void sctp_assoc_rwnd_decrease(struct sctp_association *, int); +void sctp_assoc_set_primary(struct sctp_association *, + struct sctp_transport *); int sctp_assoc_set_bind_addr_from_ep(sctp_association_t *, int); int sctp_assoc_set_bind_addr_from_cookie(sctp_association_t *, sctp_cookie_t *, int); diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 3ca725e132bd..e8cf2aedec87 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h @@ -108,6 +108,8 @@ enum sctp_optname { #define SCTP_GET_LOCAL_ADDRS_NUM SCTP_GET_LOCAL_ADDRS_NUM SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS + SCTP_NODELAY, /* Get/set nodelay option. */ +#define SCTP_NODELAY SCTP_NODELAY }; |
