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.
This commit is contained in:
Eugene Syromyatnikov 2018-08-19 21:53:14 +02:00 committed by Dmitry V. Levin
parent 45afd0c7a3
commit 1d7b8edda9
2 changed files with 12 additions and 0 deletions

4
net.c
View File

@ -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. */

8
xlat/sock_xdp_options.in Normal file
View File

@ -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