summaryrefslogtreecommitdiff
path: root/net.c
Commit message (Collapse)AuthorAge
* Decode protocol argument for PF_NETLINK socketsMasatake YAMATO2014-03-11
| | | | | | | | | | | * net.c (protocols): Rename to inet_protocols. [PF_NETLINK] (netlink_protocols): New xlat structure. (sys_socket): Rename protocols to inet_protocols. [PF_NETLINK]: Decode protocol argument using netlink_protocols. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Cleanup socketpair decodingDmitry V. Levin2014-03-11
| | | | | | | | The only supported domain for socketpair syscall is AF_UNIX, so no decoding related to other domains is required for socketpair. * net.c (sys_socketpair): Remove support for PF_INET and PF_IPX domains, print the protocol argument as is.
* Use XLAT_END macroDmitry V. Levin2014-02-05
| | | | | Automatically update all xlat structures using the following sed regexp: s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/
* Use XLAT macroDmitry V. Levin2014-02-05
| | | | | | Automatically convert all xlat structures to XLAT form using the following sed regexp: s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/
* Add decoding of sockets descriptor 'paths' for network callsPhilippe Ombredanne2014-02-02
| | | | | | | | | | | | | | | * net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto, sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg, sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode socket descriptor arguments using printfd. * pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls that take socket descriptor arguments. * tests/net-fd.test: New test for socket descriptor arguments decoding. * tests/Makefile.am (TESTS): Add net-fd.test. (net-fd.log): New dependency on net.log. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* net: add more sockopt optionsMike Frysinger2014-01-31
| | | | | | | | | | | | This syncs with the defines as available in linux-3.13. * net.c (sockipoptions): Add IP_IPSEC_POLICY, IP_XFRM_POLICY, IP_PASSSEC, IP_TRANSPARENT, IP_ORIGDSTADDR, IP_RECVORIGDSTADDR, IP_MINTTL, IP_NODEFRAG, IP_UNBLOCK_SOURCE, IP_BLOCK_SOURCE, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_GROUP, MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IP_MULTICAST_ALL, IP_UNICAST_IF.
* Remove unneeded redefinitions of IPPROTO_* macrosDmitry V. Levin2013-11-12
| | | | | | | | | | IPPROTO_* macros are defined by <netinet/in.h>, no need to redefine them. * net.c (IPPROTO_EGP, IPPROTO_PUP, IPPROTO_IDP, IPPROTO_IGMP, IPPROTO_RAW, IPPROTO_MAX): Remove. Reported by John Spencer.
* Remove unused codeDmitry V. Levin2013-11-12
| | | | | | * configure.ac (AC_CHECK_TYPES): Remove struct opthdr and struct t_opthdr. * net.c (print_sock_optmgmt): Remove.
* Update AF_*, PF_*, MSG_*, and TCP_* constantsDmitry V. Levin2013-05-17
| | | | | * net.c (domains, addrfams, protocols, socktcpoptions): Sync with Linux 3.9.
* Handle recv[m]msg for non-native 32-bit personality syscallsDenys Vlasenko2013-02-12
| | | | | | | | * net.c (printmsghdr): If current_wordsize is 4 and long is wider than it, read 32-bit struct msghdr and expand it into a native one before using it. (printmmsghdr): Likewise for struct mmsghdr. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* If we are on a glibc system, assume it's at least glibc 2.1Denys Vlasenko2013-02-08
| | | | | | | | | | | It is not likely anyone uses glibc older that that: glibc 2.1.1 was released in 1999 * net.c: Remove test for glibc >= 2.1. * signal.c: Remove code which is compiled only for glibc < 2.1. * util.c: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix recvmmsg decode: do not show more data than actually returnedDmitry V. Levin2012-05-01
| | | | | | | | | | This change complements recent fix for recvmsg decoding. * net.c (printmmsghdr): Add msg_len parameter to pass down to do_msghdr. When this parameter is zero, pass mmsghdr.msg_len to do_msghdr instead. (decode_mmsg): Add msg_len parameter, pass it down to printmmsghdr. (sys_sendmmsg): Call decode_mmsg with msg_len == (unsigned long) -1L. (sys_recvmmsg): Call decode_mmsg with msg_len == 0.
* Remove recently introduced use of ULONG_MAXDmitry V. Levin2012-05-01
| | | | | | | | * io.c: Remove limits.h inclusion. (tprint_iov): Use "(unsigned long) -1L" instead of "ULONG_MAX". * net.c: Remove limits.h inclusion. (printmmsghdr, sys_sendmsg): Use "(unsigned long) -1L" instead of "ULONG_MAX".
* Fix recvmsg decode: do not show more data than actually returnedDenys Vlasenko2012-04-28
| | | | | | | | | | | | | | | | | I noticed that "hostname -d" talks over netlink and gets 20 bytes of response, but we show entire 1024 bytes of iov. This changes fixes that. * defs.h: New function tprint_iov_upto. * io.c (tprint_iov_upto): Definition of this function. (tprint_iov): Call tprint_iov_upto. * net.c (do_msghdr): Add data_size parameter, pass it down to tprint_iov_upto. (printmsghdr): Add data_size parameter, pass it down to do_msghdr. (printmmsghdr): Call do_msghdr with data_size==ULONG_MAX. (sys_sendmsg): Call printmsghdr with data_size==ULONG_MAX. (sys_recvmsg): Call printmsghdr with data_size==tcp->u_rval. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Reindent case labels. No code changesDenys Vlasenko2012-03-17
| | | | | | | * net.c (printsockopt): Reindent case labels. * signal.c (sys_signal): Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Tidy up includes and copyright notices, fix indentationDenys Vlasenko2012-03-16
| | | | | | | | | | | | | | | The files not mentioned in changelog below had only copyright notices fixes and indentation fixes. * defs.h: Include <stdint.h> and <inttypes.h>. * file.c: Do not include <inttypes.h>. Move struct kernel_dirent declaration below top include block. * block.c: Do not include <stdint.h> and <inttypes.h>. * quota.c: Likewise. * desc.c: Likewise. * signal.c: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* net.c: recognize MSG_WAITFORONEDmitry V. Levin2012-03-13
| | | | * net.c (msg_flags): Add MSG_WAITFORONE.
* Implement sendmmsg syscall decoderDmitry V. Levin2012-03-11
| | | | | | | | | | | * linux/dummy.h (sys_sendmmsg): Remove. * linux/syscall.h (sys_sendmmsg): New prototype. * net.c (printmmsghdr): Add index argument specifying the element in mmsghdr array to print. (decode_mmsg): New function, prints the whole mmsghdr array, its length and message flags. (sys_sendmmsg): New function. (sys_recvmmsg): Use decode_mmsg to fix mmsghdr array decoding.
* Style fixes, no code changesDenys Vlasenko2012-02-27
| | | | | | | | | | | * desc.c (sys_io_getevents): Indentation fix. * file.c (sys_xstat): Remove space after function name. (decode_mknod): Indentation fix. * net.c (printsockopt): Indentation fix. * process.c (unalignctl_string): Indentation fix. (sys_sched_getscheduler): Remove space after ! operator. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Compress blank linesDmitry V. Levin2012-02-25
| | | | | | Suppress repeated empty lines left after automated code removal. This change was made by filtering every source code file through "cat -s".
* Build fixes after non-Linux code removalDenys Vlasenko2012-02-25
| | | | | | | | | | | | | | * configure.ac: Remove calls to proc-based ptrace checks. * proc.c: Remove, it's empty now. * Makefile.am: Remove reference to proc.c. * net.c: Remove trailing newlines. * quota.c: Likewise * resource.c: Likewise * strace.c: Likewise * stream.c: Likewise * time.c: Likewise Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix defined(FOO) styleDenys Vlasenko2012-02-25
| | | | | | | | | | | * file.c: Consistently use defined(FOO) instead of defined (FOO). * mem.c: Likewise. * net.c: Likewise. * signal.c: Likewise. * sock.c: Likewise. * linux/mips/syscallent.h: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Cleanup after non-Linux code removal.Denys Vlasenko2012-02-25
| | | | | | | | | Conditions such as defined(LINUX) are always true now, defined(FREEBSD) etc are always false. When if directive has them as subexpressions, it can be simplified. Another trivial changes here are fixes for directive indentation. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Automated removal of non-Linux codeDenys Vlasenko2012-02-25
| | | | | | | | | | This change is generated by running every source through the following command: unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD -USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS -UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix sockaddr_un.sun_path name in decoded outputDmitry V. Levin2012-02-22
| | | | | * net.c (printsock): Show sockaddr_un.sun_path as "sun_path". This fixes Debian bug #554946.
* Eliminate code duplication in time printing, reduce a few static buffersDenys Vlasenko2012-01-20
| | | | | | | | | | | | | | | | | | | | | | text data bss dec hex filename 238454 664 28772 267890 41672 strace.before 238106 664 28676 267446 414b6 strace * defs.h: Add TIMESPEC_TEXT_BUFSIZE and TIMEVAL_TEXT_BUFSIZE defines. Add 'int special' parameter to sprinttv(). * time.c (sprinttv): Add 'int special' parameter, and use it similarly to 'int special' parameter of printtv_bitness(). (printtv_bitness): Use sprinttv() instead of duplicating its code. (print_timespec): Use sprint_timespec() instead of duplicating its code. * desc.c (decode_select): Use TIMEVAL_TEXT_BUFSIZE instead of 128 when checking remaining buffer size. * net.c (sys_recvmsg): Use TIMESPEC_TEXT_BUFSIZE instead of 128 for static buffer size. * stream.c (decode_poll): Use TIMESPEC_TEXT_BUFSIZE instead of 128 when checking remaining buffer size. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* * net.c (socktcpoptions): Add more TCP_* constants from linux/tcp.hDmitry V. Levin2011-12-01
| | | | Reported-by: Rick Jones <rick.jones2@hp.com>
* Use tprints with literal strings, it may be faster than tprintfDenys Vlasenko2011-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | * bjm.c: Replace tprintf("str") with tprints("str"). * block.c: Likewise. * desc.c: Likewise. * file.c: Likewise. * io.c: Likewise. * ipc.c: Likewise. * mem.c: Likewise. * net.c: Likewise. * proc.c: Likewise. * process.c: Likewise. * quota.c: Likewise. * resource.c: Likewise. * scsi.c: Likewise. * signal.c: Likewise. * sock.c: Likewise. * strace.c: Likewise. * stream.c: Likewise. * syscall.c: Likewise. * system.c: Likewise. * term.c: Likewise. * time.c: Likewise. * util.c: Likewise. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fix "format not a string literal" warning caused by tprintf(str)Denys Vlasenko2011-09-01
| | | | | | | | | | | | | | | | * defs.h: Declare tprints(). * strace.c: Define tprints(). (tabto): Use tprints(str), since tprintf(str) was throwing a warning. * desc.c: Use tprints(str) instead of tprintf("%s", str). * file.c: Likewise. * io.c: Likewise. * net.c: Likewise. * process.c: Likewise. * signal.c: Likewise. * syscall.c: Likewise. * util.c: Likewise. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Whitespace cleanups. No code changes.Denys Vlasenko2011-06-22
| | | | | | | | | | | | | | | | | | * count.c: Place opening curly brace after if (), not on the next line. Almost all strace code alredy uses this style. * desc.c: Likewise. * file.c: Likewise. * net.c: Likewise. * pathtrace.c: Likewise. * process.c: Likewise. * quota.c: Likewise. * signal.c: Likewise. * strace.c: Likewise. * syscall.c: Likewise. * time.c: Likewise. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Add argument to tprint_iov() specifying whether to decode each iovecDmitry V. Levin2011-06-13
| | | | | | | | * defs.h (tprint_iov): Add decode_iov argument. * io.c (tprint_iov): Implement new decode_iov argument. (sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update tprint_iov calls. * net.c (do_msghdr): Likewise.
* Whitespace cleanups. no code changes.Denys Vlasenko2011-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bjm.c: Fix tabulation (such as extra spaces before tabs), convert punctuation where it deviates from prevalent form elsewhere in strace code, convert sizeof and offsetof where it deviates from from prevalent form, remove space between function/macro/array names and (parameters) or [index], add space between "if" and (condition), correct non-standard or wrong indentaion. * defs.h: Likewise * desc.c: Likewise * file.c: Likewise * ipc.c: Likewise * linux/arm/syscallent.h: Likewise * linux/avr32/syscallent.h: Likewise * linux/hppa/syscallent.h: Likewise * linux/i386/syscallent.h: Likewise * linux/ioctlsort.c: Likewise * linux/m68k/syscallent.h: Likewise * linux/microblaze/syscallent.h: Likewise * linux/powerpc/syscallent.h: Likewise * linux/s390/syscallent.h: Likewise * linux/s390x/syscallent.h: Likewise * linux/sh/syscallent.h: Likewise * linux/sh64/syscallent.h: Likewise * linux/tile/syscallent.h: Likewise * linux/x86_64/syscallent.h: Likewise * mem.c: Likewise * net.c: Likewise * pathtrace.c: Likewise * process.c: Likewise * signal.c: Likewise * sock.c: Likewise * strace.c: Likewise * stream.c: Likewise * sunos4/syscall.h: Likewise * sunos4/syscallent.h: Likewise * svr4/syscall.h: Likewise * svr4/syscallent.h: Likewise * syscall.c: Likewise * system.c: Likewise * test/childthread.c: Likewise * test/leaderkill.c: Likewise * test/skodic.c: Likewise * time.c: Likewise * util.c: Likewise Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* "Modernize" all old-style function parameter declarationsDenys Vlasenko2011-05-30
| | | | | | | | | | | | | | | | | | | | * bjm.c: Convert all remaining old-style C function definitions to a "modern" form. This does not change any actual code. * io.c: Likewise * ioctl.c: Likewise * net.c: Likewise * proc.c: Likewise * process.c: Likewise * signal.c: Likewise * sock.c: Likewise * strace.c: Likewise * stream.c: Likewise * syscall.c: Likewise * system.c: Likewise * time.c: Likewise * util.c: Likewise Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Print shutdown(2) modes as SHUT_* constantsSebastian Pipping2011-03-03
| | | | | * net.c (shutdown_modes): New xlat structure. (sys_shutdown): Use shutdown_modes to decode 2nd syscall argument.
* Fix struct xlat initialization bugsDmitry V. Levin2011-03-03
| | | | | | | * file.c (inotify_modes): Terminate with NULL entry. * net.c (sock_type_flags): Make this array static. (socketlayers): Add a comment that this array should remain not NULL-terminated.
* Parse SOL_SCTP socket optionsHolger Hans Peter Freyther2011-01-14
| | | | | | | * configure.ac (AC_CHECK_HEADERS): Add netinet/sctp.h. * net.c [HAVE_NETINET_SCTP_H]: Include <netinet/sctp.h>. [SOL_SCTP] (socksctpoptions): New xlat structure. (sys_getsockopt, printsockopt): Parse SOL_SCTP options.
* * net.c (socketlayers): Add more SOL_* constants from linux/socket.hHolger Hans Peter Freyther2011-01-14
|
* * net.c (protocols): Add more IPPROTO_* constants defined in netinet/in.hDmitry V. Levin2011-01-10
|
* * net.c (protocols): Add IPPROTO_GRE, IPPROTO_SCTP and IPPROTO_UDPLITE.Holger Hans Peter Freyther2011-01-10
|
* Decode struct ucred for getsockopt SO_PEERCREDDmitry V. Levin2010-12-03
| | | | | * net.c (sys_getsockopt): Decode SO_PEERCRED. Proposed by Arkadiusz Miƛkiewicz <arekm@maven.pl>.
* Enhance recvmmsg parserDmitry V. Levin2010-04-07
| | | | | * net.c (sys_recvmmsg): Decode mmsghdr structure on exit from the syscall. Decode timespec structure both on entrance and on exit.
* Decode recvmmsg syscallAndreas Schwab2010-04-07
| | | | | | | | | | | | | | | | | | | | | * net.c (do_msghr): New function to print struct msghdr. (printmsghdr): Use it. (printmmsghdr, sys_recvmmsg): New. * linux/syscall.h: Declare sys_recvmmsg. (SYS_sub_recvmmsg): Define. (SYS_socket_nsubcalls): Bump. * linux/sparc/syscall.h: Likewise. * linux/arm/syscallent.h: Add sys_recvmmsg. * linux/bfin/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/s390x/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/ia64/syscallent.h: Adjust.
* Remove dead codeDmitry V. Levin2010-02-04
| | | | | | | | | | | | | | * defs.h (tv_tv): Remove. * net.c (sys_xsetsockaddr): Remove commented out dead code. * process.c (setarg, sys_execv, sys_execve, struct_user_offsets): Likewise. * signal.c (sys_sigsuspend): Likewise. * strace.c (reaper, trace): Likewise. * stream.c (internal_stream_ioctl): Likewise. * syscall.c (trace_syscall): Likewise. * term.c (term_ioctl): Likewise. * util.c (tv_tv, umoven, uload, getpc, fixvfork, setbpt, clearbpt): Likewise.
* Decode more SOL_PACKET socket optionsDmitry V. Levin2009-11-13
| | | | | | | * net.c (sockpacketoptions): Add more PACKET_* entries. (sys_getsockopt): Decode PACKET_STATISTICS. (printsockopt): Decode PACKET_RX_RING and PACKET_TX_RING. Patch by Gabor Gombas.
* Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int)Dmitry V. Levin2009-11-06
| | | | | * net.c (sys_getsockopt): Optimize output a bit. Decode integer argument using printnum_int(), patch by Gabor Gombas.
* Replace x86-64 paccept with accept4Paolo Bonzini2009-09-01
| | | | | | | | | | | | This patch changes the paccept syscall to accept4 for x86-64, since the former was dropped in Linux kernel commit v2.6.27-rc7-14-g2d4c826. At the same time, it adds support for pretty printing its arguments. * linux/x86_64/syscallent.h: Replace paccept with accept4, hook in sys_accept4. * net.c (sys_accept): Leave a small stub calling the new... (do_accept): ... function, which also adds a flags_arg argument. (sys_accept4): New.
* * system.c (sram_alloc_flag): Add L2_SRAM constant.Denys Vlasenko2009-03-23
| | | | | | | | by Mike Frysinger (vapier AT gentoo.org). (sys_sram_alloc): Fix improperly used %zu: tcp->u_arg is not a size_t, it is a long. * net.c (printcmsghdr): Fix improperly used %zu: struct cmsghdr::cmsg_len is not a size_t.
* AVR32 support by Hans-Christian EgtvedtDenys Vlasenko2009-02-27
| | | | | | | | | | | | | (hans-christian.egtvedt AT atmel.com). * configure.ac: Make it recognize avr32. * defs.h: Define LINUX_AVR32. * linux/avr32/syscallent.h: New file. * Makefile.am: Reference linux/avr32/syscallent.h. * proc.c (change_syscall, setarg): Add support for avr32. (struct xlat struct_user_offsets[]): Ditto. * syscall.c (get_scno): Ditto. (get_error, force_result, syscall_enter): Ditto. * util.c (getpc, printcall): Ditto.
* Fixes for ptrace() argument parsing.Denys Vlasenko2009-01-13
| | | | | | | | | | | | | | * process.c: Add parsing of PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG, PTRACE_GETSIGINFO, PTRACE_SETSIGINFO. * strace.c (handle_stopped_tcbs): Make PTRACE_SETOPTIONS define check more robust. * defs.h: Declare several "extern const struct xlat" arrays here. * desc.c: Remove open_mode_flags[] and open_access_modes[] extern declarations. * net.c: Remove open_mode_flags[] extern declaration. * sock.c: Remove addrfams[] extern declaration. * util.c: Remove struct_user_offsets[] extern declaration. * signal.c: Remove open_mode_flags[] extern declaration.
* 2009-01-01 Andreas Schwab <schwab@suse.de>Dmitry V. Levin2009-01-01
| | | | | * net.c (sys_accept): Properly decode third argument as pointer to int.