net: decode SOL_CAN_RAW socket options

* xlat/sock_can_raw_options.in: New file.
* net.c: Include "xlat/sock_can_raw_options.h".
(print_sockopt_fd_level_name) <case SOL_CAN_RAW>: Print socket option
name using sock_can_raw_options xlat.
This commit is contained in:
Eugene Syromyatnikov
2018-10-20 06:25:22 +02:00
parent 53bc64c795
commit 3c068f860e
2 changed files with 11 additions and 0 deletions

4
net.c
View File

@ -470,6 +470,7 @@ SYS_FUNC(socketpair)
#include "xlat/sock_sctp_options.h"
#include "xlat/sock_tcp_options.h"
#include "xlat/sock_udp_options.h"
#include "xlat/sock_can_raw_options.h"
#include "xlat/sock_irda_options.h"
#include "xlat/sock_llc_options.h"
#include "xlat/sock_dccp_options.h"
@ -524,6 +525,9 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
case SOL_TCP:
printxval(sock_tcp_options, name, "TCP_???");
break;
case SOL_CAN_RAW:
printxval(sock_can_raw_options, name, "CAN_RAW_???");
break;
case SOL_SCTP:
printxval(sock_sctp_options, name, "SCTP_???");
break;

View File

@ -0,0 +1,7 @@
#value_indexed
CAN_RAW_FILTER 1
CAN_RAW_ERR_FILTER 2
CAN_RAW_LOOPBACK 3
CAN_RAW_RECV_OWN_MSGS 4
CAN_RAW_FD_FRAMES 5
CAN_RAW_JOIN_FILTERS 6