vserver 1.9.5.x5
[linux-2.6.git] / include / net / sctp / structs.h
index 26c97aa..7e64cf6 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/socket.h>      /* linux/in.h needs this!!    */
 #include <linux/in.h>          /* We get struct sockaddr_in. */
 #include <linux/in6.h>         /* We get struct in6_addr     */
+#include <linux/ipv6.h>
 #include <asm/param.h>         /* We get MAXHOSTNAMELEN.     */
 #include <asm/atomic.h>                /* This gets us atomic counters.  */
 #include <linux/skbuff.h>      /* We need sk_buff_head. */
@@ -84,7 +85,6 @@ struct sctp_inq;
 struct sctp_outq;
 struct sctp_bind_addr;
 struct sctp_ulpq;
-struct sctp_opt;
 struct sctp_ep_common;
 struct sctp_ssnmap;
 
@@ -234,7 +234,9 @@ typedef enum {
 } sctp_socket_type_t;
 
 /* Per socket SCTP information. */
-struct sctp_opt {
+struct sctp_sock {
+       /* inet_sock has to be the first member of sctp_sock */
+       struct inet_sock inet;
        /* What kind of a socket is this? */
        sctp_socket_type_t type;
 
@@ -266,11 +268,28 @@ struct sctp_opt {
        __u8 disable_fragments;
        __u8 pd_mode;
        __u8 v4mapped;
+       __u32 adaption_ind;
 
        /* Receive to here while partial delivery is in effect. */
        struct sk_buff_head pd_lobby;
 };
 
+static inline struct sctp_sock *sctp_sk(const struct sock *sk)
+{
+       return (struct sctp_sock *)sk;
+}
+
+static inline struct sock *sctp_opt2sk(const struct sctp_sock *sp)
+{
+       return (struct sock *)sp;
+}
+
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+struct sctp6_sock {
+       struct sctp_sock  sctp;
+       struct ipv6_pinfo inet6;
+};
+#endif /* CONFIG_IPV6 */
 
 
 /* This is our APPLICATION-SPECIFIC state cookie.
@@ -321,8 +340,19 @@ struct sctp_cookie {
        /* This holds the originating address of the INIT packet.  */
        union sctp_addr peer_addr;
 
+       /* IG Section 2.35.3 
+        * Include the source port of the INIT-ACK
+        */
+       __u16           my_port;
+
        __u8 prsctp_capable;
 
+       /* Padding for future use */
+       __u8 padding;           
+
+       __u32 adaption_ind;     
+
+
        /* This is a shim for my peer's INIT packet, followed by
         * a copy of the raw address list of the association.
         * The length of the raw address list is saved in the
@@ -362,6 +392,7 @@ union sctp_params {
        struct sctp_ipv4addr_param *v4;
        struct sctp_ipv6addr_param *v6;
        union sctp_addr_param *addr;
+       struct sctp_adaption_ind_param *aind;
 };
 
 /* RFC 2960.  Section 3.3.5 Heartbeat.
@@ -402,7 +433,6 @@ struct sctp_ssnmap {
        int malloced;
 };
 
-struct sctp_ssnmap *sctp_ssnmap_init(struct sctp_ssnmap *, __u16, __u16);
 struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp);
 void sctp_ssnmap_free(struct sctp_ssnmap *map);
 void sctp_ssnmap_clear(struct sctp_ssnmap *map);
@@ -475,12 +505,12 @@ struct sctp_af {
        int             (*to_addr_param) (const union sctp_addr *,
                                          union sctp_addr_param *); 
        int             (*addr_valid)   (union sctp_addr *,
-                                        struct sctp_opt *);
+                                        struct sctp_sock *);
        sctp_scope_t    (*scope) (union sctp_addr *);
        void            (*inaddr_any)   (union sctp_addr *, unsigned short);
        int             (*is_any)       (const union sctp_addr *);
        int             (*available)    (union sctp_addr *,
-                                        struct sctp_opt *);
+                                        struct sctp_sock *);
        int             (*skb_iif)      (const struct sk_buff *sk);
        int             (*is_ce)        (const struct sk_buff *sk);
        void            (*seq_dump_addr)(struct seq_file *seq,
@@ -498,16 +528,16 @@ int sctp_register_af(struct sctp_af *);
 struct sctp_pf {
        void (*event_msgname)(struct sctp_ulpevent *, char *, int *);
        void (*skb_msgname)  (struct sk_buff *, char *, int *);
-       int  (*af_supported) (sa_family_t, struct sctp_opt *);
+       int  (*af_supported) (sa_family_t, struct sctp_sock *);
        int  (*cmp_addr) (const union sctp_addr *,
                          const union sctp_addr *,
-                         struct sctp_opt *);
-       int  (*bind_verify) (struct sctp_opt *, union sctp_addr *);
-       int  (*send_verify) (struct sctp_opt *, union sctp_addr *);
-       int  (*supported_addrs)(const struct sctp_opt *, __u16 *);
+                         struct sctp_sock *);
+       int  (*bind_verify) (struct sctp_sock *, union sctp_addr *);
+       int  (*send_verify) (struct sctp_sock *, union sctp_addr *);
+       int  (*supported_addrs)(const struct sctp_sock *, __u16 *);
        struct sock *(*create_accept_sk) (struct sock *sk,
                                          struct sctp_association *asoc);
-       void (*addr_v4map) (struct sctp_opt *, union sctp_addr *);
+       void (*addr_v4map) (struct sctp_sock *, union sctp_addr *);
        struct sctp_af *af;
 };
 
@@ -534,12 +564,9 @@ struct sctp_datamsg {
 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_chunk_fail(struct sctp_chunk *, int error);
 int sctp_chunk_abandoned(struct sctp_chunk *);
 
@@ -647,8 +674,6 @@ 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 *,
@@ -849,12 +874,6 @@ struct sctp_transport {
        /* Error count : The current error count for this destination.  */
        unsigned short error_count;
 
-       /* Error       : Current error threshold for this destination
-        * Threshold   : i.e. what value marks the destination down if
-        *             : errorCount reaches this value.
-        */
-       unsigned short error_threshold;
-
        /* This is the max_retrans value for the transport and will
         * be initialized to proto.max_retrans.path.  This can be changed
         * using SCTP_SET_PEER_ADDR_PARAMS socket option.
@@ -918,15 +937,12 @@ struct sctp_transport {
 };
 
 struct sctp_transport *sctp_transport_new(const union sctp_addr *, int);
-struct sctp_transport *sctp_transport_init(struct sctp_transport *,
-                                          const union sctp_addr *, int);
 void sctp_transport_set_owner(struct sctp_transport *,
                              struct sctp_association *);
 void sctp_transport_route(struct sctp_transport *, union sctp_addr *,
-                         struct sctp_opt *);
+                         struct sctp_sock *);
 void sctp_transport_pmtu(struct sctp_transport *);
 void sctp_transport_free(struct sctp_transport *);
-void sctp_transport_destroy(struct sctp_transport *);
 void sctp_transport_reset_timers(struct sctp_transport *);
 void sctp_transport_hold(struct sctp_transport *);
 void sctp_transport_put(struct sctp_transport *);
@@ -957,7 +973,6 @@ struct sctp_inq {
        int malloced;        /* Is this structure kfree()able?  */
 };
 
-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 *, struct sctp_chunk *packet);
@@ -1025,7 +1040,6 @@ struct sctp_outq {
        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*);
@@ -1066,7 +1080,6 @@ struct sctp_bind_addr {
        int malloced;        /* Are we kfree()able?  */
 };
 
-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,
@@ -1076,11 +1089,11 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
                       int gfp);
 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 *);
+                        struct sctp_sock *);
 union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr  *bp,
                                        const union sctp_addr   *addrs,
                                        int                     addrcnt,
-                                       struct sctp_opt         *opt);
+                                       struct sctp_sock        *opt);
 union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
                                         int *addrs_len, int gfp);
 int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
@@ -1216,8 +1229,6 @@ static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base)
 
 /* These are function signatures for manipulating endpoints.  */
 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 *);
@@ -1239,8 +1250,6 @@ int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t,
 int sctp_process_init(struct sctp_association *, sctp_cid_t cid,
                      const union sctp_addr *peer,
                      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 struct sctp_endpoint *);
 __u32 sctp_generate_tsn(const struct sctp_endpoint *);
 
@@ -1395,6 +1404,8 @@ struct sctp_association {
                __u8    asconf_capable;  /* Does peer support ADDIP? */
                __u8    prsctp_capable;  /* Can peer do PR-SCTP? */
 
+               __u32   adaption_ind;    /* Adaption Code point. */
+
                /* This mask is used to disable sending the ASCONF chunk
                 * with specified parameter to peer.
                 */
@@ -1684,10 +1695,6 @@ static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base)
 struct sctp_association *
 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 struct sctp_endpoint *,
-                     const struct sock *, sctp_scope_t scope,
-                     int gfp);
 void sctp_association_free(struct sctp_association *);
 void sctp_association_put(struct sctp_association *);
 void sctp_association_hold(struct sctp_association *);
@@ -1716,7 +1723,6 @@ void sctp_assoc_update(struct sctp_association *old,
                       struct sctp_association *new);
 
 __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 *, unsigned);
@@ -1730,7 +1736,6 @@ 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);
 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 {