strace/xlat/getsock_ipv6_options.in

11 lines
234 B
Plaintext
Raw Normal View History

decode extend getsockopt/setsockopt options Currently the code assumes the set of valid options between getsockopt and setsockopt are exactly the same and thus maintains one list. The kernel unfortunately does not do this -- it allows for different opts between the get and set functions. See the {g,s}et_opt{min,max} fields in the various netfilter subcores. To support this, extend the printxval function to take multiple sets of xlats as varargs. Then we add the new get/set lists, and pass them down in the net code when decoding things. A simple example is iptables; before: getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0 getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0 after: getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0 getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0 If these were setsockopt calls, then 0x40 & 0x41 would be IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS. * configure.ac: Check for netfilter headers. * defs.h (printxvals): New prototype. (printxval): Change to a define. * net.c: Include netfilter headers and new sockopts headers. (print_sockopt_fd_level_name): Add a is_getsockopt argument. Change SOL_IP and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more xlats down. (getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true. (setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false. * util.c (printxval): Rename to ... (printxvals): ... this. Rewrite to be varargs based. * xlat/getsockipoptions.in: New xlat list. * xlat/getsockipv6options.in, xlat/setsockipoptions.in, xlat/setsockipv6options.in: Likewise.
2015-08-19 13:29:27 -04:00
/*
* Options specific to getsockopt(SOL_IPV6).
* Common {g,s}etsockopt(SOL_IPV6) options
xlat: rename *sock*options xlat tables Such names as sockrxrpcoptions are incomprehensible. * xlat/getsockipoptions.in: Rename to xlat/getsock_ip_options.in. * xlat/getsockipv6options.in: Rename to xlat/getsock_ipv6_options.in. * xlat/setsockipoptions.in: Rename to xlat/setsock_ip_options.in. * xlat/setsockipv6options.in: Rename to xlat/setsock_ipv6_options.in. * xlat/sockalgoptions.in: Rename to xlat/sock_alg_options.in. * xlat/sockbluetoothoptions.in: Rename to xlat/sock_bluetooth_options.in. * xlat/sockcaifoptions.in: Rename to xlat/sock_caif_options.in. * xlat/sockdccpoptions.in: Rename to xlat/sock_dccp_options.in. * xlat/sockipoptions.in: Rename to xlat/sock_ip_options.in. * xlat/sockipv6options.in: Rename to xlat/sock_ipv6_options.in. * xlat/sockipxoptions.in: Rename to xlat/sock_ipx_options.in. * xlat/sockirdaoptions.in: Rename to xlat/sock_irda_options.in. * xlat/sockiucvoptions.in: Rename to xlat/sock_iucv_options.in. * xlat/sockkcmoptions.in: Rename to xlat/sock_kcm_options.in. * xlat/sockllcoptions.in: Rename to xlat/sock_llc_options.in. * xlat/socknetlinkoptions.in: Rename to xlat/sock_netlink_options.in. * xlat/socknfcllcpoptions.in: Rename to xlat/sock_nfcllcp_options.in. * xlat/sockoptions.in: Rename to xlat/sock_options.in. * xlat/sockpacketoptions.in: Rename to xlat/sock_packet_options.in. * xlat/sockpnpoptions.in: Rename to xlat/sock_pnp_options.in. * xlat/sockpppol2tpoptions.in: Rename to xlat/sock_pppol2tp_options.in. * xlat/sockrawoptions.in: Rename to xlat/sock_raw_options.in. * xlat/sockrdsoptions.in: Rename to xlat/sock_rds_options.in. * xlat/sockrxrpcoptions.in: Rename to xlat/sock_rxrpc_options.in. * xlat/socksctpoptions.in: Rename to xlat/sock_sctp_options.in. * xlat/socktcpoptions.in: Rename to xlat/sock_tcp_options.in. * xlat/socktipcoptions.in: Rename to xlat/sock_tipc_options.in. * xlat/socktlsoptions.in: Rename to xlat/sock_tls_options.in. * xlat/sockudpoptions.in: Rename to xlat/sock_udp_options.in. * net.c: Update.
2018-05-08 20:59:20 +00:00
* should be in sock_ipv6_options.in instead.
decode extend getsockopt/setsockopt options Currently the code assumes the set of valid options between getsockopt and setsockopt are exactly the same and thus maintains one list. The kernel unfortunately does not do this -- it allows for different opts between the get and set functions. See the {g,s}et_opt{min,max} fields in the various netfilter subcores. To support this, extend the printxval function to take multiple sets of xlats as varargs. Then we add the new get/set lists, and pass them down in the net code when decoding things. A simple example is iptables; before: getsockopt(4, SOL_IP, 0x40 /* IP_??? */, ...) = 0 getsockopt(4, SOL_IP, 0x41 /* IP_??? */, ...) = 0 after: getsockopt(4, SOL_IP, IPT_SO_GET_INFO, ...) = 0 getsockopt(4, SOL_IP, IPT_SO_GET_ENTRIES, ...) = 0 If these were setsockopt calls, then 0x40 & 0x41 would be IPT_SO_SET_REPLACE & IPT_SO_SET_ADD_COUNTERS. * configure.ac: Check for netfilter headers. * defs.h (printxvals): New prototype. (printxval): Change to a define. * net.c: Include netfilter headers and new sockopts headers. (print_sockopt_fd_level_name): Add a is_getsockopt argument. Change SOL_IP and SOL_IPV6 decoding to use printxvals, and use is_getsockopt to pass more xlats down. (getsockopt): Call print_sockopt_fd_level_name with is_getsockopt as true. (setsockopt): Call print_sockopt_fd_level_name with is_getsockopt as false. * util.c (printxval): Rename to ... (printxvals): ... this. Rewrite to be varargs based. * xlat/getsockipoptions.in: New xlat list. * xlat/getsockipv6options.in, xlat/setsockipoptions.in, xlat/setsockipv6options.in: Likewise.
2015-08-19 13:29:27 -04:00
*/
IP6T_SO_GET_INFO
IP6T_SO_GET_ENTRIES
IP6T_SO_GET_REVISION_MATCH
IP6T_SO_GET_REVISION_TARGET