aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorMichio Honda <micchie@sfc.wide.ad.jp>2011-04-26 06:32:51 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-02 05:04:53 -0400
commit9f7d653b67aed2d92540fbb0a8adaf32fcf352ae (patch)
tree1e128f1465135dd70f202b8720c32cbfd536cb68 /include/net/sctp
parent3ced2dddf10f26f0aaff96f3345a3d876cea62f8 (diff)
sctp: Add Auto-ASCONF support (core).
SCTP reconfigure the IP addresses in the association by using ASCONF chunks as mentioned in RFC5061. For example, we can start to use the newly configured IP address in the existing association. This patch implements automatic ASCONF operation in the SCTP stack with address events in the host computer, which is called auto_asconf. Signed-off-by: Michio Honda <micchie@sfc.wide.ad.jp> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--include/net/sctp/structs.h15
2 files changed, 17 insertions, 0 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 0037e28e80e..f9fe374ac9f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -120,6 +120,7 @@ extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
120 int flags); 120 int flags);
121extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 121extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
122extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 122extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
123extern void sctp_addr_wq_mgmt(struct sctp_sockaddr_entry *, int);
123 124
124/* 125/*
125 * sctp/socket.c 126 * sctp/socket.c
@@ -134,6 +135,7 @@ void sctp_sock_rfree(struct sk_buff *skb);
134void sctp_copy_sock(struct sock *newsk, struct sock *sk, 135void sctp_copy_sock(struct sock *newsk, struct sock *sk,
135 struct sctp_association *asoc); 136 struct sctp_association *asoc);
136extern struct percpu_counter sctp_sockets_allocated; 137extern struct percpu_counter sctp_sockets_allocated;
138extern int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *);
137 139
138/* 140/*
139 * sctp/primitive.c 141 * sctp/primitive.c
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7df327a6d56..cd8c929e6b0 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -205,6 +205,11 @@ extern struct sctp_globals {
205 * It is a list of sctp_sockaddr_entry. 205 * It is a list of sctp_sockaddr_entry.
206 */ 206 */
207 struct list_head local_addr_list; 207 struct list_head local_addr_list;
208 int default_auto_asconf;
209 struct list_head addr_waitq;
210 struct timer_list addr_wq_timer;
211 struct list_head auto_asconf_splist;
212 spinlock_t addr_wq_lock;
208 213
209 /* Lock that protects the local_addr_list writers */ 214 /* Lock that protects the local_addr_list writers */
210 spinlock_t addr_list_lock; 215 spinlock_t addr_list_lock;
@@ -264,6 +269,11 @@ extern struct sctp_globals {
264#define sctp_port_hashtable (sctp_globals.port_hashtable) 269#define sctp_port_hashtable (sctp_globals.port_hashtable)
265#define sctp_local_addr_list (sctp_globals.local_addr_list) 270#define sctp_local_addr_list (sctp_globals.local_addr_list)
266#define sctp_local_addr_lock (sctp_globals.addr_list_lock) 271#define sctp_local_addr_lock (sctp_globals.addr_list_lock)
272#define sctp_auto_asconf_splist (sctp_globals.auto_asconf_splist)
273#define sctp_addr_waitq (sctp_globals.addr_waitq)
274#define sctp_addr_wq_timer (sctp_globals.addr_wq_timer)
275#define sctp_addr_wq_lock (sctp_globals.addr_wq_lock)
276#define sctp_default_auto_asconf (sctp_globals.default_auto_asconf)
267#define sctp_scope_policy (sctp_globals.ipv4_scope_policy) 277#define sctp_scope_policy (sctp_globals.ipv4_scope_policy)
268#define sctp_addip_enable (sctp_globals.addip_enable) 278#define sctp_addip_enable (sctp_globals.addip_enable)
269#define sctp_addip_noauth (sctp_globals.addip_noauth_enable) 279#define sctp_addip_noauth (sctp_globals.addip_noauth_enable)
@@ -341,6 +351,8 @@ struct sctp_sock {
341 atomic_t pd_mode; 351 atomic_t pd_mode;
342 /* Receive to here while partial delivery is in effect. */ 352 /* Receive to here while partial delivery is in effect. */
343 struct sk_buff_head pd_lobby; 353 struct sk_buff_head pd_lobby;
354 struct list_head auto_asconf_list;
355 int do_auto_asconf;
344}; 356};
345 357
346static inline struct sctp_sock *sctp_sk(const struct sock *sk) 358static inline struct sctp_sock *sctp_sk(const struct sock *sk)
@@ -792,6 +804,8 @@ struct sctp_sockaddr_entry {
792 __u8 valid; 804 __u8 valid;
793}; 805};
794 806
807#define SCTP_ADDRESS_TICK_DELAY 500
808
795typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *); 809typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
796 810
797/* This structure holds lists of chunks as we are assembling for 811/* This structure holds lists of chunks as we are assembling for
@@ -1236,6 +1250,7 @@ sctp_scope_t sctp_scope(const union sctp_addr *);
1236int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1250int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope);
1237int sctp_is_any(struct sock *sk, const union sctp_addr *addr); 1251int sctp_is_any(struct sock *sk, const union sctp_addr *addr);
1238int sctp_addr_is_valid(const union sctp_addr *addr); 1252int sctp_addr_is_valid(const union sctp_addr *addr);
1253int sctp_is_ep_boundall(struct sock *sk);
1239 1254
1240 1255
1241/* What type of endpoint? */ 1256/* What type of endpoint? */