From 1d7b8edda9837572e9ef53cac88d928f07cefacc Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Sun, 19 Aug 2018 21:53:14 +0200
Subject: [PATCH 045/293] net: decode SOL_XDP socket option names

* xlat/sock_xdp_options.in: New file.
* net.c: Include "xlat/sock_xdp_options.h".
(print_sockopt_fd_level_name) <case SOL_XDP>: Print SOL_XDP socket
option names.
---
 net.c                    | 4 ++++
 xlat/sock_xdp_options.in | 8 ++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 xlat/sock_xdp_options.in

diff --git a/net.c b/net.c
index 1c4e8ba..66dde0f 100644
--- a/net.c
+++ b/net.c
@@ -458,6 +458,7 @@ SYS_FUNC(socketpair)
 #include "xlat/sock_nfcllcp_options.h"
 #include "xlat/sock_kcm_options.h"
 #include "xlat/sock_tls_options.h"
+#include "xlat/sock_xdp_options.h"
 
 static void
 print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
@@ -550,6 +551,9 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
 	case SOL_TLS:
 		printxval(sock_tls_options, name, "TLS_???");
 		break;
+	case SOL_XDP:
+		printxval_index(sock_xdp_options, name, "XDP_???");
+		break;
 
 		/* Other SOL_* protocol levels still need work. */
 
diff --git a/xlat/sock_xdp_options.in b/xlat/sock_xdp_options.in
new file mode 100644
index 0000000..f2b7a68
--- /dev/null
+++ b/xlat/sock_xdp_options.in
@@ -0,0 +1,8 @@
+#value_indexed
+XDP_MMAP_OFFSETS		1
+XDP_RX_RING			2
+XDP_TX_RING			3
+XDP_UMEM_REG			4
+XDP_UMEM_FILL_RING		5
+XDP_UMEM_COMPLETION_RING	6
+XDP_STATISTICS			7
-- 
1.7.12.4

