diff mbox series

[net-next,v2,5/7] uapi: mptcp: use header file generated from YAML spec

Message ID 20231023-send-net-next-20231023-1-v2-5-16b1f701f900@kernel.org (mailing list archive)
State Mainlined, archived
Delegated to: Mat Martineau
Headers show
Series mptcp: convert Netlink code to use YAML spec | expand

Commit Message

Mat Martineau Oct. 23, 2023, 6:17 p.m. UTC
From: Davide Caratti <dcaratti@redhat.com>

generated with:

 $ ./tools/net/ynl/ynl-gen-c.py --mode uapi \
 > --spec Documentation/netlink/specs/mptcp.yaml \
 > --header -o include/uapi/linux/mptcp_pm.h

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/340
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
 MAINTAINERS                   |   2 +-
 include/uapi/linux/mptcp.h    | 182 +++---------------------------------------
 include/uapi/linux/mptcp_pm.h | 150 ++++++++++++++++++++++++++++++++++
 3 files changed, 161 insertions(+), 173 deletions(-)

Comments

Jakub Kicinski Oct. 24, 2023, 7:59 p.m. UTC | #1
On Mon, 23 Oct 2023 11:17:09 -0700 Mat Martineau wrote:
> +/* for backward compatibility */
> +#define	__MPTCP_PM_CMD_AFTER_LAST	__MPTCP_PM_CMD_MAX
> +#define	__MPTCP_ATTR_AFTER_LAST		__MPTCP_ATTR_MAX

Do you want to intentionally move to the normal naming or would you
prefer to keep the old names?

We have attr-cnt-name / attr-max-name for migrating existing families.
We can add similar properties for cmd if you prefer, I think that they
were not needed before.
Mat Martineau Oct. 24, 2023, 11:30 p.m. UTC | #2
On Tue, 24 Oct 2023, Jakub Kicinski wrote:

> On Mon, 23 Oct 2023 11:17:09 -0700 Mat Martineau wrote:
>> +/* for backward compatibility */
>> +#define	__MPTCP_PM_CMD_AFTER_LAST	__MPTCP_PM_CMD_MAX
>> +#define	__MPTCP_ATTR_AFTER_LAST		__MPTCP_ATTR_MAX
>
> Do you want to intentionally move to the normal naming or would you
> prefer to keep the old names?
>
> We have attr-cnt-name / attr-max-name for migrating existing families.
> We can add similar properties for cmd if you prefer, I think that they
> were not needed before.

I'm not sure if you're offering to add the feature or are asking us (well, 
Davide) to implement it :)

It would be nice to not have to carry these backward compatibility 
definitions forever, expecially since they're fairly obscure "__*" 
names. Low stakes for MPTCP alone, but it might be good to have as other 
netlink interfaces are migrated.

Davide & Paolo, what do you think?


- Mat
Jakub Kicinski Oct. 24, 2023, 11:49 p.m. UTC | #3
On Tue, 24 Oct 2023 16:30:27 -0700 (PDT) Mat Martineau wrote:
> I'm not sure if you're offering to add the feature or are asking us (well, 
> Davide) to implement it :)

Either way is fine, Davide seems to have tackled the extensions in patches 
1 and 2, so he may want to do it himself. Otherwise I'm more than happy
to type and send the patch :)

Let's make sure we update documentation, tho, in this case:
Documentation/userspace-api/netlink/c-code-gen.rst
Jakub Kicinski Oct. 24, 2023, 11:50 p.m. UTC | #4
On Tue, 24 Oct 2023 16:49:36 -0700 Jakub Kicinski wrote:
> On Tue, 24 Oct 2023 16:30:27 -0700 (PDT) Mat Martineau wrote:
> > I'm not sure if you're offering to add the feature or are asking us (well, 
> > Davide) to implement it :)  
> 
> Either way is fine, Davide seems to have tackled the extensions in patches 
> 1 and 2, so he may want to do it himself. Otherwise I'm more than happy
> to type and send the patch :)

To be clear - assuming you do actually want to keep using the old names.
Davide Caratti Oct. 25, 2023, 4:40 p.m. UTC | #5
hello,

thanks for looking at this.

On Tue, Oct 24, 2023 at 10:00 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> > On Mon, 23 Oct 2023 11:17:09 -0700 Mat Martineau wrote:
> >> +/* for backward compatibility */
> >> +#define     __MPTCP_PM_CMD_AFTER_LAST       __MPTCP_PM_CMD_MAX
> >> +#define     __MPTCP_ATTR_AFTER_LAST         __MPTCP_ATTR_MAX
> >
> > Do you want to intentionally move to the normal naming or would you
> > prefer to keep the old names?

given that nobody should use them, I'd prefer to move to the normal
naming and drop the old definitions (_MPTCP_PM_CMD_AFTER_LAST and
__MPTCP_ATTR_AFTER_LAST). I was unsure if I could do the drop thing
actually, because applications using them would break the build then _
hence these two "backward compatibility" lines.

For the operation list, I see it's about exposing

cmd-cnt-name

to [ge]netlink*.yaml, and then do:

  9 max-by-define: true
 10 kernel-policy: per-op
 11 cmd-cnt-name: --mptcp-pm-cmd-after-last    <-- this
 12
 13 definitions:

the generated MPTCP #define(s) are the same as the ones we have in
net-next now: no need to specify __MPTCP_PM_CMD_MAX anymore.

For the attributes, I thought I could use  'attr-cnt-name' like:

169     name: attr
170     name-prefix: mptcp-pm-attr-
171     attr-cnt-name: --mptcp-attr-after-last <-- this
172     attributes:

as described in the [ge]netlink schema, but the tool seems to just ignore it.
Jakub Kicinski Oct. 25, 2023, 6:18 p.m. UTC | #6
On Wed, 25 Oct 2023 18:40:52 +0200 Davide Caratti wrote:
> > > Do you want to intentionally move to the normal naming or would you
> > > prefer to keep the old names?  
> 
> given that nobody should use them, I'd prefer to move to the normal
> naming and drop the old definitions (_MPTCP_PM_CMD_AFTER_LAST and
> __MPTCP_ATTR_AFTER_LAST). I was unsure if I could do the drop thing
> actually, because applications using them would break the build then _
> hence these two "backward compatibility" lines.

It's up to you. Only mention on GitHub I see is this:
https://github.com/ngi-mptcp/mptcpanalyzer/blob/d6f5a4a61235f40dd17b1ef394a91ec50eda53f7/mptcp-pm/src/Net/Mptcp/V0/Constants.chs#L34
No idea what it is and whether the define disappearing will break it.

If you're confident that no code will break we can rename.
The downside (other than an angry user) is that if someone reports
breakage late we may need to keep both names, to avoid breaking any
code created in between..

> For the operation list, I see it's about exposing
> 
> cmd-cnt-name
> 
> to [ge]netlink*.yaml, and then do:
> 
>   9 max-by-define: true
>  10 kernel-policy: per-op
>  11 cmd-cnt-name: --mptcp-pm-cmd-after-last    <-- this
>  12
>  13 definitions:
> 
> the generated MPTCP #define(s) are the same as the ones we have in
> net-next now: no need to specify __MPTCP_PM_CMD_MAX anymore.

Ah, I was looking at the documentation which is clearly out of date
already..

> For the attributes, I thought I could use  'attr-cnt-name' like:
> 
> 169     name: attr
> 170     name-prefix: mptcp-pm-attr-
> 171     attr-cnt-name: --mptcp-attr-after-last <-- this
> 172     attributes:
> 
> as described in the [ge]netlink schema, but the tool seems to just ignore it.

Mm. Looks like we only use this one at the family level.

diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 1c7474ad92dc..f9010fbbfdfd 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -789,9 +789,12 @@ from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, S
                 pfx = f"{family.name}-a-{self.name}-"
             self.name_prefix = c_upper(pfx)
             self.max_name = c_upper(self.yaml.get('attr-max-name', f"{self.name_prefix}max"))
+            cnt_name = family.get('attr-cnt-name', f"__{self.name_prefix}MAX")
+            self.cnt_name = c_upper(self.yaml.get('attr-cnt-name', cnt_name))
         else:
             self.name_prefix = family.attr_sets[self.subset_of].name_prefix
             self.max_name = family.attr_sets[self.subset_of].max_name
+            self.cnt_name = family.attr_sets[self.subset_of].cnt_name
 
         # Added by resolve:
         self.c_name = None
@@ -2354,7 +2357,7 @@ _C_KW = {
         if attr_set.subset_of:
             continue
 
-        cnt_name = c_upper(family.get('attr-cnt-name', f"__{attr_set.name_prefix}MAX"))
+        cnt_name = attr_set.cnt_name
         max_value = f"({cnt_name} - 1)"
 
         val = 0
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 977de4624fe0..b2f53d5cae06 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14964,7 +14964,7 @@  F:	Documentation/netlink/specs/mptcp.yaml
 F:	Documentation/networking/mptcp-sysctl.rst
 F:	include/net/mptcp.h
 F:	include/trace/events/mptcp.h
-F:	include/uapi/linux/mptcp.h
+F:	include/uapi/linux/mptcp*.h
 F:	net/mptcp/
 F:	tools/testing/selftests/bpf/*/*mptcp*.c
 F:	tools/testing/selftests/net/mptcp/
diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index 0e62937ab17c..64ecc8a3f9f2 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -23,99 +23,24 @@ 
 #define MPTCP_SUBFLOW_FLAG_CONNECTED		_BITUL(7)
 #define MPTCP_SUBFLOW_FLAG_MAPVALID		_BITUL(8)
 
-enum {
-	MPTCP_SUBFLOW_ATTR_UNSPEC,
-	MPTCP_SUBFLOW_ATTR_TOKEN_REM,
-	MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
-	MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
-	MPTCP_SUBFLOW_ATTR_MAP_SEQ,
-	MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
-	MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
-	MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
-	MPTCP_SUBFLOW_ATTR_FLAGS,
-	MPTCP_SUBFLOW_ATTR_ID_REM,
-	MPTCP_SUBFLOW_ATTR_ID_LOC,
-	MPTCP_SUBFLOW_ATTR_PAD,
-	__MPTCP_SUBFLOW_ATTR_MAX
-};
-
-#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
-
-/* netlink interface */
-#define MPTCP_PM_NAME		"mptcp_pm"
 #define MPTCP_PM_CMD_GRP_NAME	"mptcp_pm_cmds"
 #define MPTCP_PM_EV_GRP_NAME	"mptcp_pm_events"
-#define MPTCP_PM_VER		0x1
-
-/*
- * ATTR types defined for MPTCP
- */
-enum {
-	MPTCP_PM_ATTR_UNSPEC,
-
-	MPTCP_PM_ATTR_ADDR,				/* nested address */
-	MPTCP_PM_ATTR_RCV_ADD_ADDRS,			/* u32 */
-	MPTCP_PM_ATTR_SUBFLOWS,				/* u32 */
-	MPTCP_PM_ATTR_TOKEN,				/* u32 */
-	MPTCP_PM_ATTR_LOC_ID,				/* u8 */
-	MPTCP_PM_ATTR_ADDR_REMOTE,			/* nested address */
-
-	__MPTCP_PM_ATTR_MAX
-};
-
-#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
-
-enum {
-	MPTCP_PM_ENDPOINT_ADDR = 1,
-
-	__MPTCP_PM_ENDPOINT_MAX
-};
-
-#define MPTCP_PM_ENDPOINT_MAX (__MPTCP_PM_ENDPOINT_MAX - 1)
-
-enum {
-	MPTCP_PM_ADDR_ATTR_UNSPEC,
-
-	MPTCP_PM_ADDR_ATTR_FAMILY,			/* u16 */
-	MPTCP_PM_ADDR_ATTR_ID,				/* u8 */
-	MPTCP_PM_ADDR_ATTR_ADDR4,			/* struct in_addr */
-	MPTCP_PM_ADDR_ATTR_ADDR6,			/* struct in6_addr */
-	MPTCP_PM_ADDR_ATTR_PORT,			/* u16 */
-	MPTCP_PM_ADDR_ATTR_FLAGS,			/* u32 */
-	MPTCP_PM_ADDR_ATTR_IF_IDX,			/* s32 */
-
-	__MPTCP_PM_ADDR_ATTR_MAX
-};
 
-#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
+#include <linux/mptcp_pm.h>
 
-#define MPTCP_PM_ADDR_FLAG_SIGNAL			(1 << 0)
-#define MPTCP_PM_ADDR_FLAG_SUBFLOW			(1 << 1)
-#define MPTCP_PM_ADDR_FLAG_BACKUP			(1 << 2)
-#define MPTCP_PM_ADDR_FLAG_FULLMESH			(1 << 3)
-#define MPTCP_PM_ADDR_FLAG_IMPLICIT			(1 << 4)
-
-enum {
-	MPTCP_PM_CMD_UNSPEC,
-
-	MPTCP_PM_CMD_ADD_ADDR,
-	MPTCP_PM_CMD_DEL_ADDR,
-	MPTCP_PM_CMD_GET_ADDR,
-	MPTCP_PM_CMD_FLUSH_ADDRS,
-	MPTCP_PM_CMD_SET_LIMITS,
-	MPTCP_PM_CMD_GET_LIMITS,
-	MPTCP_PM_CMD_SET_FLAGS,
-	MPTCP_PM_CMD_ANNOUNCE,
-	MPTCP_PM_CMD_REMOVE,
-	MPTCP_PM_CMD_SUBFLOW_CREATE,
-	MPTCP_PM_CMD_SUBFLOW_DESTROY,
-
-	__MPTCP_PM_CMD_AFTER_LAST
-};
+/* for backward compatibility */
+#define	__MPTCP_PM_CMD_AFTER_LAST	__MPTCP_PM_CMD_MAX
+#define	__MPTCP_ATTR_AFTER_LAST		__MPTCP_ATTR_MAX
 
 #define MPTCP_INFO_FLAG_FALLBACK		_BITUL(0)
 #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED	_BITUL(1)
 
+#define MPTCP_PM_ADDR_FLAG_SIGNAL                      (1 << 0)
+#define MPTCP_PM_ADDR_FLAG_SUBFLOW                     (1 << 1)
+#define MPTCP_PM_ADDR_FLAG_BACKUP                      (1 << 2)
+#define MPTCP_PM_ADDR_FLAG_FULLMESH                    (1 << 3)
+#define MPTCP_PM_ADDR_FLAG_IMPLICIT                    (1 << 4)
+
 struct mptcp_info {
 	__u8	mptcpi_subflows;
 	__u8	mptcpi_add_addr_signal;
@@ -138,93 +63,6 @@  struct mptcp_info {
 	__u64	mptcpi_bytes_acked;
 };
 
-/*
- * MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,
- *                      sport, dport
- * A new MPTCP connection has been created. It is the good time to allocate
- * memory and send ADD_ADDR if needed. Depending on the traffic-patterns
- * it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent.
- *
- * MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,
- *			    sport, dport
- * A MPTCP connection is established (can start new subflows).
- *
- * MPTCP_EVENT_CLOSED: token
- * A MPTCP connection has stopped.
- *
- * MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport]
- * A new address has been announced by the peer.
- *
- * MPTCP_EVENT_REMOVED: token, rem_id
- * An address has been lost by the peer.
- *
- * MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id,
- *                              saddr4 | saddr6, daddr4 | daddr6, sport,
- *                              dport, backup, if_idx [, error]
- * A new subflow has been established. 'error' should not be set.
- *
- * MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,
- *                         daddr4 | daddr6, sport, dport, backup, if_idx
- *                         [, error]
- * A subflow has been closed. An error (copy of sk_err) could be set if an
- * error has been detected for this subflow.
- *
- * MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,
- *                           daddr4 | daddr6, sport, dport, backup, if_idx
- *                           [, error]
- * The priority of a subflow has changed. 'error' should not be set.
- *
- * MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6
- * A new PM listener is created.
- *
- * MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6
- * A PM listener is closed.
- */
-enum mptcp_event_type {
-	MPTCP_EVENT_UNSPEC = 0,
-	MPTCP_EVENT_CREATED = 1,
-	MPTCP_EVENT_ESTABLISHED = 2,
-	MPTCP_EVENT_CLOSED = 3,
-
-	MPTCP_EVENT_ANNOUNCED = 6,
-	MPTCP_EVENT_REMOVED = 7,
-
-	MPTCP_EVENT_SUB_ESTABLISHED = 10,
-	MPTCP_EVENT_SUB_CLOSED = 11,
-
-	MPTCP_EVENT_SUB_PRIORITY = 13,
-
-	MPTCP_EVENT_LISTENER_CREATED = 15,
-	MPTCP_EVENT_LISTENER_CLOSED = 16,
-};
-
-enum mptcp_event_attr {
-	MPTCP_ATTR_UNSPEC = 0,
-
-	MPTCP_ATTR_TOKEN,	/* u32 */
-	MPTCP_ATTR_FAMILY,	/* u16 */
-	MPTCP_ATTR_LOC_ID,	/* u8 */
-	MPTCP_ATTR_REM_ID,	/* u8 */
-	MPTCP_ATTR_SADDR4,	/* be32 */
-	MPTCP_ATTR_SADDR6,	/* struct in6_addr */
-	MPTCP_ATTR_DADDR4,	/* be32 */
-	MPTCP_ATTR_DADDR6,	/* struct in6_addr */
-	MPTCP_ATTR_SPORT,	/* be16 */
-	MPTCP_ATTR_DPORT,	/* be16 */
-	MPTCP_ATTR_BACKUP,	/* u8 */
-	MPTCP_ATTR_ERROR,	/* u8 */
-	MPTCP_ATTR_FLAGS,	/* u16 */
-	MPTCP_ATTR_TIMEOUT,	/* u32 */
-	MPTCP_ATTR_IF_IDX,	/* s32 */
-	MPTCP_ATTR_RESET_REASON,/* u32 */
-	MPTCP_ATTR_RESET_FLAGS, /* u32 */
-	MPTCP_ATTR_SERVER_SIDE,	/* u8 */
-
-	__MPTCP_ATTR_AFTER_LAST
-};
-
-#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
-
 /* MPTCP Reset reason codes, rfc8684 */
 #define MPTCP_RST_EUNSPEC	0
 #define MPTCP_RST_EMPTCP	1
diff --git a/include/uapi/linux/mptcp_pm.h b/include/uapi/linux/mptcp_pm.h
new file mode 100644
index 000000000000..0ad598fe940b
--- /dev/null
+++ b/include/uapi/linux/mptcp_pm.h
@@ -0,0 +1,150 @@ 
+/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
+/* Do not edit directly, auto-generated from: */
+/*	Documentation/netlink/specs/mptcp.yaml */
+/* YNL-GEN uapi header */
+
+#ifndef _UAPI_LINUX_MPTCP_PM_H
+#define _UAPI_LINUX_MPTCP_PM_H
+
+#define MPTCP_PM_NAME	"mptcp_pm"
+#define MPTCP_PM_VER	1
+
+/**
+ * enum mptcp_event_type
+ * @MPTCP_EVENT_UNSPEC: unused event
+ * @MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,
+ *   sport, dport A new MPTCP connection has been created. It is the good time
+ *   to allocate memory and send ADD_ADDR if needed. Depending on the
+ *   traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
+ *   is sent.
+ * @MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,
+ *   sport, dport A MPTCP connection is established (can start new subflows).
+ * @MPTCP_EVENT_CLOSED: token A MPTCP connection has stopped.
+ * @MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport] A
+ *   new address has been announced by the peer.
+ * @MPTCP_EVENT_REMOVED: token, rem_id An address has been lost by the peer.
+ * @MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id, saddr4 |
+ *   saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error] A new
+ *   subflow has been established. 'error' should not be set.
+ * @MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,
+ *   daddr4 | daddr6, sport, dport, backup, if_idx [, error] A subflow has been
+ *   closed. An error (copy of sk_err) could be set if an error has been
+ *   detected for this subflow.
+ * @MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,
+ *   daddr4 | daddr6, sport, dport, backup, if_idx [, error] The priority of a
+ *   subflow has changed. 'error' should not be set.
+ * @MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6 A new PM
+ *   listener is created.
+ * @MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6 A PM listener
+ *   is closed.
+ */
+enum mptcp_event_type {
+	MPTCP_EVENT_UNSPEC,
+	MPTCP_EVENT_CREATED,
+	MPTCP_EVENT_ESTABLISHED,
+	MPTCP_EVENT_CLOSED,
+	MPTCP_EVENT_ANNOUNCED = 6,
+	MPTCP_EVENT_REMOVED,
+	MPTCP_EVENT_SUB_ESTABLISHED = 10,
+	MPTCP_EVENT_SUB_CLOSED,
+	MPTCP_EVENT_SUB_PRIORITY = 13,
+	MPTCP_EVENT_LISTENER_CREATED = 15,
+	MPTCP_EVENT_LISTENER_CLOSED,
+};
+
+enum {
+	MPTCP_PM_ADDR_ATTR_UNSPEC,
+	MPTCP_PM_ADDR_ATTR_FAMILY,
+	MPTCP_PM_ADDR_ATTR_ID,
+	MPTCP_PM_ADDR_ATTR_ADDR4,
+	MPTCP_PM_ADDR_ATTR_ADDR6,
+	MPTCP_PM_ADDR_ATT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