net: l2tp: export debug flags to UAPI
authorAsbjørn Sloth Tønnesen <asbjorn@asbjorn.st>
Thu, 21 May 2020 23:57:19 +0000 (00:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 14:40:29 +0000 (16:40 +0200)
commit 41c43fbee68f4f9a2a9675d83bca91c77862d7f0 upstream.

Move the L2TP_MSG_* definitions to UAPI, as it is part of
the netlink API.

Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/uapi/linux/l2tp.h
net/l2tp/l2tp_core.h

index 347ef22a964ee4d112fa31e1974609eb6fb525df..dedfb2b1832ae6b46eb7418d225c67f570e8b85e 100644 (file)
@@ -108,7 +108,7 @@ enum {
        L2TP_ATTR_VLAN_ID,              /* u16 */
        L2TP_ATTR_COOKIE,               /* 0, 4 or 8 bytes */
        L2TP_ATTR_PEER_COOKIE,          /* 0, 4 or 8 bytes */
-       L2TP_ATTR_DEBUG,                /* u32 */
+       L2TP_ATTR_DEBUG,                /* u32, enum l2tp_debug_flags */
        L2TP_ATTR_RECV_SEQ,             /* u8 */
        L2TP_ATTR_SEND_SEQ,             /* u8 */
        L2TP_ATTR_LNS_MODE,             /* u8 */
@@ -173,6 +173,21 @@ enum l2tp_seqmode {
        L2TP_SEQ_ALL = 2,
 };
 
+/**
+ * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions
+ *
+ * @L2TP_MSG_DEBUG: verbose debug (if compiled in)
+ * @L2TP_MSG_CONTROL: userspace - kernel interface
+ * @L2TP_MSG_SEQ: sequence numbers
+ * @L2TP_MSG_DATA: data packets
+ */
+enum l2tp_debug_flags {
+       L2TP_MSG_DEBUG          = (1 << 0),
+       L2TP_MSG_CONTROL        = (1 << 1),
+       L2TP_MSG_SEQ            = (1 << 2),
+       L2TP_MSG_DATA           = (1 << 3),
+};
+
 /*
  * NETLINK_GENERIC related info
  */
index ee59d9961d1fd502045e8f8944a406cdd54670f5..2469f63649bbb0020bb6a88fcabbbaed1ce05d91 100644 (file)
 #define L2TP_HASH_BITS_2       8
 #define L2TP_HASH_SIZE_2       (1 << L2TP_HASH_BITS_2)
 
-/* Debug message categories for the DEBUG socket option */
-enum {
-       L2TP_MSG_DEBUG          = (1 << 0),     /* verbose debug (if
-                                                * compiled in) */
-       L2TP_MSG_CONTROL        = (1 << 1),     /* userspace - kernel
-                                                * interface */
-       L2TP_MSG_SEQ            = (1 << 2),     /* sequence numbers */
-       L2TP_MSG_DATA           = (1 << 3),     /* data packets */
-};
-
 struct sk_buff;
 
 struct l2tp_stats {