linux/falloc.h
linux/filter.h
linux/hiddev.h
+ linux/ip_vs.h
linux/mmtimer.h
linux/perf_event.h
linux/seccomp.h
AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
AC_CHECK_TYPES([struct sigcontext],,, [#include <signal.h>])
AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
+AC_CHECK_HEADERS(m4_normalize([
+ linux/netfilter_arp/arp_tables.h
+ linux/netfilter_bridge/ebtables.h
+ linux/netfilter_ipv4/ip_tables.h
+ linux/netfilter_ipv6/ip6_tables.h
+]), [], [], [#include <netinet/in.h>
+#include <net/if.h>])
AC_CHECK_TYPES([struct mmsghdr],,, [#include <sys/socket.h>])
AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
ATTRIBUTE_FORMAT((printf, 2, 0));
extern void printaddr(long);
-extern void printxval(const struct xlat *, const unsigned int, const char *);
+extern void printxvals(const unsigned int, const char *, const struct xlat *, ...);
+#define printxval(xlat, val, dflt) printxvals(val, dflt, xlat, NULL)
extern int printargs(struct tcb *);
extern int printargs_lu(struct tcb *);
extern int printargs_ld(struct tcb *);
# include <linux/ipx.h>
#endif
+#if defined(HAVE_LINUX_IP_VS_H)
+# include <linux/ip_vs.h>
+#endif
#if defined(HAVE_LINUX_NETLINK_H)
# include <linux/netlink.h>
#endif
+#if defined(HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H)
+# include <linux/netfilter_arp/arp_tables.h>
+#endif
+#if defined(HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H)
+# include <linux/netfilter_bridge/ebtables.h>
+#endif
+#if defined(HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H)
+# include <linux/netfilter_ipv4/ip_tables.h>
+#endif
+#if defined(HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H)
+# include <linux/netfilter_ipv6/ip6_tables.h>
+#endif
#if defined(HAVE_LINUX_IF_PACKET_H)
# include <linux/if_packet.h>
#endif
#include "xlat/sockoptions.h"
#include "xlat/sockipoptions.h"
+#include "xlat/getsockipoptions.h"
+#include "xlat/setsockipoptions.h"
#include "xlat/sockipv6options.h"
+#include "xlat/getsockipv6options.h"
+#include "xlat/setsockipv6options.h"
#include "xlat/sockipxoptions.h"
#include "xlat/sockrawoptions.h"
#include "xlat/sockpacketoptions.h"
#include "xlat/socktcpoptions.h"
static void
-print_sockopt_fd_level_name(struct tcb *tcp, int fd, int level, int name)
+print_sockopt_fd_level_name(struct tcb *tcp, int fd, int level, int name, bool is_getsockopt)
{
printfd(tcp, fd);
tprints(", ");
printxval(sockoptions, name, "SO_???");
break;
case SOL_IP:
- printxval(sockipoptions, name, "IP_???");
+ printxvals(name, "IP_???", sockipoptions,
+ is_getsockopt ? getsockipoptions : setsockipoptions, NULL);
break;
case SOL_IPV6:
- printxval(sockipv6options, name, "IPV6_???");
+ printxvals(name, "IPV6_???", sockipv6options,
+ is_getsockopt ? getsockipv6options : setsockipv6options, NULL);
break;
case SOL_IPX:
printxval(sockipxoptions, name, "IPX_???");
{
if (entering(tcp)) {
print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
- tcp->u_arg[1], tcp->u_arg[2]);
+ tcp->u_arg[1], tcp->u_arg[2], true);
} else {
int len;
SYS_FUNC(setsockopt)
{
print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
- tcp->u_arg[1], tcp->u_arg[2]);
+ tcp->u_arg[1], tcp->u_arg[2], false);
print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
tcp->u_arg[3], tcp->u_arg[4]);
#include "defs.h"
#include <sys/param.h>
#include <fcntl.h>
+#include <stdarg.h>
#ifdef HAVE_SYS_XATTR_H
# include <sys/xattr.h>
#endif
* Print entry in struct xlat table, if there.
*/
void
-printxval(const struct xlat *xlat, const unsigned int val, const char *dflt)
+printxvals(const unsigned int val, const char *dflt, const struct xlat *xlat, ...)
{
- const char *str = xlookup(xlat, val);
+ va_list args;
- if (str)
- tprints(str);
- else
- tprintf("%#x /* %s */", val, dflt);
+ va_start(args, xlat);
+ for (; xlat; xlat = va_arg(args, const struct xlat *)) {
+ const char *str = xlookup(xlat, val);
+
+ if (str) {
+ tprints(str);
+ va_end(args);
+ return;
+ }
+ }
+ /* No hits -- print raw # instead. */
+ tprintf("%#x /* %s */", val, dflt);
+
+ va_end(args);
}
/*
--- /dev/null
+/*
+ * Options specific to getsockopt(SOL_IP).
+ * Common {g,s}etsockopt(SOL_IP) options
+ * should be in sockipoptions.in instead.
+ */
+
+ARPT_SO_GET_INFO
+ARPT_SO_GET_ENTRIES
+ARPT_SO_GET_REVISION_MATCH
+ARPT_SO_GET_REVISION_TARGET
+
+EBT_SO_GET_INFO
+EBT_SO_GET_ENTRIES
+EBT_SO_GET_INIT_INFO
+EBT_SO_GET_INIT_ENTRIES
+
+IP_VS_SO_GET_VERSION
+IP_VS_SO_GET_INFO
+IP_VS_SO_GET_SERVICES
+IP_VS_SO_GET_SERVICE
+IP_VS_SO_GET_DESTS
+IP_VS_SO_GET_DEST
+IP_VS_SO_GET_TIMEOUT
+IP_VS_SO_GET_DAEMON
+
+IPT_SO_GET_INFO
+IPT_SO_GET_ENTRIES
+IPT_SO_GET_REVISION_MATCH
+IPT_SO_GET_REVISION_TARGET
--- /dev/null
+/*
+ * Options specific to getsockopt(SOL_IPV6).
+ * Common {g,s}etsockopt(SOL_IPV6) options
+ * should be in sockipv6options.in instead.
+ */
+
+IP6T_SO_GET_INFO
+IP6T_SO_GET_ENTRIES
+IP6T_SO_GET_REVISION_MATCH
+IP6T_SO_GET_REVISION_TARGET
--- /dev/null
+/*
+ * Options specific to setsockopt(SOL_IP).
+ * Common {g,s}etsockopt(SOL_IP) options
+ * should be in sockipoptions.in instead.
+ */
+
+ARPT_SO_SET_REPLACE
+ARPT_SO_SET_ADD_COUNTERS
+
+EBT_SO_SET_ENTRIES
+EBT_SO_SET_COUNTERS
+
+IP_VS_SO_SET_NONE
+IP_VS_SO_SET_INSERT
+IP_VS_SO_SET_ADD
+IP_VS_SO_SET_EDIT
+IP_VS_SO_SET_DEL
+IP_VS_SO_SET_FLUSH
+IP_VS_SO_SET_LIST
+IP_VS_SO_SET_ADDDEST
+IP_VS_SO_SET_DELDEST
+IP_VS_SO_SET_EDITDEST
+IP_VS_SO_SET_TIMEOUT
+IP_VS_SO_SET_STARTDAEMON
+IP_VS_SO_SET_STOPDAEMON
+IP_VS_SO_SET_RESTORE
+IP_VS_SO_SET_SAVE
+IP_VS_SO_SET_ZERO
+
+IPT_SO_SET_REPLACE
+IPT_SO_SET_ADD_COUNTERS
--- /dev/null
+/*
+ * Options specific to setsockopt(SOL_IPV6).
+ * Common {g,s}etsockopt(SOL_IPV6) options
+ * should be in sockipv6options.in instead.
+ */
+
+IP6T_SO_SET_REPLACE
+IP6T_SO_SET_ADD_COUNTERS