aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/9p/transport.h3
-rw-r--r--include/net/act_api.h60
-rw-r--r--include/net/addrconf.h160
-rw-r--r--include/net/af_rxrpc.h35
-rw-r--r--include/net/af_unix.h16
-rw-r--r--include/net/af_vsock.h175
-rw-r--r--include/net/arp.h30
-rw-r--r--include/net/ax25.h215
-rw-r--r--include/net/cfg80211.h34
-rw-r--r--include/net/checksum.h10
-rw-r--r--include/net/cls_cgroup.h2
-rw-r--r--include/net/fib_rules.h14
-rw-r--r--include/net/irda/irlan_common.h3
-rw-r--r--include/net/mac80211.h16
-rw-r--r--include/net/neighbour.h98
-rw-r--r--include/net/net_namespace.h37
-rw-r--r--include/net/netns/ipv4.h1
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/netprio_cgroup.h2
-rw-r--r--include/net/pkt_cls.h42
-rw-r--r--include/net/pkt_sched.h50
-rw-r--r--include/net/sch_generic.h53
-rw-r--r--include/net/sctp/auth.h2
-rw-r--r--include/net/sctp/checksum.h17
-rw-r--r--include/net/sctp/constants.h2
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sctp/sm.h2
-rw-r--r--include/net/sctp/structs.h3
-rw-r--r--include/net/sctp/tsnmap.h2
-rw-r--r--include/net/sctp/ulpevent.h2
-rw-r--r--include/net/sctp/ulpqueue.h2
-rw-r--r--include/net/sock.h24
-rw-r--r--include/net/tcp.h28
-rw-r--r--include/net/udp.h1
-rw-r--r--include/net/vsock_addr.h30
35 files changed, 716 insertions, 460 deletions
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index d9fa68f26c41..9a36d9297114 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -40,8 +40,6 @@
40 * @close: member function to discard a connection on this transport 40 * @close: member function to discard a connection on this transport
41 * @request: member function to issue a request to the transport 41 * @request: member function to issue a request to the transport
42 * @cancel: member function to cancel a request (if it hasn't been sent) 42 * @cancel: member function to cancel a request (if it hasn't been sent)
43 * @cancelled: member function to notify that a cancelled request will not
44 * not receive a reply
45 * 43 *
46 * This is the basic API for a transport module which is registered by the 44 * This is the basic API for a transport module which is registered by the
47 * transport module with the 9P core network module and used by the client 45 * transport module with the 9P core network module and used by the client
@@ -60,7 +58,6 @@ struct p9_trans_module {
60 void (*close) (struct p9_client *); 58 void (*close) (struct p9_client *);
61 int (*request) (struct p9_client *, struct p9_req_t *req); 59 int (*request) (struct p9_client *, struct p9_req_t *req);
62 int (*cancel) (struct p9_client *, struct p9_req_t *req); 60 int (*cancel) (struct p9_client *, struct p9_req_t *req);
63 int (*cancelled)(struct p9_client *, struct p9_req_t *req);
64 int (*zc_request)(struct p9_client *, struct p9_req_t *, 61 int (*zc_request)(struct p9_client *, struct p9_req_t *,
65 char *, char *, int , int, int, int); 62 char *, char *, int , int, int, int);
66}; 63};
diff --git a/include/net/act_api.h b/include/net/act_api.h
index b8ffac7b6bab..9e90fdff470d 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -82,36 +82,36 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 83};
84 84
85extern struct tcf_common *tcf_hash_lookup(u32 index, 85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo);
86 struct tcf_hashinfo *hinfo); 86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87extern void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 87int tcf_hash_release(struct tcf_common *p, int bind,
88extern int tcf_hash_release(struct tcf_common *p, int bind, 88 struct tcf_hashinfo *hinfo);
89 struct tcf_hashinfo *hinfo); 89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
90extern int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 90 int type, struct tc_action *a);
91 int type, struct tc_action *a); 91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92extern u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo); 92int tcf_hash_search(struct tc_action *a, u32 index);
93extern int tcf_hash_search(struct tc_action *a, u32 index); 93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94extern struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 94 int bind, struct tcf_hashinfo *hinfo);
95 int bind, struct tcf_hashinfo *hinfo); 95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96extern struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 96 struct tc_action *a, int size,
97 struct tc_action *a, int size, 97 int bind, u32 *idx_gen,
98 int bind, u32 *idx_gen, 98 struct tcf_hashinfo *hinfo);
99 struct tcf_hashinfo *hinfo); 99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
101 100
102extern int tcf_register_action(struct tc_action_ops *a); 101int tcf_register_action(struct tc_action_ops *a);
103extern int tcf_unregister_action(struct tc_action_ops *a); 102int tcf_unregister_action(struct tc_action_ops *a);
104extern void tcf_action_destroy(struct tc_action *a, int bind); 103void tcf_action_destroy(struct tc_action *a, int bind);
105extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); 104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a,
106extern struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 105 struct tcf_result *res);
107 struct nlattr *est, char *n, int ovr, 106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla,
108 int bind); 107 struct nlattr *est, char *n, int ovr,
109extern struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 108 int bind);
110 struct nlattr *est, char *n, int ovr, 109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
111 int bind); 110 struct nlattr *est, char *n, int ovr,
112extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 111 int bind);
113extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
114extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
115extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); 114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
115int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
116#endif /* CONFIG_NET_CLS_ACT */ 116#endif /* CONFIG_NET_CLS_ACT */
117#endif 117#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index c7b181cb47a6..43fa31a610b8 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -53,51 +53,36 @@ struct prefix_info {
53#define IN6_ADDR_HSIZE_SHIFT 4 53#define IN6_ADDR_HSIZE_SHIFT 4
54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) 54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT)
55 55
56extern int addrconf_init(void); 56int addrconf_init(void);
57extern void addrconf_cleanup(void); 57void addrconf_cleanup(void);
58 58
59extern int addrconf_add_ifaddr(struct net *net, 59int addrconf_add_ifaddr(struct net *net, void __user *arg);
60 void __user *arg); 60int addrconf_del_ifaddr(struct net *net, void __user *arg);
61extern int addrconf_del_ifaddr(struct net *net, 61int addrconf_set_dstaddr(struct net *net, void __user *arg);
62 void __user *arg);
63extern int addrconf_set_dstaddr(struct net *net,
64 void __user *arg);
65 62
66extern int ipv6_chk_addr(struct net *net, 63int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
67 const struct in6_addr *addr, 64 const struct net_device *dev, int strict);
68 const struct net_device *dev,
69 int strict);
70 65
71#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 66#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
72extern int ipv6_chk_home_addr(struct net *net, 67int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
73 const struct in6_addr *addr);
74#endif 68#endif
75 69
76extern int ipv6_chk_prefix(const struct in6_addr *addr, 70int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
77 struct net_device *dev); 71
78 72struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
79extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 73 const struct in6_addr *addr,
80 const struct in6_addr *addr, 74 struct net_device *dev, int strict);
81 struct net_device *dev, 75
82 int strict); 76int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
83 77 const struct in6_addr *daddr, unsigned int srcprefs,
84extern int ipv6_dev_get_saddr(struct net *net, 78 struct in6_addr *saddr);
85 const struct net_device *dev, 79int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
86 const struct in6_addr *daddr, 80 unsigned char banned_flags);
87 unsigned int srcprefs, 81int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
88 struct in6_addr *saddr); 82 unsigned char banned_flags);
89extern int __ipv6_get_lladdr(struct inet6_dev *idev, 83int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
90 struct in6_addr *addr, 84void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
91 unsigned char banned_flags); 85void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
92extern int ipv6_get_lladdr(struct net_device *dev,
93 struct in6_addr *addr,
94 unsigned char banned_flags);
95extern int ipv6_rcv_saddr_equal(const struct sock *sk,
96 const struct sock *sk2);
97extern void addrconf_join_solict(struct net_device *dev,
98 const struct in6_addr *addr);
99extern void addrconf_leave_solict(struct inet6_dev *idev,
100 const struct in6_addr *addr);
101 86
102static inline unsigned long addrconf_timeout_fixup(u32 timeout, 87static inline unsigned long addrconf_timeout_fixup(u32 timeout,
103 unsigned int unit) 88 unsigned int unit)
@@ -124,41 +109,38 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
124/* 109/*
125 * IPv6 Address Label subsystem (addrlabel.c) 110 * IPv6 Address Label subsystem (addrlabel.c)
126 */ 111 */
127extern int ipv6_addr_label_init(void); 112int ipv6_addr_label_init(void);
128extern void ipv6_addr_label_cleanup(void); 113void ipv6_addr_label_cleanup(void);
129extern void ipv6_addr_label_rtnl_register(void); 114void ipv6_addr_label_rtnl_register(void);
130extern u32 ipv6_addr_label(struct net *net, 115u32 ipv6_addr_label(struct net *net, const struct in6_addr *addr,
131 const struct in6_addr *addr, 116 int type, int ifindex);
132 int type, int ifindex);
133 117
134/* 118/*
135 * multicast prototypes (mcast.c) 119 * multicast prototypes (mcast.c)
136 */ 120 */
137extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 121int ipv6_sock_mc_join(struct sock *sk, int ifindex,
138 const struct in6_addr *addr); 122 const struct in6_addr *addr);
139extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 123int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
140 const struct in6_addr *addr); 124 const struct in6_addr *addr);
141extern void ipv6_sock_mc_close(struct sock *sk); 125void ipv6_sock_mc_close(struct sock *sk);
142extern bool inet6_mc_check(struct sock *sk, 126bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
143 const struct in6_addr *mc_addr, 127 const struct in6_addr *src_addr);
144 const struct in6_addr *src_addr); 128
145 129int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
146extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); 130int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
147extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); 131int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
148extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 132void ipv6_mc_up(struct inet6_dev *idev);
149extern void ipv6_mc_up(struct inet6_dev *idev); 133void ipv6_mc_down(struct inet6_dev *idev);
150extern void ipv6_mc_down(struct inet6_dev *idev); 134void ipv6_mc_unmap(struct inet6_dev *idev);
151extern void ipv6_mc_unmap(struct inet6_dev *idev); 135void ipv6_mc_remap(struct inet6_dev *idev);
152extern void ipv6_mc_remap(struct inet6_dev *idev); 136void ipv6_mc_init_dev(struct inet6_dev *idev);
153extern void ipv6_mc_init_dev(struct inet6_dev *idev); 137void ipv6_mc_destroy_dev(struct inet6_dev *idev);
154extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 138void addrconf_dad_failure(struct inet6_ifaddr *ifp);
155extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 139
156 140bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
157extern bool ipv6_chk_mcast_addr(struct net_device *dev, 141 const struct in6_addr *src_addr);
158 const struct in6_addr *group, 142
159 const struct in6_addr *src_addr); 143void ipv6_mc_dad_complete(struct inet6_dev *idev);
160
161extern void ipv6_mc_dad_complete(struct inet6_dev *idev);
162/* 144/*
163 * identify MLD packets for MLD filter exceptions 145 * identify MLD packets for MLD filter exceptions
164 */ 146 */
@@ -184,29 +166,31 @@ static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
184 return false; 166 return false;
185} 167}
186 168
187extern void addrconf_prefix_rcv(struct net_device *dev, 169void addrconf_prefix_rcv(struct net_device *dev,
188 u8 *opt, int len, bool sllao); 170 u8 *opt, int len, bool sllao);
189 171
190/* 172/*
191 * anycast prototypes (anycast.c) 173 * anycast prototypes (anycast.c)
192 */ 174 */
193extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); 175int ipv6_sock_ac_join(struct sock *sk, int ifindex,
194extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); 176 const struct in6_addr *addr);
195extern void ipv6_sock_ac_close(struct sock *sk); 177int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
196 178 const struct in6_addr *addr);
197extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 179void ipv6_sock_ac_close(struct sock *sk);
198extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 180
199extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 181int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
182int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
183bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
200 const struct in6_addr *addr); 184 const struct in6_addr *addr);
201 185
202 186
203/* Device notifier */ 187/* Device notifier */
204extern int register_inet6addr_notifier(struct notifier_block *nb); 188int register_inet6addr_notifier(struct notifier_block *nb);
205extern int unregister_inet6addr_notifier(struct notifier_block *nb); 189int unregister_inet6addr_notifier(struct notifier_block *nb);
206extern int inet6addr_notifier_call_chain(unsigned long val, void *v); 190int inet6addr_notifier_call_chain(unsigned long val, void *v);
207 191
208extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, 192void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
209 struct ipv6_devconf *devconf); 193 struct ipv6_devconf *devconf);
210 194
211/** 195/**
212 * __in6_dev_get - get inet6_dev pointer from netdevice 196 * __in6_dev_get - get inet6_dev pointer from netdevice
@@ -240,7 +224,7 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
240 return idev; 224 return idev;
241} 225}
242 226
243extern void in6_dev_finish_destroy(struct inet6_dev *idev); 227void in6_dev_finish_destroy(struct inet6_dev *idev);
244 228
245static inline void in6_dev_put(struct inet6_dev *idev) 229static inline void in6_dev_put(struct inet6_dev *idev)
246{ 230{
@@ -258,7 +242,7 @@ static inline void in6_dev_hold(struct inet6_dev *idev)
258 atomic_inc(&idev->refcnt); 242 atomic_inc(&idev->refcnt);
259} 243}
260 244
261extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 245void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
262 246
263static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 247static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
264{ 248{
@@ -340,8 +324,8 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
340} 324}
341 325
342#ifdef CONFIG_PROC_FS 326#ifdef CONFIG_PROC_FS
343extern int if6_proc_init(void); 327int if6_proc_init(void);
344extern void if6_proc_exit(void); 328void if6_proc_exit(void);
345#endif 329#endif
346 330
347#endif 331#endif
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index 03e6e9453623..e797d45a5ae6 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -31,24 +31,21 @@ enum {
31 31
32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long, 32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long,
33 struct sk_buff *); 33 struct sk_buff *);
34extern void rxrpc_kernel_intercept_rx_messages(struct socket *, 34void rxrpc_kernel_intercept_rx_messages(struct socket *, rxrpc_interceptor_t);
35 rxrpc_interceptor_t); 35struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
36extern struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *, 36 struct sockaddr_rxrpc *,
37 struct sockaddr_rxrpc *, 37 struct key *,
38 struct key *, 38 unsigned long,
39 unsigned long, 39 gfp_t);
40 gfp_t); 40int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t);
41extern int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, 41void rxrpc_kernel_abort_call(struct rxrpc_call *, u32);
42 size_t); 42void rxrpc_kernel_end_call(struct rxrpc_call *);
43extern void rxrpc_kernel_abort_call(struct rxrpc_call *, u32); 43bool rxrpc_kernel_is_data_last(struct sk_buff *);
44extern void rxrpc_kernel_end_call(struct rxrpc_call *); 44u32 rxrpc_kernel_get_abort_code(struct sk_buff *);
45extern bool rxrpc_kernel_is_data_last(struct sk_buff *); 45int rxrpc_kernel_get_error_number(struct sk_buff *);
46extern u32 rxrpc_kernel_get_abort_code(struct sk_buff *); 46void rxrpc_kernel_data_delivered(struct sk_buff *);
47extern int rxrpc_kernel_get_error_number(struct sk_buff *); 47void rxrpc_kernel_free_skb(struct sk_buff *);
48extern void rxrpc_kernel_data_delivered(struct sk_buff *); 48struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long);
49extern void rxrpc_kernel_free_skb(struct sk_buff *); 49int rxrpc_kernel_reject_call(struct socket *);
50extern struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *,
51 unsigned long);
52extern int rxrpc_kernel_reject_call(struct socket *);
53 50
54#endif /* _NET_RXRPC_H */ 51#endif /* _NET_RXRPC_H */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index dbdfd2b0f3b3..05442df4ca89 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -6,12 +6,12 @@
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <net/sock.h> 7#include <net/sock.h>
8 8
9extern void unix_inflight(struct file *fp); 9void unix_inflight(struct file *fp);
10extern void unix_notinflight(struct file *fp); 10void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11void unix_gc(void);
12extern void wait_for_unix_gc(void); 12void wait_for_unix_gc(void);
13extern struct sock *unix_get_socket(struct file *filp); 13struct sock *unix_get_socket(struct file *filp);
14extern struct sock *unix_peer_get(struct sock *); 14struct sock *unix_peer_get(struct sock *);
15 15
16#define UNIX_HASH_SIZE 256 16#define UNIX_HASH_SIZE 256
17#define UNIX_HASH_BITS 8 17#define UNIX_HASH_BITS 8
@@ -71,8 +71,8 @@ long unix_inq_len(struct sock *sk);
71long unix_outq_len(struct sock *sk); 71long unix_outq_len(struct sock *sk);
72 72
73#ifdef CONFIG_SYSCTL 73#ifdef CONFIG_SYSCTL
74extern int unix_sysctl_register(struct net *net); 74int unix_sysctl_register(struct net *net);
75extern void unix_sysctl_unregister(struct net *net); 75void unix_sysctl_unregister(struct net *net);
76#else 76#else
77static inline int unix_sysctl_register(struct net *net) { return 0; } 77static inline int unix_sysctl_register(struct net *net) { return 0; }
78static inline void unix_sysctl_unregister(struct net *net) {} 78static inline void unix_sysctl_unregister(struct net *net) {}
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
new file mode 100644
index 000000000000..7d64d3609ec9
--- /dev/null
+++ b/include/net/af_vsock.h
@@ -0,0 +1,175 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef __AF_VSOCK_H__
17#define __AF_VSOCK_H__
18
19#include <linux/kernel.h>
20#include <linux/workqueue.h>
21#include <linux/vm_sockets.h>
22
23#include "vsock_addr.h"
24
25#define LAST_RESERVED_PORT 1023
26
27#define vsock_sk(__sk) ((struct vsock_sock *)__sk)
28#define sk_vsock(__vsk) (&(__vsk)->sk)
29
30struct vsock_sock {
31 /* sk must be the first member. */
32 struct sock sk;
33 struct sockaddr_vm local_addr;
34 struct sockaddr_vm remote_addr;
35 /* Links for the global tables of bound and connected sockets. */
36 struct list_head bound_table;
37 struct list_head connected_table;
38 /* Accessed without the socket lock held. This means it can never be
39 * modified outsided of socket create or destruct.
40 */
41 bool trusted;
42 bool cached_peer_allow_dgram; /* Dgram communication allowed to
43 * cached peer?
44 */
45 u32 cached_peer; /* Context ID of last dgram destination check. */
46 const struct cred *owner;
47 /* Rest are SOCK_STREAM only. */
48 long connect_timeout;
49 /* Listening socket that this came from. */
50 struct sock *listener;
51 /* Used for pending list and accept queue during connection handshake.
52 * The listening socket is the head for both lists. Sockets created
53 * for connection requests are placed in the pending list until they
54 * are connected, at which point they are put in the accept queue list
55 * so they can be accepted in accept(). If accept() cannot accept the
56 * connection, it is marked as rejected so the cleanup function knows
57 * to clean up the socket.
58 */
59 struct list_head pending_links;
60 struct list_head accept_queue;
61 bool rejected;
62 struct delayed_work dwork;
63 u32 peer_shutdown;
64 bool sent_request;
65 bool ignore_connecting_rst;
66
67 /* Private to transport. */
68 void *trans;
69};
70
71s64 vsock_stream_has_data(struct vsock_sock *vsk);
72s64 vsock_stream_has_space(struct vsock_sock *vsk);
73void vsock_pending_work(struct work_struct *work);
74struct sock *__vsock_create(struct net *net,
75 struct socket *sock,
76 struct sock *parent,
77 gfp_t priority, unsigned short type);
78
79/**** TRANSPORT ****/
80
81struct vsock_transport_recv_notify_data {
82 u64 data1; /* Transport-defined. */
83 u64 data2; /* Transport-defined. */
84 bool notify_on_block;
85};
86
87struct vsock_transport_send_notify_data {
88 u64 data1; /* Transport-defined. */
89 u64 data2; /* Transport-defined. */
90};
91
92struct vsock_transport {
93 /* Initialize/tear-down socket. */
94 int (*init)(struct vsock_sock *, struct vsock_sock *);
95 void (*destruct)(struct vsock_sock *);
96 void (*release)(struct vsock_sock *);
97
98 /* Connections. */
99 int (*connect)(struct vsock_sock *);
100
101 /* DGRAM. */
102 int (*dgram_bind)(struct vsock_sock *, struct sockaddr_vm *);
103 int (*dgram_dequeue)(struct kiocb *kiocb, struct vsock_sock *vsk,
104 struct msghdr *msg, size_t len, int flags);
105 int (*dgram_enqueue)(struct vsock_sock *, struct sockaddr_vm *,
106 struct iovec *, size_t len);
107 bool (*dgram_allow)(u32 cid, u32 port);
108
109 /* STREAM. */
110 /* TODO: stream_bind() */
111 ssize_t (*stream_dequeue)(struct vsock_sock *, struct iovec *,
112 size_t len, int flags);
113 ssize_t (*stream_enqueue)(struct vsock_sock *, struct iovec *,
114 size_t len);
115 s64 (*stream_has_data)(struct vsock_sock *);
116 s64 (*stream_has_space)(struct vsock_sock *);
117 u64 (*stream_rcvhiwat)(struct vsock_sock *);
118 bool (*stream_is_active)(struct vsock_sock *);
119 bool (*stream_allow)(u32 cid, u32 port);
120
121 /* Notification. */
122 int (*notify_poll_in)(struct vsock_sock *, size_t, bool *);
123 int (*notify_poll_out)(struct vsock_sock *, size_t, bool *);
124 int (*notify_recv_init)(struct vsock_sock *, size_t,
125 struct vsock_transport_recv_notify_data *);
126 int (*notify_recv_pre_block)(struct vsock_sock *, size_t,
127 struct vsock_transport_recv_notify_data *);
128 int (*notify_recv_pre_dequeue)(struct vsock_sock *, size_t,
129 struct vsock_transport_recv_notify_data *);
130 int (*notify_recv_post_dequeue)(struct vsock_sock *, size_t,
131 ssize_t, bool, struct vsock_transport_recv_notify_data *);
132 int (*notify_send_init)(struct vsock_sock *,
133 struct vsock_transport_send_notify_data *);
134 int (*notify_send_pre_block)(struct vsock_sock *,
135 struct vsock_transport_send_notify_data *);
136 int (*notify_send_pre_enqueue)(struct vsock_sock *,
137 struct vsock_transport_send_notify_data *);
138 int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
139 struct vsock_transport_send_notify_data *);
140
141 /* Shutdown. */
142 int (*shutdown)(struct vsock_sock *, int);
143
144 /* Buffer sizes. */
145 void (*set_buffer_size)(struct vsock_sock *, u64);
146 void (*set_min_buffer_size)(struct vsock_sock *, u64);
147 void (*set_max_buffer_size)(struct vsock_sock *, u64);
148 u64 (*get_buffer_size)(struct vsock_sock *);
149 u64 (*get_min_buffer_size)(struct vsock_sock *);
150 u64 (*get_max_buffer_size)(struct vsock_sock *);
151
152 /* Addressing. */
153 u32 (*get_local_cid)(void);
154};
155
156/**** CORE ****/
157
158int vsock_core_init(const struct vsock_transport *t);
159void vsock_core_exit(void);
160
161/**** UTILS ****/
162
163void vsock_release_pending(struct sock *pending);
164void vsock_add_pending(struct sock *listener, struct sock *pending);
165void vsock_remove_pending(struct sock *listener, struct sock *pending);
166void vsock_enqueue_accept(struct sock *listener, struct sock *connected);
167void vsock_insert_connected(struct vsock_sock *vsk);
168void vsock_remove_bound(struct vsock_sock *vsk);
169void vsock_remove_connected(struct vsock_sock *vsk);
170struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
171struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
172 struct sockaddr_vm *dst);
173void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
174
175#endif /* __AF_VSOCK_H__ */
diff --git a/include/net/arp.h b/include/net/arp.h
index b630dae03411..7509d9da4e36 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -46,22 +46,22 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32
46 return n; 46 return n;
47} 47}
48 48
49extern void arp_init(void); 49void arp_init(void);
50extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 50int arp_find(unsigned char *haddr, struct sk_buff *skb);
51extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 51int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
52extern void arp_send(int type, int ptype, __be32 dest_ip, 52void arp_send(int type, int ptype, __be32 dest_ip,
53 struct net_device *dev, __be32 src_ip, 53 struct net_device *dev, __be32 src_ip,
54 const unsigned char *dest_hw, 54 const unsigned char *dest_hw,
55 const unsigned char *src_hw, const unsigned char *th); 55 const unsigned char *src_hw, const unsigned char *th);
56extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); 56int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
57extern void arp_ifdown(struct net_device *dev); 57void arp_ifdown(struct net_device *dev);
58 58
59extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, 59struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
60 struct net_device *dev, __be32 src_ip, 60 struct net_device *dev, __be32 src_ip,
61 const unsigned char *dest_hw, 61 const unsigned char *dest_hw,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64extern void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip); 65int arp_invalidate(struct net_device *dev, __be32 ip);
66 66
67#endif /* _ARP_H */ 67#endif /* _ARP_H */
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 89ed9ac5701f..bf0396e9a5d3 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -195,7 +195,7 @@ static inline void ax25_hold_route(ax25_route *ax25_rt)
195 atomic_inc(&ax25_rt->refcount); 195 atomic_inc(&ax25_rt->refcount);
196} 196}
197 197
198extern void __ax25_put_route(ax25_route *ax25_rt); 198void __ax25_put_route(ax25_route *ax25_rt);
199 199
200static inline void ax25_put_route(ax25_route *ax25_rt) 200static inline void ax25_put_route(ax25_route *ax25_rt)
201{ 201{
@@ -272,30 +272,31 @@ static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev
272/* af_ax25.c */ 272/* af_ax25.c */
273extern struct hlist_head ax25_list; 273extern struct hlist_head ax25_list;
274extern spinlock_t ax25_list_lock; 274extern spinlock_t ax25_list_lock;
275extern void ax25_cb_add(ax25_cb *); 275void ax25_cb_add(ax25_cb *);
276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); 276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int);
277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); 277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int);
278extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 278ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *,
279extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); 279 struct net_device *);
280extern void ax25_destroy_socket(ax25_cb *); 280void ax25_send_to_raw(ax25_address *, struct sk_buff *, int);
281extern ax25_cb * __must_check ax25_create_cb(void); 281void ax25_destroy_socket(ax25_cb *);
282extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); 282ax25_cb * __must_check ax25_create_cb(void);
283extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); 283void ax25_fillin_cb(ax25_cb *, ax25_dev *);
284struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
284 285
285/* ax25_addr.c */ 286/* ax25_addr.c */
286extern const ax25_address ax25_bcast; 287extern const ax25_address ax25_bcast;
287extern const ax25_address ax25_defaddr; 288extern const ax25_address ax25_defaddr;
288extern const ax25_address null_ax25_address; 289extern const ax25_address null_ax25_address;
289extern char *ax2asc(char *buf, const ax25_address *); 290char *ax2asc(char *buf, const ax25_address *);
290extern void asc2ax(ax25_address *addr, const char *callsign); 291void asc2ax(ax25_address *addr, const char *callsign);
291extern int ax25cmp(const ax25_address *, const ax25_address *); 292int ax25cmp(const ax25_address *, const ax25_address *);
292extern int ax25digicmp(const ax25_digi *, const ax25_digi *); 293int ax25digicmp(const ax25_digi *, const ax25_digi *);
293extern const unsigned char *ax25_addr_parse(const unsigned char *, int, 294const unsigned char *ax25_addr_parse(const unsigned char *, int,
294 ax25_address *, ax25_address *, ax25_digi *, int *, int *); 295 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
295extern int ax25_addr_build(unsigned char *, const ax25_address *, 296int ax25_addr_build(unsigned char *, const ax25_address *,
296 const ax25_address *, const ax25_digi *, int, int); 297 const ax25_address *, const ax25_digi *, int, int);
297extern int ax25_addr_size(const ax25_digi *); 298int ax25_addr_size(const ax25_digi *);
298extern void ax25_digi_invert(const ax25_digi *, ax25_digi *); 299void ax25_digi_invert(const ax25_digi *, ax25_digi *);
299 300
300/* ax25_dev.c */ 301/* ax25_dev.c */
301extern ax25_dev *ax25_dev_list; 302extern ax25_dev *ax25_dev_list;
@@ -306,33 +307,33 @@ static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
306 return dev->ax25_ptr; 307 return dev->ax25_ptr;
307} 308}
308 309
309extern ax25_dev *ax25_addr_ax25dev(ax25_address *); 310ax25_dev *ax25_addr_ax25dev(ax25_address *);
310extern void ax25_dev_device_up(struct net_device *); 311void ax25_dev_device_up(struct net_device *);
311extern void ax25_dev_device_down(struct net_device *); 312void ax25_dev_device_down(struct net_device *);
312extern int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *); 313int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *);
313extern struct net_device *ax25_fwd_dev(struct net_device *); 314struct net_device *ax25_fwd_dev(struct net_device *);
314extern void ax25_dev_free(void); 315void ax25_dev_free(void);
315 316
316/* ax25_ds_in.c */ 317/* ax25_ds_in.c */
317extern int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int); 318int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int);
318 319
319/* ax25_ds_subr.c */ 320/* ax25_ds_subr.c */
320extern void ax25_ds_nr_error_recovery(ax25_cb *); 321void ax25_ds_nr_error_recovery(ax25_cb *);
321extern void ax25_ds_enquiry_response(ax25_cb *); 322void ax25_ds_enquiry_response(ax25_cb *);
322extern void ax25_ds_establish_data_link(ax25_cb *); 323void ax25_ds_establish_data_link(ax25_cb *);
323extern void ax25_dev_dama_off(ax25_dev *); 324void ax25_dev_dama_off(ax25_dev *);
324extern void ax25_dama_on(ax25_cb *); 325void ax25_dama_on(ax25_cb *);
325extern void ax25_dama_off(ax25_cb *); 326void ax25_dama_off(ax25_cb *);
326 327
327/* ax25_ds_timer.c */ 328/* ax25_ds_timer.c */
328extern void ax25_ds_setup_timer(ax25_dev *); 329void ax25_ds_setup_timer(ax25_dev *);
329extern void ax25_ds_set_timer(ax25_dev *); 330void ax25_ds_set_timer(ax25_dev *);
330extern void ax25_ds_del_timer(ax25_dev *); 331void ax25_ds_del_timer(ax25_dev *);
331extern void ax25_ds_timer(ax25_cb *); 332void ax25_ds_timer(ax25_cb *);
332extern void ax25_ds_t1_timeout(ax25_cb *); 333void ax25_ds_t1_timeout(ax25_cb *);
333extern void ax25_ds_heartbeat_expiry(ax25_cb *); 334void ax25_ds_heartbeat_expiry(ax25_cb *);
334extern void ax25_ds_t3timer_expiry(ax25_cb *); 335void ax25_ds_t3timer_expiry(ax25_cb *);
335extern void ax25_ds_idletimer_expiry(ax25_cb *); 336void ax25_ds_idletimer_expiry(ax25_cb *);
336 337
337/* ax25_iface.c */ 338/* ax25_iface.c */
338 339
@@ -342,107 +343,109 @@ struct ax25_protocol {
342 int (*func)(struct sk_buff *, ax25_cb *); 343 int (*func)(struct sk_buff *, ax25_cb *);
343}; 344};
344 345
345extern void ax25_register_pid(struct ax25_protocol *ap); 346void ax25_register_pid(struct ax25_protocol *ap);
346extern void ax25_protocol_release(unsigned int); 347void ax25_protocol_release(unsigned int);
347 348
348struct ax25_linkfail { 349struct ax25_linkfail {
349 struct hlist_node lf_node; 350 struct hlist_node lf_node;
350 void (*func)(ax25_cb *, int); 351 void (*func)(ax25_cb *, int);
351}; 352};
352 353
353extern void ax25_linkfail_register(struct ax25_linkfail *lf); 354void ax25_linkfail_register(struct ax25_linkfail *lf);
354extern void ax25_linkfail_release(struct ax25_linkfail *lf); 355void ax25_linkfail_release(struct ax25_linkfail *lf);
355extern int __must_check ax25_listen_register(ax25_address *, 356int __must_check ax25_listen_register(ax25_address *, struct net_device *);
356 struct net_device *); 357void ax25_listen_release(ax25_address *, struct net_device *);
357extern void ax25_listen_release(ax25_address *, struct net_device *); 358int(*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *);
358extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *); 359int ax25_listen_mine(ax25_address *, struct net_device *);
359extern int ax25_listen_mine(ax25_address *, struct net_device *); 360void ax25_link_failed(ax25_cb *, int);
360extern void ax25_link_failed(ax25_cb *, int); 361int ax25_protocol_is_registered(unsigned int);
361extern int ax25_protocol_is_registered(unsigned int);
362 362
363/* ax25_in.c */ 363/* ax25_in.c */
364extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *); 364int ax25_rx_iframe(ax25_cb *, struct sk_buff *);
365extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); 365int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *,
366 struct net_device *);
366 367
367/* ax25_ip.c */ 368/* ax25_ip.c */
368extern int ax25_hard_header(struct sk_buff *, struct net_device *, 369int ax25_hard_header(struct sk_buff *, struct net_device *, unsigned short,
369 unsigned short, const void *, 370 const void *, const void *, unsigned int);
370 const void *, unsigned int); 371int ax25_rebuild_header(struct sk_buff *);
371extern int ax25_rebuild_header(struct sk_buff *);
372extern const struct header_ops ax25_header_ops; 372extern const struct header_ops ax25_header_ops;
373 373
374/* ax25_out.c */ 374/* ax25_out.c */
375extern ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 375ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *,
376extern void ax25_output(ax25_cb *, int, struct sk_buff *); 376 ax25_digi *, struct net_device *);
377extern void ax25_kick(ax25_cb *); 377void ax25_output(ax25_cb *, int, struct sk_buff *);
378extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int); 378void ax25_kick(ax25_cb *);
379extern void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev); 379void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int);
380extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); 380void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev);
381int ax25_check_iframes_acked(ax25_cb *, unsigned short);
381 382
382/* ax25_route.c */ 383/* ax25_route.c */
383extern void ax25_rt_device_down(struct net_device *); 384void ax25_rt_device_down(struct net_device *);
384extern int ax25_rt_ioctl(unsigned int, void __user *); 385int ax25_rt_ioctl(unsigned int, void __user *);
385extern const struct file_operations ax25_route_fops; 386extern const struct file_operations ax25_route_fops;
386extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); 387ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
387extern int ax25_rt_autobind(ax25_cb *, ax25_address *); 388int ax25_rt_autobind(ax25_cb *, ax25_address *);
388extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); 389struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *,
389extern void ax25_rt_free(void); 390 ax25_address *, ax25_digi *);
391void ax25_rt_free(void);
390 392
391/* ax25_std_in.c */ 393/* ax25_std_in.c */
392extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int); 394int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int);
393 395
394/* ax25_std_subr.c */ 396/* ax25_std_subr.c */
395extern void ax25_std_nr_error_recovery(ax25_cb *); 397void ax25_std_nr_error_recovery(ax25_cb *);
396extern void ax25_std_establish_data_link(ax25_cb *); 398void ax25_std_establish_data_link(ax25_cb *);
397extern void ax25_std_transmit_enquiry(ax25_cb *); 399void ax25_std_transmit_enquiry(ax25_cb *);
398extern void ax25_std_enquiry_response(ax25_cb *); 400void ax25_std_enquiry_response(ax25_cb *);
399extern void ax25_std_timeout_response(ax25_cb *); 401void ax25_std_timeout_response(ax25_cb *);
400 402
401/* ax25_std_timer.c */ 403/* ax25_std_timer.c */
402extern void ax25_std_heartbeat_expiry(ax25_cb *); 404void ax25_std_heartbeat_expiry(ax25_cb *);
403extern void ax25_std_t1timer_expiry(ax25_cb *); 405void ax25_std_t1timer_expiry(ax25_cb *);
404extern void ax25_std_t2timer_expiry(ax25_cb *); 406void ax25_std_t2timer_expiry(ax25_cb *);
405extern void ax25_std_t3timer_expiry(ax25_cb *); 407void ax25_std_t3timer_expiry(ax25_cb *);
406extern void ax25_std_idletimer_expiry(ax25_cb *); 408void ax25_std_idletimer_expiry(ax25_cb *);
407 409
408/* ax25_subr.c */ 410/* ax25_subr.c */
409extern void ax25_clear_queues(ax25_cb *); 411void ax25_clear_queues(ax25_cb *);
410extern void ax25_frames_acked(ax25_cb *, unsigned short); 412void ax25_frames_acked(ax25_cb *, unsigned short);
411extern void ax25_requeue_frames(ax25_cb *); 413void ax25_requeue_frames(ax25_cb *);
412extern int ax25_validate_nr(ax25_cb *, unsigned short); 414int ax25_validate_nr(ax25_cb *, unsigned short);
413extern int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *); 415int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *);
414extern void ax25_send_control(ax25_cb *, int, int, int); 416void ax25_send_control(ax25_cb *, int, int, int);
415extern void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *, ax25_digi *); 417void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *,
416extern void ax25_calculate_t1(ax25_cb *); 418 ax25_digi *);
417extern void ax25_calculate_rtt(ax25_cb *); 419void ax25_calculate_t1(ax25_cb *);
418extern void ax25_disconnect(ax25_cb *, int); 420void ax25_calculate_rtt(ax25_cb *);
421void ax25_disconnect(ax25_cb *, int);
419 422
420/* ax25_timer.c */ 423/* ax25_timer.c */
421extern void ax25_setup_timers(ax25_cb *); 424void ax25_setup_timers(ax25_cb *);
422extern void ax25_start_heartbeat(ax25_cb *); 425void ax25_start_heartbeat(ax25_cb *);
423extern void ax25_start_t1timer(ax25_cb *); 426void ax25_start_t1timer(ax25_cb *);
424extern void ax25_start_t2timer(ax25_cb *); 427void ax25_start_t2timer(ax25_cb *);
425extern void ax25_start_t3timer(ax25_cb *); 428void ax25_start_t3timer(ax25_cb *);
426extern void ax25_start_idletimer(ax25_cb *); 429void ax25_start_idletimer(ax25_cb *);
427extern void ax25_stop_heartbeat(ax25_cb *); 430void ax25_stop_heartbeat(ax25_cb *);
428extern void ax25_stop_t1timer(ax25_cb *); 431void ax25_stop_t1timer(ax25_cb *);
429extern void ax25_stop_t2timer(ax25_cb *); 432void ax25_stop_t2timer(ax25_cb *);
430extern void ax25_stop_t3timer(ax25_cb *); 433void ax25_stop_t3timer(ax25_cb *);
431extern void ax25_stop_idletimer(ax25_cb *); 434void ax25_stop_idletimer(ax25_cb *);
432extern int ax25_t1timer_running(ax25_cb *); 435int ax25_t1timer_running(ax25_cb *);
433extern unsigned long ax25_display_timer(struct timer_list *); 436unsigned long ax25_display_timer(struct timer_list *);
434 437
435/* ax25_uid.c */ 438/* ax25_uid.c */
436extern int ax25_uid_policy; 439extern int ax25_uid_policy;
437extern ax25_uid_assoc *ax25_findbyuid(kuid_t); 440ax25_uid_assoc *ax25_findbyuid(kuid_t);
438extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); 441int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);
439extern const struct file_operations ax25_uid_fops; 442extern const struct file_operations ax25_uid_fops;
440extern void ax25_uid_free(void); 443void ax25_uid_free(void);
441 444
442/* sysctl_net_ax25.c */ 445/* sysctl_net_ax25.c */
443#ifdef CONFIG_SYSCTL 446#ifdef CONFIG_SYSCTL
444extern int ax25_register_dev_sysctl(ax25_dev *ax25_dev); 447int ax25_register_dev_sysctl(ax25_dev *ax25_dev);
445extern void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev); 448void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev);
446#else 449#else
447static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; } 450static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; }
448static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {} 451static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {}
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7b0730aeb892..f49de283f50e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2841,7 +2841,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
2841 * 2841 *
2842 * Return: A non-negative wiphy index or a negative error code. 2842 * Return: A non-negative wiphy index or a negative error code.
2843 */ 2843 */
2844extern int wiphy_register(struct wiphy *wiphy); 2844int wiphy_register(struct wiphy *wiphy);
2845 2845
2846/** 2846/**
2847 * wiphy_unregister - deregister a wiphy from cfg80211 2847 * wiphy_unregister - deregister a wiphy from cfg80211
@@ -2852,14 +2852,14 @@ extern int wiphy_register(struct wiphy *wiphy);
2852 * pointer, but the call may sleep to wait for an outstanding 2852 * pointer, but the call may sleep to wait for an outstanding
2853 * request that is being handled. 2853 * request that is being handled.
2854 */ 2854 */
2855extern void wiphy_unregister(struct wiphy *wiphy); 2855void wiphy_unregister(struct wiphy *wiphy);
2856 2856
2857/** 2857/**
2858 * wiphy_free - free wiphy 2858 * wiphy_free - free wiphy
2859 * 2859 *
2860 * @wiphy: The wiphy to free 2860 * @wiphy: The wiphy to free
2861 */ 2861 */
2862extern void wiphy_free(struct wiphy *wiphy); 2862void wiphy_free(struct wiphy *wiphy);
2863 2863
2864/* internal structs */ 2864/* internal structs */
2865struct cfg80211_conn; 2865struct cfg80211_conn;
@@ -3014,14 +3014,14 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
3014 * @band: band, necessary due to channel number overlap 3014 * @band: band, necessary due to channel number overlap
3015 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed. 3015 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
3016 */ 3016 */
3017extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); 3017int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band);
3018 3018
3019/** 3019/**
3020 * ieee80211_frequency_to_channel - convert frequency to channel number 3020 * ieee80211_frequency_to_channel - convert frequency to channel number
3021 * @freq: center frequency 3021 * @freq: center frequency
3022 * Return: The corresponding channel, or 0 if the conversion failed. 3022 * Return: The corresponding channel, or 0 if the conversion failed.
3023 */ 3023 */
3024extern int ieee80211_frequency_to_channel(int freq); 3024int ieee80211_frequency_to_channel(int freq);
3025 3025
3026/* 3026/*
3027 * Name indirection necessary because the ieee80211 code also has 3027 * Name indirection necessary because the ieee80211 code also has
@@ -3030,8 +3030,8 @@ extern int ieee80211_frequency_to_channel(int freq);
3030 * to include both header files you'll (rightfully!) get a symbol 3030 * to include both header files you'll (rightfully!) get a symbol
3031 * clash. 3031 * clash.
3032 */ 3032 */
3033extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, 3033struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
3034 int freq); 3034 int freq);
3035/** 3035/**
3036 * ieee80211_get_channel - get channel struct from wiphy for specified frequency 3036 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
3037 * @wiphy: the struct wiphy to get the channel for 3037 * @wiphy: the struct wiphy to get the channel for
@@ -3141,13 +3141,14 @@ struct ieee80211_radiotap_iterator {
3141 int _reset_on_ext; 3141 int _reset_on_ext;
3142}; 3142};
3143 3143
3144extern int ieee80211_radiotap_iterator_init( 3144int
3145 struct ieee80211_radiotap_iterator *iterator, 3145ieee80211_radiotap_iterator_init(struct ieee80211_radiotap_iterator *iterator,
3146 struct ieee80211_radiotap_header *radiotap_header, 3146 struct ieee80211_radiotap_header *radiotap_header,
3147 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns); 3147 int max_length,
3148 const struct ieee80211_radiotap_vendor_namespaces *vns);
3148 3149
3149extern int ieee80211_radiotap_iterator_next( 3150int
3150 struct ieee80211_radiotap_iterator *iterator); 3151ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator);
3151 3152
3152 3153
3153extern const unsigned char rfc1042_header[6]; 3154extern const unsigned char rfc1042_header[6];
@@ -3307,7 +3308,7 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
3307 * 3308 *
3308 * Return: 0 on success. -ENOMEM. 3309 * Return: 0 on success. -ENOMEM.
3309 */ 3310 */
3310extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 3311int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3311 3312
3312/** 3313/**
3313 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 3314 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
@@ -3321,9 +3322,8 @@ extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3321 * default channel settings will be disregarded. If no rule is found for a 3322 * default channel settings will be disregarded. If no rule is found for a
3322 * channel on the regulatory domain the channel will be disabled. 3323 * channel on the regulatory domain the channel will be disabled.
3323 */ 3324 */
3324extern void wiphy_apply_custom_regulatory( 3325void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3325 struct wiphy *wiphy, 3326 const struct ieee80211_regdomain *regd);
3326 const struct ieee80211_regdomain *regd);
3327 3327
3328/** 3328/**
3329 * freq_reg_info - get regulatory information for the given frequency 3329 * freq_reg_info - get regulatory information for the given frequency
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 600d1d705bb8..8f59ca50477c 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -107,11 +107,11 @@ static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to)
107} 107}
108 108
109struct sk_buff; 109struct sk_buff;
110extern void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, 110void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
111 __be32 from, __be32 to, int pseudohdr); 111 __be32 from, __be32 to, int pseudohdr);
112extern void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, 112void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
113 const __be32 *from, const __be32 *to, 113 const __be32 *from, const __be32 *to,
114 int pseudohdr); 114 int pseudohdr);
115 115
116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, 116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
117 __be16 from, __be16 to, 117 __be16 from, __be16 to,
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 0fee0617fb7d..f55c14510bd6 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,7 +24,7 @@ struct cgroup_cls_state
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27extern void sock_update_classid(struct sock *sk); 27void sock_update_classid(struct sock *sk);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) 29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 30static inline u32 task_cls_classid(struct task_struct *p)
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index e361f4882426..4b2b557fb0e8 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -10,21 +10,25 @@
10 10
11struct fib_rule { 11struct fib_rule {
12 struct list_head list; 12 struct list_head list;
13 atomic_t refcnt;
14 int iifindex; 13 int iifindex;
15 int oifindex; 14 int oifindex;
16 u32 mark; 15 u32 mark;
17 u32 mark_mask; 16 u32 mark_mask;
18 u32 pref;
19 u32 flags; 17 u32 flags;
20 u32 table; 18 u32 table;
21 u8 action; 19 u8 action;
20 /* 3 bytes hole, try to use */
22 u32 target; 21 u32 target;
23 struct fib_rule __rcu *ctarget; 22 struct fib_rule __rcu *ctarget;
23 struct net *fr_net;
24
25 atomic_t refcnt;
26 u32 pref;
27 int suppress_ifgroup;
28 int suppress_prefixlen;
24 char iifname[IFNAMSIZ]; 29 char iifname[IFNAMSIZ];
25 char oifname[IFNAMSIZ]; 30 char oifname[IFNAMSIZ];
26 struct rcu_head rcu; 31 struct rcu_head rcu;
27 struct net * fr_net;
28}; 32};
29 33
30struct fib_lookup_arg { 34struct fib_lookup_arg {
@@ -46,6 +50,8 @@ struct fib_rules_ops {
46 int (*action)(struct fib_rule *, 50 int (*action)(struct fib_rule *,
47 struct flowi *, int, 51 struct flowi *, int,
48 struct fib_lookup_arg *); 52 struct fib_lookup_arg *);
53 bool (*suppress)(struct fib_rule *,
54 struct fib_lookup_arg *);
49 int (*match)(struct fib_rule *, 55 int (*match)(struct fib_rule *,
50 struct flowi *, int); 56 struct flowi *, int);
51 int (*configure)(struct fib_rule *, 57 int (*configure)(struct fib_rule *,
@@ -80,6 +86,8 @@ struct fib_rules_ops {
80 [FRA_FWMARK] = { .type = NLA_U32 }, \ 86 [FRA_FWMARK] = { .type = NLA_U32 }, \
81 [FRA_FWMASK] = { .type = NLA_U32 }, \ 87 [FRA_FWMASK] = { .type = NLA_U32 }, \
82 [FRA_TABLE] = { .type = NLA_U32 }, \ 88 [FRA_TABLE] = { .type = NLA_U32 }, \
89 [FRA_SUPPRESS_PREFIXLEN] = { .type = NLA_U32 }, \
90 [FRA_SUPPRESS_IFGROUP] = { .type = NLA_U32 }, \
83 [FRA_GOTO] = { .type = NLA_U32 } 91 [FRA_GOTO] = { .type = NLA_U32 }
84 92
85static inline void fib_rule_get(struct fib_rule *rule) 93static inline void fib_rule_get(struct fib_rule *rule)
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 0af8b8dfbc22..550c2d6ec7ff 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -32,6 +32,7 @@
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/skbuff.h> 33#include <linux/skbuff.h>
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/if_ether.h>
35 36
36#include <net/irda/irttp.h> 37#include <net/irda/irttp.h>
37 38
@@ -161,7 +162,7 @@ struct irlan_provider_cb {
161 int access_type; /* Access type */ 162 int access_type; /* Access type */
162 __u16 send_arb_val; 163 __u16 send_arb_val;
163 164
164 __u8 mac_address[6]; /* Generated MAC address for peer device */ 165 __u8 mac_address[ETH_ALEN]; /* Generated MAC address for peer device */
165}; 166};
166 167
167/* 168/*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b7a3dadadde..e5f02909f1ad 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2877,14 +2877,14 @@ enum ieee80211_tpt_led_trigger_flags {
2877}; 2877};
2878 2878
2879#ifdef CONFIG_MAC80211_LEDS 2879#ifdef CONFIG_MAC80211_LEDS
2880extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); 2880char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
2881extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); 2881char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
2882extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); 2882char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
2883extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); 2883char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
2884extern char *__ieee80211_create_tpt_led_trigger( 2884char *__ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
2885 struct ieee80211_hw *hw, unsigned int flags, 2885 unsigned int flags,
2886 const struct ieee80211_tpt_blink *blink_table, 2886 const struct ieee80211_tpt_blink *blink_table,
2887 unsigned int blink_table_len); 2887 unsigned int blink_table_len);
2888#endif 2888#endif
2889/** 2889/**
2890 * ieee80211_get_tx_led_name - get name of TX LED 2890 * ieee80211_get_tx_led_name - get name of TX LED
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 7e748ad8b50c..536501a3e58d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -195,68 +195,67 @@ static inline void *neighbour_priv(const struct neighbour *n)
195#define NEIGH_UPDATE_F_ISROUTER 0x40000000 195#define NEIGH_UPDATE_F_ISROUTER 0x40000000
196#define NEIGH_UPDATE_F_ADMIN 0x80000000 196#define NEIGH_UPDATE_F_ADMIN 0x80000000
197 197
198extern void neigh_table_init(struct neigh_table *tbl); 198void neigh_table_init(struct neigh_table *tbl);
199extern int neigh_table_clear(struct neigh_table *tbl); 199int neigh_table_clear(struct neigh_table *tbl);
200extern struct neighbour * neigh_lookup(struct neigh_table *tbl, 200struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
201 const void *pkey, 201 struct net_device *dev);
202 struct net_device *dev); 202struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
203extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, 203 const void *pkey);
204 struct net *net, 204struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
205 const void *pkey); 205 struct net_device *dev, bool want_ref);
206extern struct neighbour * __neigh_create(struct neigh_table *tbl,
207 const void *pkey,
208 struct net_device *dev,
209 bool want_ref);
210static inline struct neighbour *neigh_create(struct neigh_table *tbl, 206static inline struct neighbour *neigh_create(struct neigh_table *tbl,
211 const void *pkey, 207 const void *pkey,
212 struct net_device *dev) 208 struct net_device *dev)
213{ 209{
214 return __neigh_create(tbl, pkey, dev, true); 210 return __neigh_create(tbl, pkey, dev, true);
215} 211}
216extern void neigh_destroy(struct neighbour *neigh); 212void neigh_destroy(struct neighbour *neigh);
217extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
218extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, 214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
219 u32 flags); 215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
220extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
221extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
222extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 218int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
223extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); 219int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb);
224extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb); 220int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
225extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); 221struct neighbour *neigh_event_ns(struct neigh_table *tbl,
226extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
227 u8 *lladdr, void *saddr, 222 u8 *lladdr, void *saddr,
228 struct net_device *dev); 223 struct net_device *dev);
229 224
230extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); 225struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
231extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); 226 struct neigh_table *tbl);
227void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
232 228
233static inline 229static inline
234struct net *neigh_parms_net(const struct neigh_parms *parms) 230struct net *neigh_parms_net(const struct neigh_parms *parms)
235{ 231{
236 return read_pnet(&parms->net); 232 return read_pnet(&parms->net);
237} 233}
238 234
239extern unsigned long neigh_rand_reach_time(unsigned long base); 235unsigned long neigh_rand_reach_time(unsigned long base);
240 236
241extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, 237void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
242 struct sk_buff *skb); 238 struct sk_buff *skb);
243extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev, int creat); 239struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net,
244extern struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, 240 const void *key, struct net_device *dev,
245 struct net *net, 241 int creat);
246 const void *key, 242struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, struct net *net,
247 struct net_device *dev); 243 const void *key, struct net_device *dev);
248extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); 244int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key,
245 struct net_device *dev);
249 246
250static inline 247static inline struct net *pneigh_net(const struct pneigh_entry *pneigh)
251struct net *pneigh_net(const struct pneigh_entry *pneigh)
252{ 248{
253 return read_pnet(&pneigh->net); 249 return read_pnet(&pneigh->net);
254} 250}
255 251
256extern void neigh_app_ns(struct neighbour *n); 252void neigh_app_ns(struct neighbour *n);
257extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); 253void neigh_for_each(struct neigh_table *tbl,
258extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); 254 void (*cb)(struct neighbour *, void *), void *cookie);
259extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); 255void __neigh_for_each_release(struct neigh_table *tbl,
256 int (*cb)(struct neighbour *));
257void pneigh_for_each(struct neigh_table *tbl,
258 void (*cb)(struct pneigh_entry *));
260 259
261struct neigh_seq_state { 260struct neigh_seq_state {
262 struct seq_net_private p; 261 struct seq_net_private p;
@@ -270,15 +269,14 @@ struct neigh_seq_state {
270#define NEIGH_SEQ_IS_PNEIGH 0x00000002 269#define NEIGH_SEQ_IS_PNEIGH 0x00000002
271#define NEIGH_SEQ_SKIP_NOARP 0x00000004 270#define NEIGH_SEQ_SKIP_NOARP 0x00000004
272}; 271};
273extern void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, unsigned int); 272void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274extern void *neigh_seq_next(struct seq_file *, void *, loff_t *); 273 unsigned int);
275extern void neigh_seq_stop(struct seq_file *, void *); 274void *neigh_seq_next(struct seq_file *, void *, loff_t *);
276 275void neigh_seq_stop(struct seq_file *, void *);
277extern int neigh_sysctl_register(struct net_device *dev, 276
278 struct neigh_parms *p, 277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
279 char *p_name, 278 char *p_name, proc_handler *proc_handler);
280 proc_handler *proc_handler); 279void neigh_sysctl_unregister(struct neigh_parms *p);
281extern void neigh_sysctl_unregister(struct neigh_parms *p);
282 280
283static inline void __neigh_parms_put(struct neigh_parms *parms) 281static inline void __neigh_parms_put(struct neigh_parms *parms)
284{ 282{
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 84e37b1ca9e1..1313456a0994 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -119,7 +119,6 @@ struct net {
119 struct netns_ipvs *ipvs; 119 struct netns_ipvs *ipvs;
120#endif 120#endif
121 struct sock *diag_nlsk; 121 struct sock *diag_nlsk;
122 atomic_t rt_genid;
123 atomic_t fnhe_genid; 122 atomic_t fnhe_genid;
124}; 123};
125 124
@@ -333,14 +332,42 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
333} 332}
334#endif 333#endif
335 334
336static inline int rt_genid(struct net *net) 335static inline int rt_genid_ipv4(struct net *net)
337{ 336{
338 return atomic_read(&net->rt_genid); 337 return atomic_read(&net->ipv4.rt_genid);
339} 338}
340 339
341static inline void rt_genid_bump(struct net *net) 340static inline void rt_genid_bump_ipv4(struct net *net)
342{ 341{
343 atomic_inc(&net->rt_genid); 342 atomic_inc(&net->ipv4.rt_genid);
343}
344
345#if IS_ENABLED(CONFIG_IPV6)
346static inline int rt_genid_ipv6(struct net *net)
347{
348 return atomic_read(&net->ipv6.rt_genid);
349}
350
351static inline void rt_genid_bump_ipv6(struct net *net)
352{
353 atomic_inc(&net->ipv6.rt_genid);
354}
355#else
356static inline int rt_genid_ipv6(struct net *net)
357{
358 return 0;
359}
360
361static inline void rt_genid_bump_ipv6(struct net *net)
362{
363}
364#endif
365
366/* For callers who don't really care about whether it's IPv4 or IPv6 */
367static inline void rt_genid_bump_all(struct net *net)
368{
369 rt_genid_bump_ipv4(net);
370 rt_genid_bump_ipv6(net);
344} 371}
345 372
346static inline int fnhe_genid(struct net *net) 373static inline int fnhe_genid(struct net *net)
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 2ba9de89e8ec..bf2ec2202c56 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -77,5 +77,6 @@ struct netns_ipv4 {
77 struct fib_rules_ops *mr_rules_ops; 77 struct fib_rules_ops *mr_rules_ops;
78#endif 78#endif
79#endif 79#endif
80 atomic_t rt_genid;
80}; 81};
81#endif 82#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 005e2c2e39a9..0fb2401197c5 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -72,6 +72,7 @@ struct netns_ipv6 {
72#endif 72#endif
73#endif 73#endif
74 atomic_t dev_addr_genid; 74 atomic_t dev_addr_genid;
75 atomic_t rt_genid;
75}; 76};
76 77
77#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 78#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 50ab8c26ab59..379dd5db0f2f 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -29,7 +29,7 @@ struct cgroup_netprio_state {
29 struct cgroup_subsys_state css; 29 struct cgroup_subsys_state css;
30}; 30};
31 31
32extern void sock_update_netprioidx(struct sock *sk); 32void sock_update_netprioidx(struct sock *sk);
33 33
34#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 34#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
35 35
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 13174509cdfd..2ebef77a2f9a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -14,8 +14,8 @@ struct tcf_walker {
14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *); 14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *);
15}; 15};
16 16
17extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); 17int register_tcf_proto_ops(struct tcf_proto_ops *ops);
18extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); 18int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
19 19
20static inline unsigned long 20static inline unsigned long
21__cls_set_class(unsigned long *clp, unsigned long cl) 21__cls_set_class(unsigned long *clp, unsigned long cl)
@@ -126,17 +126,17 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
126 return 0; 126 return 0;
127} 127}
128 128
129extern int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 129int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 130 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 131 struct tcf_exts *exts,
132 const struct tcf_ext_map *map); 132 const struct tcf_ext_map *map);
133extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 135 struct tcf_exts *src);
136extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts,
137 const struct tcf_ext_map *map); 137 const struct tcf_ext_map *map);
138extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, 138int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
139 const struct tcf_ext_map *map); 139 const struct tcf_ext_map *map);
140 140
141/** 141/**
142 * struct tcf_pkt_info - packet information 142 * struct tcf_pkt_info - packet information
@@ -239,14 +239,14 @@ struct tcf_ematch_ops {
239 struct list_head link; 239 struct list_head link;
240}; 240};
241 241
242extern int tcf_em_register(struct tcf_ematch_ops *); 242int tcf_em_register(struct tcf_ematch_ops *);
243extern void tcf_em_unregister(struct tcf_ematch_ops *); 243void tcf_em_unregister(struct tcf_ematch_ops *);
244extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *, 244int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
245 struct tcf_ematch_tree *); 245 struct tcf_ematch_tree *);
246extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); 246void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
247extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); 247int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int);
248extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *, 248int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *,
249 struct tcf_pkt_info *); 249 struct tcf_pkt_info *);
250 250
251/** 251/**
252 * tcf_em_tree_change - replace ematch tree of a running classifier 252 * tcf_em_tree_change - replace ematch tree of a running classifier
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 388bf8b6d060..f7c24f8fbdc5 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -64,8 +64,8 @@ struct qdisc_watchdog {
64 struct Qdisc *qdisc; 64 struct Qdisc *qdisc;
65}; 65};
66 66
67extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); 67void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
68extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires); 68void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
69 69
70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, 70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
71 psched_time_t expires) 71 psched_time_t expires)
@@ -73,31 +73,31 @@ static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires)); 73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
74} 74}
75 75
76extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); 76void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
77 77
78extern struct Qdisc_ops pfifo_qdisc_ops; 78extern struct Qdisc_ops pfifo_qdisc_ops;
79extern struct Qdisc_ops bfifo_qdisc_ops; 79extern struct Qdisc_ops bfifo_qdisc_ops;
80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops; 80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops;
81 81
82extern int fifo_set_limit(struct Qdisc *q, unsigned int limit); 82int fifo_set_limit(struct Qdisc *q, unsigned int limit);
83extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, 83struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
84 unsigned int limit); 84 unsigned int limit);
85 85
86extern int register_qdisc(struct Qdisc_ops *qops); 86int register_qdisc(struct Qdisc_ops *qops);
87extern int unregister_qdisc(struct Qdisc_ops *qops); 87int unregister_qdisc(struct Qdisc_ops *qops);
88extern void qdisc_list_del(struct Qdisc *q); 88void qdisc_list_del(struct Qdisc *q);
89extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 89struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
90extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 90struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
91extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 91struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
92 struct nlattr *tab); 92 struct nlattr *tab);
93extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 93void qdisc_put_rtab(struct qdisc_rate_table *tab);
94extern void qdisc_put_stab(struct qdisc_size_table *tab); 94void qdisc_put_stab(struct qdisc_size_table *tab);
95extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 95void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
96extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, 96int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
97 struct net_device *dev, struct netdev_queue *txq, 97 struct net_device *dev, struct netdev_queue *txq,
98 spinlock_t *root_lock); 98 spinlock_t *root_lock);
99 99
100extern void __qdisc_run(struct Qdisc *q); 100void __qdisc_run(struct Qdisc *q);
101 101
102static inline void qdisc_run(struct Qdisc *q) 102static inline void qdisc_run(struct Qdisc *q)
103{ 103{
@@ -105,10 +105,10 @@ static inline void qdisc_run(struct Qdisc *q)
105 __qdisc_run(q); 105 __qdisc_run(q);
106} 106}
107 107
108extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, 108int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
109 struct tcf_result *res);
110extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
111 struct tcf_result *res); 109 struct tcf_result *res);
110int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
111 struct tcf_result *res);
112 112
113/* Calculate maximal size of packet seen by hard_start_xmit 113/* Calculate maximal size of packet seen by hard_start_xmit
114 routine of this device. 114 routine of this device.
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 6eab63363e59..ffc9d883b163 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -350,30 +350,32 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
350 return NULL; 350 return NULL;
351} 351}
352 352
353extern int qdisc_class_hash_init(struct Qdisc_class_hash *); 353int qdisc_class_hash_init(struct Qdisc_class_hash *);
354extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *); 354void qdisc_class_hash_insert(struct Qdisc_class_hash *,
355extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *); 355 struct Qdisc_class_common *);
356extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *); 356void qdisc_class_hash_remove(struct Qdisc_class_hash *,
357extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *); 357 struct Qdisc_class_common *);
358 358void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
359extern void dev_init_scheduler(struct net_device *dev); 359void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
360extern void dev_shutdown(struct net_device *dev); 360
361extern void dev_activate(struct net_device *dev); 361void dev_init_scheduler(struct net_device *dev);
362extern void dev_deactivate(struct net_device *dev); 362void dev_shutdown(struct net_device *dev);
363extern void dev_deactivate_many(struct list_head *head); 363void dev_activate(struct net_device *dev);
364extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, 364void dev_deactivate(struct net_device *dev);
365 struct Qdisc *qdisc); 365void dev_deactivate_many(struct list_head *head);
366extern void qdisc_reset(struct Qdisc *qdisc); 366struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
367extern void qdisc_destroy(struct Qdisc *qdisc); 367 struct Qdisc *qdisc);
368extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 368void qdisc_reset(struct Qdisc *qdisc);
369extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 369void qdisc_destroy(struct Qdisc *qdisc);
370 struct Qdisc_ops *ops); 370void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
371extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue, 371struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
372 struct Qdisc_ops *ops, u32 parentid); 372 struct Qdisc_ops *ops);
373extern void __qdisc_calculate_pkt_len(struct sk_buff *skb, 373struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
374 const struct qdisc_size_table *stab); 374 struct Qdisc_ops *ops, u32 parentid);
375extern void tcf_destroy(struct tcf_proto *tp); 375void __qdisc_calculate_pkt_len(struct sk_buff *skb,
376extern void tcf_destroy_chain(struct tcf_proto **fl); 376 const struct qdisc_size_table *stab);
377void tcf_destroy(struct tcf_proto *tp);
378void tcf_destroy_chain(struct tcf_proto **fl);
377 379
378/* Reset all TX qdiscs greater then index of a device. */ 380/* Reset all TX qdiscs greater then index of a device. */
379static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) 381static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
@@ -692,7 +694,8 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
692 return ((u64)(len + r->overhead) * r->mult) >> r->shift; 694 return ((u64)(len + r->overhead) * r->mult) >> r->shift;
693} 695}
694 696
695extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); 697void psched_ratecfg_precompute(struct psched_ratecfg *r,
698 const struct tc_ratespec *conf);
696 699
697static inline void psched_ratecfg_getrate(struct tc_ratespec *res, 700static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
698 const struct psched_ratecfg *r) 701 const struct psched_ratecfg *r)
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 49bc9577c61e..754c511f4cf9 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -22,7 +22,7 @@
22 * 22 *
23 * Please send any bug reports or fixes you make to the 23 * Please send any bug reports or fixes you make to the
24 * email address(es): 24 * email address(es):
25 * lksctp developers <lksctp-developers@lists.sourceforge.net> 25 * lksctp developers <linux-sctp@vger.kernel.org>
26 * 26 *
27 * Or submit a bug report through the following website: 27 * Or submit a bug report through the following website:
28 * http://www.sf.net/projects/lksctp 28 * http://www.sf.net/projects/lksctp
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 0cb08e6fb6df..483e6303458d 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -25,7 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 * 29 *
30 * Or submit a bug report through the following website: 30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp 31 * http://www.sf.net/projects/lksctp
@@ -85,4 +85,19 @@ static inline __le32 sctp_end_cksum(__u32 crc32)
85 return cpu_to_le32(~crc32); 85 return cpu_to_le32(~crc32);
86} 86}
87 87
88/* Calculate the CRC32C checksum of an SCTP packet. */
89static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
90 unsigned int offset)
91{
92 const struct sk_buff *iter;
93
94 __u32 crc32 = sctp_start_cksum(skb->data + offset,
95 skb_headlen(skb) - offset);
96 skb_walk_frags(skb, iter)
97 crc32 = sctp_update_cksum((__u8 *) iter->data,
98 skb_headlen(iter), crc32);
99
100 return sctp_end_cksum(crc32);
101}
102
88#endif /* __sctp_checksum_h__ */ 103#endif /* __sctp_checksum_h__ */
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index ca50e0751e47..a1e7aa5c8bbf 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -25,7 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 * 29 *
30 * Or submit a bug report through the following website: 30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp 31 * http://www.sf.net/projects/lksctp
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index d8e37ecea691..cb28df9c2781 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -27,7 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email address(es): 29 * email address(es):
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 * 31 *
32 * Or submit a bug report through the following website: 32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp 33 * http://www.sf.net/projects/lksctp
@@ -613,7 +613,7 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
613 */ 613 */
614static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) 614static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
615{ 615{
616 if (t->dst && !dst_check(t->dst, 0)) { 616 if (t->dst && !dst_check(t->dst, t->dst_cookie)) {
617 dst_release(t->dst); 617 dst_release(t->dst);
618 t->dst = NULL; 618 t->dst = NULL;
619 } 619 }
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 2a82d1384706..2aa66dda4a5a 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -27,7 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email addresses: 29 * email addresses:
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 * 31 *
32 * Or submit a bug report through the following website: 32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp 33 * http://www.sf.net/projects/lksctp
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e745c92a1532..c0f4e29eedd5 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -25,7 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email addresses: 27 * email addresses:
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 * 29 *
30 * Or submit a bug report through the following website: 30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp 31 * http://www.sf.net/projects/lksctp
@@ -946,6 +946,7 @@ struct sctp_transport {
946 __u64 hb_nonce; 946 __u64 hb_nonce;
947 947
948 struct rcu_head rcu; 948 struct rcu_head rcu;
949 u32 dst_cookie;
949}; 950};
950 951
951struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *, 952struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 2c5d2b4d5d1e..c361d6f7e0cb 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -28,7 +28,7 @@
28 * 28 *
29 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
30 * email address(es): 30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
32 * 32 *
33 * Or submit a bug report through the following website: 33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp 34 * http://www.sf.net/projects/lksctp
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index ca4693b4e09e..34f0d34d22ce 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -31,7 +31,7 @@
31 * 31 *
32 * Please send any bug reports or fixes you make to the 32 * Please send any bug reports or fixes you make to the
33 * email address(es): 33 * email address(es):
34 * lksctp developers <lksctp-developers@lists.sourceforge.net> 34 * lksctp developers <linux-sctp@vger.kernel.org>
35 * 35 *
36 * Or submit a bug report through the following website: 36 * Or submit a bug report through the following website:
37 * http://www.sf.net/projects/lksctp 37 * http://www.sf.net/projects/lksctp
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 00e50ba3f24b..add3237a9fdb 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -30,7 +30,7 @@
30 * 30 *
31 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
32 * email addresses: 32 * email addresses:
33 * lksctp developers <lksctp-developers@lists.sourceforge.net> 33 * lksctp developers <linux-sctp@vger.kernel.org>
34 * 34 *
35 * Or submit a bug report through the following website: 35 * Or submit a bug report through the following website:
36 * http://www.sf.net/projects/lksctp 36 * http://www.sf.net/projects/lksctp
diff --git a/include/net/sock.h b/include/net/sock.h
index 31d5cfbb51ec..ab6a8b75207e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -746,11 +746,6 @@ static inline int sk_stream_wspace(const struct sock *sk)
746 746
747extern void sk_stream_write_space(struct sock *sk); 747extern void sk_stream_write_space(struct sock *sk);
748 748
749static inline bool sk_stream_memory_free(const struct sock *sk)
750{
751 return sk->sk_wmem_queued < sk->sk_sndbuf;
752}
753
754/* OOB backlog add */ 749/* OOB backlog add */
755static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) 750static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
756{ 751{
@@ -950,6 +945,7 @@ struct proto {
950 unsigned int inuse_idx; 945 unsigned int inuse_idx;
951#endif 946#endif
952 947
948 bool (*stream_memory_free)(const struct sock *sk);
953 /* Memory pressure */ 949 /* Memory pressure */
954 void (*enter_memory_pressure)(struct sock *sk); 950 void (*enter_memory_pressure)(struct sock *sk);
955 atomic_long_t *memory_allocated; /* Current allocated memory. */ 951 atomic_long_t *memory_allocated; /* Current allocated memory. */
@@ -1088,6 +1084,21 @@ static inline struct cg_proto *parent_cg_proto(struct proto *proto,
1088} 1084}
1089#endif 1085#endif
1090 1086
1087static inline bool sk_stream_memory_free(const struct sock *sk)
1088{
1089 if (sk->sk_wmem_queued >= sk->sk_sndbuf)
1090 return false;
1091
1092 return sk->sk_prot->stream_memory_free ?
1093 sk->sk_prot->stream_memory_free(sk) : true;
1094}
1095
1096static inline bool sk_stream_is_writeable(const struct sock *sk)
1097{
1098 return sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) &&
1099 sk_stream_memory_free(sk);
1100}
1101
1091 1102
1092static inline bool sk_has_memory_pressure(const struct sock *sk) 1103static inline bool sk_has_memory_pressure(const struct sock *sk)
1093{ 1104{
@@ -1509,6 +1520,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk,
1509 unsigned long size, int force, 1520 unsigned long size, int force,
1510 gfp_t priority); 1521 gfp_t priority);
1511extern void sock_wfree(struct sk_buff *skb); 1522extern void sock_wfree(struct sk_buff *skb);
1523extern void skb_orphan_partial(struct sk_buff *skb);
1512extern void sock_rfree(struct sk_buff *skb); 1524extern void sock_rfree(struct sk_buff *skb);
1513extern void sock_edemux(struct sk_buff *skb); 1525extern void sock_edemux(struct sk_buff *skb);
1514 1526
@@ -2249,6 +2261,8 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb)
2249extern void sock_enable_timestamp(struct sock *sk, int flag); 2261extern void sock_enable_timestamp(struct sock *sk, int flag);
2250extern int sock_get_timestamp(struct sock *, struct timeval __user *); 2262extern int sock_get_timestamp(struct sock *, struct timeval __user *);
2251extern int sock_get_timestampns(struct sock *, struct timespec __user *); 2263extern int sock_get_timestampns(struct sock *, struct timespec __user *);
2264extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
2265 int level, int type);
2252 2266
2253/* 2267/*
2254 * Enable debug/info messages 2268 * Enable debug/info messages
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d1980054ec75..27b652f379ef 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -192,10 +192,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
192#define TCPOLEN_TIMESTAMP 10 192#define TCPOLEN_TIMESTAMP 10
193#define TCPOLEN_MD5SIG 18 193#define TCPOLEN_MD5SIG 18
194#define TCPOLEN_EXP_FASTOPEN_BASE 4 194#define TCPOLEN_EXP_FASTOPEN_BASE 4
195#define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */
196#define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */
197#define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN)
198#define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX)
199 195
200/* But this is what stacks really send out. */ 196/* But this is what stacks really send out. */
201#define TCPOLEN_TSTAMP_ALIGNED 12 197#define TCPOLEN_TSTAMP_ALIGNED 12
@@ -284,6 +280,7 @@ extern int sysctl_tcp_thin_dupack;
284extern int sysctl_tcp_early_retrans; 280extern int sysctl_tcp_early_retrans;
285extern int sysctl_tcp_limit_output_bytes; 281extern int sysctl_tcp_limit_output_bytes;
286extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat;
287 284
288extern atomic_long_t tcp_memory_allocated; 285extern atomic_long_t tcp_memory_allocated;
289extern struct percpu_counter tcp_sockets_allocated; 286extern struct percpu_counter tcp_sockets_allocated;
@@ -591,7 +588,6 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
591extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 588extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
592extern int tcp_mss_to_mtu(struct sock *sk, int mss); 589extern int tcp_mss_to_mtu(struct sock *sk, int mss);
593extern void tcp_mtup_init(struct sock *sk); 590extern void tcp_mtup_init(struct sock *sk);
594extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
595extern void tcp_init_buffer_space(struct sock *sk); 591extern void tcp_init_buffer_space(struct sock *sk);
596 592
597static inline void tcp_bound_rto(const struct sock *sk) 593static inline void tcp_bound_rto(const struct sock *sk)
@@ -1094,15 +1090,6 @@ static inline void tcp_openreq_init(struct request_sock *req,
1094 ireq->loc_port = tcp_hdr(skb)->dest; 1090 ireq->loc_port = tcp_hdr(skb)->dest;
1095} 1091}
1096 1092
1097/* Compute time elapsed between SYNACK and the ACK completing 3WHS */
1098static inline void tcp_synack_rtt_meas(struct sock *sk,
1099 struct request_sock *req)
1100{
1101 if (tcp_rsk(req)->snt_synack)
1102 tcp_valid_rtt_meas(sk,
1103 tcp_time_stamp - tcp_rsk(req)->snt_synack);
1104}
1105
1106extern void tcp_enter_memory_pressure(struct sock *sk); 1093extern void tcp_enter_memory_pressure(struct sock *sk);
1107 1094
1108static inline int keepalive_intvl_when(const struct tcp_sock *tp) 1095static inline int keepalive_intvl_when(const struct tcp_sock *tp)
@@ -1549,6 +1536,19 @@ extern int tcp_gro_complete(struct sk_buff *skb);
1549extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, 1536extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
1550 __be32 daddr); 1537 __be32 daddr);
1551 1538
1539static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
1540{
1541 return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat;
1542}
1543
1544static inline bool tcp_stream_memory_free(const struct sock *sk)
1545{
1546 const struct tcp_sock *tp = tcp_sk(sk);
1547 u32 notsent_bytes = tp->write_seq - tp->snd_nxt;
1548
1549 return notsent_bytes < tcp_notsent_lowat(tp);
1550}
1551
1552#ifdef CONFIG_PROC_FS 1552#ifdef CONFIG_PROC_FS
1553extern int tcp4_proc_init(void); 1553extern int tcp4_proc_init(void);
1554extern void tcp4_proc_exit(void); 1554extern void tcp4_proc_exit(void);
diff --git a/include/net/udp.h b/include/net/udp.h
index 74c10ec5e74f..ef2e0b7843a0 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -183,6 +183,7 @@ extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
183 struct msghdr *msg, size_t len); 183 struct msghdr *msg, size_t len);
184extern int udp_push_pending_frames(struct sock *sk); 184extern int udp_push_pending_frames(struct sock *sk);
185extern void udp_flush_pending_frames(struct sock *sk); 185extern void udp_flush_pending_frames(struct sock *sk);
186extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst);
186extern int udp_rcv(struct sk_buff *skb); 187extern int udp_rcv(struct sk_buff *skb);
187extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 188extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
188extern int udp_disconnect(struct sock *sk, int flags); 189extern int udp_disconnect(struct sock *sk, int flags);
diff --git a/include/net/vsock_addr.h b/include/net/vsock_addr.h
new file mode 100644
index 000000000000..9ccd5316eac0
--- /dev/null
+++ b/include/net/vsock_addr.h
@@ -0,0 +1,30 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _VSOCK_ADDR_H_
17#define _VSOCK_ADDR_H_
18
19#include <linux/vm_sockets.h>
20
21void vsock_addr_init(struct sockaddr_vm *addr, u32 cid, u32 port);
22int vsock_addr_validate(const struct sockaddr_vm *addr);
23bool vsock_addr_bound(const struct sockaddr_vm *addr);
24void vsock_addr_unbind(struct sockaddr_vm *addr);
25bool vsock_addr_equals_addr(const struct sockaddr_vm *addr,
26 const struct sockaddr_vm *other);
27int vsock_addr_cast(const struct sockaddr *addr, size_t len,
28 struct sockaddr_vm **out_addr);
29
30#endif