summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-09-04 12:56:30 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-09-04 12:56:30 -0700
commitf72c208be7ca31902334755b825648df15dddcd4 (patch)
treeb226f4317b24d424b589b6b85e6e5fcecbe424e9 /include
parentf3e971e437d0cd524eab7c3e00701f6ef6881123 (diff)
parent4a542137c484ae008f3e185f819b8800f9bcc21f (diff)
Merge http://linux-lksctp.bkbits.net/lksctp-2.5
into nuts.ninka.net:/disk1/davem/BK/net-2.5
Diffstat (limited to 'include')
-rw-r--r--include/linux/sctp.h9
-rw-r--r--include/net/sctp/sctp.h23
-rw-r--r--include/net/sctp/sm.h12
-rw-r--r--include/net/sctp/structs.h171
-rw-r--r--include/net/sctp/user.h8
5 files changed, 130 insertions, 93 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 6ebaff34570c..6131e3c9aa45 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -1,7 +1,7 @@
/* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
* Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001-2002 International Business Machines, Corp.
* Copyright (c) 2001 Intel Corp.
* Copyright (c) 2001 Nokia, Inc.
* Copyright (c) 2001 La Monte H.P. Yarroll
@@ -42,6 +42,8 @@
* randall@sctp.chicago.il.us
* kmorneau@cisco.com
* qxie1@email.mot.com
+ * Sridhar Samudrala <sri@us.ibm.com>
+ * Kevin Gao <kevin.gao@intel.com>
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
@@ -507,6 +509,11 @@ typedef struct sctp_cwr_chunk {
* The ASCONF Parameter Response is used in the ASCONF-ACK to
* report status of ASCONF processing.
*/
+typedef struct sctp_addip_param {
+ sctp_paramhdr_t param_hdr;
+ __u32 crr_id;
+}sctp_addip_param_t __attribute__((packed));
+
typedef struct sctp_addiphdr {
__u32 serial;
__u8 params[0];
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 506fd2cb1305..3f21f1985699 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -1,7 +1,7 @@
/* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
* Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001-2003 International Business Machines, Corp.
* Copyright (c) 2001-2003 Intel Corp.
*
* This file is part of the SCTP kernel reference Implementation
@@ -40,6 +40,7 @@
* Sridhar Samudrala <sri@us.ibm.com>
* Ardelle Fan <ardelle.fan@intel.com>
* Ryan Layer <rmlayer@us.ibm.com>
+ * Kevin Gao <kevin.gao@intel.com>
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
@@ -145,6 +146,7 @@ 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);
+int sctp_primitive_ASCONF(struct sctp_association *, void *arg);
/*
* sctp/crc32c.c
@@ -404,6 +406,12 @@ static inline struct list_head *sctp_list_dequeue(struct list_head *list)
return result;
}
+/* Tests if the list has one and only one entry. */
+static inline int sctp_list_single_entry(struct list_head *head)
+{
+ return ((head->next != head) && (head->next == head->prev));
+}
+
/* Calculate the size (in bytes) occupied by the data of an iovec. */
static inline size_t get_user_iov_size(struct iovec *iov, int iovlen)
{
@@ -525,6 +533,19 @@ static inline int ipver2af(__u8 ipver)
};
}
+/* Convert from an address parameter type to an address family. */
+static inline int param_type2af(__u16 type)
+{
+ switch (type) {
+ case SCTP_PARAM_IPV4_ADDRESS:
+ return AF_INET;
+ case SCTP_PARAM_IPV6_ADDRESS:
+ return AF_INET6;
+ default:
+ return 0;
+ };
+}
+
/* Perform some sanity checks. */
static inline int sctp_sanity_check(void)
{
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 28d4c6409247..3eb9c18df0c5 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -1,8 +1,8 @@
/* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
* Copyright (c) 1999-2000 Cisco, Inc.
* 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
*
@@ -41,6 +41,7 @@
* Sridhar Samudrala <sri@us.ibm.com>
* Daisy Chang <daisyc@us.ibm.com>
* Ardelle Fan <ardelle.fan@intel.com>
+ * Kevin Gao <kevin.gao@intel.com>
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
@@ -268,6 +269,9 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
struct sctp_chunk *asconf,
int vparam_len);
+struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
+ union sctp_addr *addr);
+
void sctp_chunk_assign_tsn(struct sctp_chunk *);
void sctp_chunk_assign_ssn(struct sctp_chunk *);
@@ -330,12 +334,6 @@ void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
__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, union sctp_addr_param *,
- __u16 port, int iif);
-int sctp_addr2sockaddr(const union sctp_params, union sctp_addr *);
-int sockaddr2sctp_addr(const union sctp_addr *, union sctp_addr_param *);
-
/* Extern declarations for major data structures. */
const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t, sctp_state_t);
extern const sctp_sm_table_entry_t
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index f77373f18e7e..7ba32701be00 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1,8 +1,8 @@
/* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
* Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc.
* Copyright (c) 2001 Intel Corp.
- * Copyright (c) 2001-2003 International Business Machines Corp.
*
* This file is part of the SCTP kernel reference Implementation
*
@@ -45,6 +45,7 @@
* Ardelle Fan <ardelle.fan@intel.com>
* Ryan Layer <rmlayer@us.ibm.com>
* Anup Pemmaiah <pemmaiah@cc.usu.edu>
+ * Kevin Gao <kevin.gao@intel.com>
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
@@ -217,86 +218,6 @@ extern struct sctp_globals {
#define sctp_local_addr_list (sctp_globals.local_addr_list)
#define sctp_local_addr_lock (sctp_globals.local_addr_lock)
-/*
- * Pointers to address related SCTP functions.
- * (i.e. things that depend on the address family.)
- */
-struct sctp_af {
- int (*sctp_xmit) (struct sk_buff *skb,
- struct sctp_transport *,
- int ipfragok);
- int (*setsockopt) (struct sock *sk,
- int level,
- int optname,
- char *optval,
- int optlen);
- int (*getsockopt) (struct sock *sk,
- int level,
- int optname,
- char *optval,
- int *optlen);
- struct dst_entry *(*get_dst) (struct sctp_association *asoc,
- union sctp_addr *daddr,
- union sctp_addr *saddr);
- void (*get_saddr) (struct sctp_association *asoc,
- struct dst_entry *dst,
- union sctp_addr *daddr,
- union sctp_addr *saddr);
- void (*copy_addrlist) (struct list_head *,
- struct net_device *);
- void (*dst_saddr) (union sctp_addr *saddr,
- struct dst_entry *dst,
- unsigned short port);
- int (*cmp_addr) (const union sctp_addr *addr1,
- const union sctp_addr *addr2);
- void (*addr_copy) (union sctp_addr *dst,
- union sctp_addr *src);
- void (*from_skb) (union sctp_addr *,
- struct sk_buff *skb,
- int saddr);
- void (*from_sk) (union sctp_addr *,
- struct sock *sk);
- 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 *,
- struct sctp_opt *);
- 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 *);
- int (*skb_iif) (const struct sk_buff *sk);
- int (*is_ce) (const struct sk_buff *sk);
- void (*seq_dump_addr)(struct seq_file *seq,
- union sctp_addr *addr);
- __u16 net_header_len;
- int sockaddr_len;
- sa_family_t sa_family;
- struct list_head list;
-};
-
-struct sctp_af *sctp_get_af_specific(sa_family_t);
-int sctp_register_af(struct sctp_af *);
-
-/* Protocol family functions. */
-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 (*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 sock *(*create_accept_sk) (struct sock *sk,
- struct sctp_association *asoc);
- void (*addr_v4map) (struct sctp_opt *, union sctp_addr *);
- struct sctp_af *af;
-};
-
/* SCTP Socket type: UDP or TCP style. */
typedef enum {
SCTP_SOCKET_UDP = 0,
@@ -488,6 +409,92 @@ static inline __u16 sctp_ssn_next(struct sctp_stream *stream, __u16 id)
return stream->ssn[id]++;
}
+/*
+ * Pointers to address related SCTP functions.
+ * (i.e. things that depend on the address family.)
+ */
+struct sctp_af {
+ int (*sctp_xmit) (struct sk_buff *skb,
+ struct sctp_transport *,
+ int ipfragok);
+ int (*setsockopt) (struct sock *sk,
+ int level,
+ int optname,
+ char *optval,
+ int optlen);
+ int (*getsockopt) (struct sock *sk,
+ int level,
+ int optname,
+ char *optval,
+ int *optlen);
+ struct dst_entry *(*get_dst) (struct sctp_association *asoc,
+ union sctp_addr *daddr,
+ union sctp_addr *saddr);
+ void (*get_saddr) (struct sctp_association *asoc,
+ struct dst_entry *dst,
+ union sctp_addr *daddr,
+ union sctp_addr *saddr);
+ void (*copy_addrlist) (struct list_head *,
+ struct net_device *);
+ void (*dst_saddr) (union sctp_addr *saddr,
+ struct dst_entry *dst,
+ unsigned short port);
+ int (*cmp_addr) (const union sctp_addr *addr1,
+ const union sctp_addr *addr2);
+ void (*addr_copy) (union sctp_addr *dst,
+ union sctp_addr *src);
+ void (*from_skb) (union sctp_addr *,
+ struct sk_buff *skb,
+ int saddr);
+ void (*from_sk) (union sctp_addr *,
+ struct sock *sk);
+ void (*to_sk_saddr) (union sctp_addr *,
+ struct sock *sk);
+ void (*to_sk_daddr) (union sctp_addr *,
+ struct sock *sk);
+ void (*from_addr_param) (union sctp_addr *,
+ union sctp_addr_param *,
+ __u16 port, int iif);
+ int (*to_addr_param) (const union sctp_addr *,
+ union sctp_addr_param *);
+ int (*addr_valid) (union sctp_addr *,
+ struct sctp_opt *);
+ 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 *);
+ int (*skb_iif) (const struct sk_buff *sk);
+ int (*is_ce) (const struct sk_buff *sk);
+ void (*seq_dump_addr)(struct seq_file *seq,
+ union sctp_addr *addr);
+ __u16 net_header_len;
+ int sockaddr_len;
+ sa_family_t sa_family;
+ struct list_head list;
+};
+
+struct sctp_af *sctp_get_af_specific(sa_family_t);
+int sctp_register_af(struct sctp_af *);
+
+/* Protocol family functions. */
+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 (*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 sock *(*create_accept_sk) (struct sock *sk,
+ struct sctp_association *asoc);
+ void (*addr_v4map) (struct sctp_opt *, union sctp_addr *);
+ struct sctp_af *af;
+};
+
+
/* Structure to track chunk fragments that have been acked, but peer
* fragments of the same message have not.
*/
@@ -1688,6 +1695,8 @@ struct sctp_transport *sctp_assoc_choose_shutdown_transport(
void sctp_assoc_update_retran_path(struct sctp_association *);
struct sctp_transport *sctp_assoc_lookup_paddr(const struct sctp_association *,
const union sctp_addr *);
+int sctp_assoc_lookup_laddr(struct sctp_association *asoc,
+ const union sctp_addr *laddr);
struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *,
const union sctp_addr *address,
const int gfp);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index da96859dba92..45f96479510f 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -551,13 +551,15 @@ struct sctp_status {
};
/*
- * 8.3, 8.5 get all peer/local addresses on a socket
- * This parameter struct is for getsockopt
+ * 8.3, 8.5 get all peer/local addresses in an association.
+ * This parameter struct is used by SCTP_GET_PEER_ADDRS and
+ * SCTP_GET_LOCAL_ADDRS socket options used internally to implement
+ * sctp_getpaddrs() and sctp_getladdrs() API.
*/
struct sctp_getaddrs {
sctp_assoc_t assoc_id;
int addr_num;
- struct sockaddr_storage *addrs;
+ struct sockaddr *addrs;
};
/* These are bit fields for msghdr->msg_flags. See section 5.1. */