fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / net / sctp / structs.h
index bcd03e7..31a8e88 100644 (file)
@@ -87,6 +87,7 @@ struct sctp_bind_addr;
 struct sctp_ulpq;
 struct sctp_ep_common;
 struct sctp_ssnmap;
+struct crypto_hash;
 
 
 #include <net/sctp/tsnmap.h>
@@ -127,9 +128,9 @@ extern struct sctp_globals {
         * RTO.Alpha                - 1/8  (3 when converted to right shifts.)
         * RTO.Beta                 - 1/4  (2 when converted to right shifts.)
         */
-       unsigned long rto_initial;
-       unsigned long rto_min;
-       unsigned long rto_max;
+       unsigned int rto_initial;
+       unsigned int rto_min;
+       unsigned int rto_max;
 
        /* Note: rto_alpha and rto_beta are really defined as inverse
         * powers of two to facilitate integer operations.
@@ -144,13 +145,13 @@ extern struct sctp_globals {
        int cookie_preserve_enable;
 
        /* Valid.Cookie.Life        - 60  seconds  */
-       unsigned long valid_cookie_life;
+       unsigned int valid_cookie_life;
 
        /* Delayed SACK timeout  200ms default*/
-       unsigned long sack_timeout;
+       unsigned int sack_timeout;
 
        /* HB.interval              - 30 seconds  */
-       unsigned long hb_interval;
+       unsigned int hb_interval;
 
        /* Association.Max.Retrans  - 10 attempts
         * Path.Max.Retrans         - 5  attempts (per destination address)
@@ -200,13 +201,12 @@ extern struct sctp_globals {
        struct sctp_bind_hashbucket *port_hashtable;
 
        /* This is the global local address list.
-        * We actively maintain this complete list of interfaces on
-        * the system by catching routing events.
+        * We actively maintain this complete list of addresses on
+        * the system by catching address add/delete events.
         *
         * It is a list of sctp_sockaddr_entry.
         */
        struct list_head local_addr_list;
-       spinlock_t local_addr_lock;
        
        /* Flag to indicate if addip is enabled. */
        int addip_enable;
@@ -242,7 +242,6 @@ extern struct sctp_globals {
 #define sctp_port_alloc_lock           (sctp_globals.port_alloc_lock)
 #define sctp_port_hashtable            (sctp_globals.port_hashtable)
 #define sctp_local_addr_list           (sctp_globals.local_addr_list)
-#define sctp_local_addr_lock           (sctp_globals.local_addr_lock)
 #define sctp_addip_enable              (sctp_globals.addip_enable)
 #define sctp_prsctp_enable             (sctp_globals.prsctp_enable)
 
@@ -264,7 +263,7 @@ struct sctp_sock {
        struct sctp_pf *pf;
 
        /* Access to HMAC transform. */
-       struct crypto_tfm *hmac;
+       struct crypto_hash *hmac;
 
        /* What is our base endpointer? */
        struct sctp_endpoint *ep;
@@ -276,6 +275,7 @@ struct sctp_sock {
        __u16 default_flags;
        __u32 default_context;
        __u32 default_timetolive;
+       __u32 default_rcv_context;
 
        /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
         * the destination address every heartbeat interval. This value
@@ -306,7 +306,7 @@ struct sctp_sock {
        __u8 disable_fragments;
        __u8 pd_mode;
        __u8 v4mapped;
-       __u32 adaption_ind;
+       __u32 adaptation_ind;
 
        /* Receive to here while partial delivery is in effect. */
        struct sk_buff_head pd_lobby;
@@ -388,7 +388,7 @@ struct sctp_cookie {
        /* Padding for future use */
        __u8 padding;           
 
-       __u32 adaption_ind;     
+       __u32 adaptation_ind;
 
 
        /* This is a shim for my peer's INIT packet, followed by
@@ -431,7 +431,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;
+       struct sctp_adaptation_ind_param *aind;
 };
 
 /* RFC 2960.  Section 3.3.5 Heartbeat.
@@ -445,6 +445,7 @@ typedef struct sctp_sender_hb_info {
        struct sctp_paramhdr param_hdr;
        union sctp_addr daddr;
        unsigned long sent_at;
+       __u64 hb_nonce;
 } __attribute__((packed)) sctp_sender_hb_info_t;
 
 /*
@@ -514,6 +515,16 @@ struct sctp_af {
                                         int optname,
                                         char __user *optval,
                                         int __user *optlen);
+       int             (*compat_setsockopt)    (struct sock *sk,
+                                        int level,
+                                        int optname,
+                                        char __user *optval,
+                                        int optlen);
+       int             (*compat_getsockopt)    (struct sock *sk,
+                                        int level,
+                                        int optname,
+                                        char __user *optval,
+                                        int __user *optlen);
        struct dst_entry *(*get_dst)    (struct sctp_association *asoc,
                                         union sctp_addr *daddr,
                                         union sctp_addr *saddr);
@@ -525,7 +536,7 @@ struct sctp_af {
                                          struct net_device *);
        void            (*dst_saddr)    (union sctp_addr *saddr,
                                         struct dst_entry *dst,
-                                        unsigned short port);
+                                        __be16 port);
        int             (*cmp_addr)     (const union sctp_addr *addr1,
                                         const union sctp_addr *addr2);
        void            (*addr_copy)    (union sctp_addr *dst,
@@ -541,14 +552,14 @@ struct sctp_af {
                                         struct sock *sk);
        void            (*from_addr_param) (union sctp_addr *,
                                            union sctp_addr_param *,
-                                           __u16 port, int iif);       
+                                           __be16 port, int iif);
        int             (*to_addr_param) (const union sctp_addr *,
                                          union sctp_addr_param *); 
        int             (*addr_valid)   (union sctp_addr *,
                                         struct sctp_sock *,
                                         const struct sk_buff *);
        sctp_scope_t    (*scope) (union sctp_addr *);
-       void            (*inaddr_any)   (union sctp_addr *, unsigned short);
+       void            (*inaddr_any)   (union sctp_addr *, __be16);
        int             (*is_any)       (const union sctp_addr *);
        int             (*available)    (union sctp_addr *,
                                         struct sctp_sock *);
@@ -575,7 +586,7 @@ struct sctp_pf {
                          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 *);
+       int  (*supported_addrs)(const struct sctp_sock *, __be16 *);
        struct sock *(*create_accept_sk) (struct sock *sk,
                                          struct sctp_association *asoc);
        void (*addr_v4map) (struct sctp_sock *, union sctp_addr *);
@@ -720,13 +731,10 @@ void sctp_init_addrs(struct sctp_chunk *, 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
- * sin_port -- ordinary port number
- * sin_addr -- cast to either (struct in_addr) or (struct in6_addr)
- */
 struct sctp_sockaddr_entry {
        struct list_head list;
        union sctp_addr a;
+       __u8 use_as_src;
 };
 
 typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
@@ -974,6 +982,9 @@ struct sctp_transport {
                 */
                char cacc_saw_newack;
        } cacc;
+
+       /* 64-bit random number sent with heartbeat. */
+       __u64 hb_nonce;
 };
 
 struct sctp_transport *sctp_transport_new(const union sctp_addr *,
@@ -1018,7 +1029,7 @@ 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);
 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 *, work_func_t);
 
 /* This is the structure we use to hold outbound chunks.  You push
  * chunks in and they automatically pop out the other end as bundled
@@ -1128,7 +1139,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
                        sctp_scope_t scope, gfp_t gfp,
                        int flags);
 int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
-                      gfp_t gfp);
+                      __u8 use_as_src, gfp_t 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_sock *);
@@ -1258,7 +1269,7 @@ struct sctp_endpoint {
         *          this here so we pre-allocate this once and can re-use
         *          on every receive.
         */
-       __u8 digest[SCTP_SIGNATURE_SIZE];
+       __u8 *digest;
  
        /* sendbuf acct. policy.        */
        __u32 sndbuf_policy;
@@ -1302,6 +1313,13 @@ int sctp_process_init(struct sctp_association *, sctp_cid_t cid,
 __u32 sctp_generate_tag(const struct sctp_endpoint *);
 __u32 sctp_generate_tsn(const struct sctp_endpoint *);
 
+struct sctp_inithdr_host {
+       __u32 init_tag;
+       __u32 a_rwnd;
+       __u16 num_outbound_streams;
+       __u16 num_inbound_streams;
+       __u32 initial_tsn;
+};
 
 /* RFC2960
  *
@@ -1465,14 +1483,14 @@ struct sctp_association {
                __u8    asconf_capable;  /* Does peer support ADDIP? */
                __u8    prsctp_capable;  /* Can peer do PR-SCTP? */
 
-               __u32   adaption_ind;    /* Adaption Code point. */
+               __u32   adaptation_ind;  /* Adaptation Code point. */
 
                /* This mask is used to disable sending the ASCONF chunk
                 * with specified parameter to peer.
                 */
-               __u16 addip_disabled_mask;
+               __be16 addip_disabled_mask;
 
-               struct sctp_inithdr i;
+               struct sctp_inithdr_host i;
                int cookie_len;
                void *cookie;
 
@@ -1640,6 +1658,9 @@ struct sctp_association {
        __u32 default_context;
        __u32 default_timetolive;
 
+       /* Default receive parameters */
+       __u32 default_rcv_context;
+
        /* This tracks outbound ssn for a given stream.  */
        struct sctp_ssnmap *ssnmap;