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.
8 files changed
tree: dd72a9b65c90ef2b00086fb218d6a9cabf0d4745
  1. debian/
  2. linux/
  3. m4/
  4. maint/
  5. qemu_multiarch_testing/
  6. test/
  7. tests/
  8. xlat/
  9. .gitignore
  10. .mailmap
  11. access.c
  12. affinity.c
  13. aio.c
  14. AUTHORS
  15. bjm.c
  16. block.c
  17. bootstrap
  18. bpf.c
  19. build_static_example.sh
  20. cacheflush.c
  21. capability.c
  22. caps0.h
  23. caps1.h
  24. ChangeLog-CVS
  25. chdir.c
  26. chmod.c
  27. clone.c
  28. configure.ac
  29. COPYING
  30. count.c
  31. CREDITS.in
  32. defs.h
  33. desc.c
  34. dirent.c
  35. epoll.c
  36. errnoent.sh
  37. evdev.c
  38. eventfd.c
  39. execve.c
  40. exit.c
  41. fadvise.c
  42. fallocate.c
  43. fanotify.c
  44. fchownat.c
  45. file.c
  46. futex.c
  47. generate_sen.sh
  48. generate_xlat_in.sh
  49. get_robust_list.c
  50. getcpu.c
  51. getcwd.c
  52. getrandom.c
  53. git-set-file-times
  54. git-version-gen
  55. gitlog-to-changelog
  56. HACKING-scripts
  57. hostname.c
  58. inotify.c
  59. INSTALL
  60. io.c
  61. ioctl.c
  62. ioctlsort.c
  63. ioprio.c
  64. ipc_defs.h
  65. ipc_msg.c
  66. ipc_msgctl.c
  67. ipc_sem.c
  68. ipc_shm.c
  69. ipc_shmctl.c
  70. kexec.c
  71. keyctl.c
  72. ldt.c
  73. link.c
  74. loop.c
  75. lseek.c
  76. make-dist
  77. Makefile.am
  78. mem.c
  79. memfd_create.c
  80. mknod.c
  81. mount.c
  82. mq.c
  83. mtd.c
  84. net.c
  85. NEWS
  86. open.c
  87. or1k_atomic.c
  88. pathtrace.c
  89. perf.c
  90. personality.c
  91. poll.c
  92. prctl.c
  93. print_mq_attr.c
  94. print_msgbuf.c
  95. printmode.c
  96. printrusage.c
  97. printsiginfo.c
  98. printsiginfo.h
  99. printstat.h
  100. process.c
  101. process_vm.c
  102. ptp.c
  103. ptrace.h
  104. quota.c
  105. readahead.c
  106. readlink.c
  107. README
  108. README-hacking
  109. README-linux-ptrace
  110. reboot.c
  111. regs.h
  112. renameat.c
  113. resource.c
  114. rtc.c
  115. sched.c
  116. scsi.c
  117. seccomp.c
  118. sendfile.c
  119. sigaltstack.c
  120. signal.c
  121. signalent.sh
  122. signalfd.c
  123. sigreturn.c
  124. sock.c
  125. socketutils.c
  126. sram_alloc.c
  127. statfs.c
  128. strace-graph
  129. strace-log-merge
  130. strace.1
  131. strace.c
  132. strace.spec
  133. stream.c
  134. swapon.c
  135. sync_file_range.c
  136. syscall.c
  137. syscallent.sh
  138. sysctl.c
  139. sysinfo.c
  140. syslog.c
  141. sysmips.c
  142. term.c
  143. time.c
  144. times.c
  145. truncate.c
  146. uid.c
  147. uid16.c
  148. umask.c
  149. umount.c
  150. uname.c
  151. unwind.c
  152. util.c
  153. utime.c
  154. utimes.c
  155. v4l2.c
  156. vsprintf.c
  157. wait.c
  158. xattr.c
  159. xlate.el
  160. xmalloc.c