[RFC PATCH mptcp-next 1/4] mptcp: Move some symbols to be visible outside the MPTCP subsystem

Mat Martineau posted 4 patches 3 years, 11 months ago
Maintainers: "David S. Miller" <davem@davemloft.net>, David Ahern <dsahern@kernel.org>, Matthieu Baerts <matthieu.baerts@tessares.net>, Eric Dumazet <edumazet@google.com>, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Jakub Kicinski <kuba@kernel.org>
[RFC PATCH mptcp-next 1/4] mptcp: Move some symbols to be visible outside the MPTCP subsystem
Posted by Mat Martineau 3 years, 11 months ago
Later patches will be checking MPTCP enabled status and a TCP option,
so make those symbols available in TCP code.

Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 include/net/mptcp.h  | 18 ++++++++++++++++++
 net/mptcp/protocol.h | 12 ------------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index b8939d7ea12e..211f395d8139 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -16,6 +16,17 @@ struct mptcp_info;
 struct mptcp_sock;
 struct seq_file;
 
+/* MPTCP option subtypes */
+#define MPTCPOPT_MP_CAPABLE	0
+#define MPTCPOPT_MP_JOIN	1
+#define MPTCPOPT_DSS		2
+#define MPTCPOPT_ADD_ADDR	3
+#define MPTCPOPT_RM_ADDR	4
+#define MPTCPOPT_MP_PRIO	5
+#define MPTCPOPT_MP_FAIL	6
+#define MPTCPOPT_MP_FASTCLOSE	7
+#define MPTCPOPT_RST		8
+
 /* MPTCP sk_buff extension data */
 struct mptcp_ext {
 	union {
@@ -100,6 +111,8 @@ extern struct request_sock_ops mptcp_subflow_request_sock_ops;
 
 void mptcp_init(void);
 
+int mptcp_is_enabled(const struct net *net);
+
 static inline bool sk_is_mptcp(const struct sock *sk)
 {
 	return tcp_sk(sk)->is_mptcp;
@@ -219,6 +232,11 @@ static inline void mptcp_init(void)
 {
 }
 
+static inline int mptcp_is_enabled(const struct net *net)
+{
+	return 0;
+}
+
 static inline bool sk_is_mptcp(const struct sock *sk)
 {
 	return false;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 7ec2513e1c2f..75c852f0dd3a 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -36,17 +36,6 @@
 #define OPTIONS_MPTCP_MPJ	(OPTION_MPTCP_MPJ_SYN | OPTION_MPTCP_MPJ_SYNACK | \
 				 OPTION_MPTCP_MPJ_ACK)
 
-/* MPTCP option subtypes */
-#define MPTCPOPT_MP_CAPABLE	0
-#define MPTCPOPT_MP_JOIN	1
-#define MPTCPOPT_DSS		2
-#define MPTCPOPT_ADD_ADDR	3
-#define MPTCPOPT_RM_ADDR	4
-#define MPTCPOPT_MP_PRIO	5
-#define MPTCPOPT_MP_FAIL	6
-#define MPTCPOPT_MP_FASTCLOSE	7
-#define MPTCPOPT_RST		8
-
 /* MPTCP suboption lengths */
 #define TCPOLEN_MPTCP_MPC_SYN		4
 #define TCPOLEN_MPTCP_MPC_SYNACK	12
@@ -577,7 +566,6 @@ static inline void mptcp_subflow_delegated_done(struct mptcp_subflow_context *su
 	clear_bit(action, &subflow->delegated_status);
 }
 
-int mptcp_is_enabled(const struct net *net);
 unsigned int mptcp_get_add_addr_timeout(const struct net *net);
 int mptcp_is_checksum_enabled(const struct net *net);
 int mptcp_allow_join_id0(const struct net *net);
-- 
2.35.1