2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
6 * Copyright (c) 1999-2018 The strace developers.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include "print_fields.h"
36 #include <sys/socket.h>
39 #include <netinet/in.h>
40 #ifdef HAVE_NETINET_TCP_H
41 # include <netinet/tcp.h>
43 #ifdef HAVE_NETINET_UDP_H
44 # include <netinet/udp.h>
46 #ifdef HAVE_NETINET_SCTP_H
47 # include <netinet/sctp.h>
49 #include <arpa/inet.h>
51 #include <asm/types.h>
52 #ifdef HAVE_NETIPX_IPX_H
53 # include <netipx/ipx.h>
55 # include <linux/ipx.h>
58 #if defined(HAVE_LINUX_IP_VS_H)
59 # include <linux/ip_vs.h>
62 #if defined(HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H)
63 # include <linux/netfilter_arp/arp_tables.h>
65 #if defined(HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H)
66 # include <linux/netfilter_bridge/ebtables.h>
68 #if defined(HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H)
69 # include <linux/netfilter_ipv4/ip_tables.h>
71 #if defined(HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H)
72 # include <linux/netfilter_ipv6/ip6_tables.h>
74 #include <linux/if_packet.h>
75 #include <linux/icmp.h>
77 #include "xlat/socktypes.h"
78 #include "xlat/sock_type_flags.h"
79 #ifndef SOCK_TYPE_MASK
80 # define SOCK_TYPE_MASK 0xf
83 #include "xlat/socketlayers.h"
85 #include "xlat/inet_protocols.h"
87 #define XLAT_MACROS_ONLY
88 # include "xlat/addrfams.h"
89 #undef XLAT_MACROS_ONLY
90 #include "xlat/irda_protocols.h"
91 #include "xlat/can_protocols.h"
92 #include "xlat/bt_protocols.h"
93 #include "xlat/isdn_protocols.h"
94 #include "xlat/phonet_protocols.h"
95 #include "xlat/caif_protocols.h"
96 #include "xlat/nfc_protocols.h"
97 #include "xlat/kcm_protocols.h"
98 #include "xlat/smc_protocols.h"
101 decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
102 const kernel_ulong_t addrlen)
105 switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) {
106 case SOCK_PROTO_NETLINK:
107 decode_netlink(tcp, fd, addr, addrlen);
110 printstrn(tcp, addr, addrlen);
115 * low bits of the socket type define real socket type,
116 * other bits are socket type flags.
119 tprint_sock_type(unsigned int flags)
121 const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
124 print_xlat_ex(flags & SOCK_TYPE_MASK, str, XLAT_STYLE_DEFAULT);
125 flags &= ~SOCK_TYPE_MASK;
130 printflags(sock_type_flags, flags, "SOCK_???");
135 printxval(addrfams, tcp->u_arg[0], "AF_???");
137 tprint_sock_type(tcp->u_arg[1]);
139 switch (tcp->u_arg[0]) {
142 printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
146 printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
150 printxval_index(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
154 printxval_index(can_protocols, tcp->u_arg[2], "CAN_???");
158 printxval_index(bt_protocols, tcp->u_arg[2], "BTPROTO_???");
162 printxval(addrfams, tcp->u_arg[2], "AF_???");
166 printxval(isdn_protocols, tcp->u_arg[2], "ISDN_P_???");
170 printxval_index(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???");
174 printxval_index(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???");
178 printxval_index(nfc_protocols, tcp->u_arg[2],
179 "NFC_SOCKPROTO_???");
183 printxval_index(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???");
187 printxval_index(smc_protocols, tcp->u_arg[2], "SMCPROTO_???");
191 tprintf("%" PRI_klu, tcp->u_arg[2]);
195 return RVAL_DECODED | RVAL_FD;
199 fetch_socklen(struct tcb *const tcp, int *const plen,
200 const kernel_ulong_t sockaddr, const kernel_ulong_t socklen)
202 return verbose(tcp) && sockaddr && socklen
203 && umove(tcp, socklen, plen) == 0;
207 decode_sockname(struct tcb *tcp)
212 printfd(tcp, tcp->u_arg[0]);
214 if (fetch_socklen(tcp, &ulen, tcp->u_arg[1], tcp->u_arg[2])) {
215 set_tcb_priv_ulong(tcp, ulen);
218 printaddr(tcp->u_arg[1]);
220 printaddr(tcp->u_arg[2]);
225 ulen = get_tcb_priv_ulong(tcp);
227 if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &rlen) < 0) {
228 printaddr(tcp->u_arg[1]);
229 tprintf(", [%d]", ulen);
231 decode_sockaddr(tcp, tcp->u_arg[1], ulen > rlen ? rlen : ulen);
233 tprintf(", [%d->%d]", ulen, rlen);
235 tprintf(", [%d]", rlen);
243 return decode_sockname(tcp) | RVAL_FD;
248 int rc = decode_sockname(tcp);
250 if (rc & RVAL_DECODED) {
252 printflags(sock_type_flags, tcp->u_arg[3], "SOCK_???");
260 printfd(tcp, tcp->u_arg[0]);
262 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
263 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
265 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
272 printfd(tcp, tcp->u_arg[0]);
274 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
275 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
277 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
279 const int addrlen = tcp->u_arg[5];
281 decode_sockaddr(tcp, tcp->u_arg[4], addrlen);
283 tprintf(", %d", addrlen);
291 printfd(tcp, tcp->u_arg[0]);
295 printaddr(tcp->u_arg[1]);
297 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
301 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
302 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
312 printfd(tcp, tcp->u_arg[0]);
314 if (fetch_socklen(tcp, &ulen, tcp->u_arg[4], tcp->u_arg[5])) {
315 set_tcb_priv_ulong(tcp, ulen);
320 printaddr(tcp->u_arg[1]);
322 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
326 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
328 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
331 ulen = get_tcb_priv_ulong(tcp);
333 if (!fetch_socklen(tcp, &rlen, tcp->u_arg[4], tcp->u_arg[5])) {
335 printaddr(tcp->u_arg[4]);
338 printaddr(tcp->u_arg[5]);
343 printaddr(tcp->u_arg[4]);
345 tprintf(", [%d]", ulen);
349 decode_sockaddr(tcp, tcp->u_arg[4], ulen > rlen ? rlen : ulen);
352 tprintf(", [%d->%d]", ulen, rlen);
354 tprintf(", [%d]", rlen);
359 SYS_FUNC(getsockname)
361 return decode_sockname(tcp);
365 printpair_fd(struct tcb *tcp, const int i0, const int i1)
375 decode_pair_fd(struct tcb *const tcp, const kernel_ulong_t addr)
379 if (umove_or_printaddr(tcp, addr, &pair))
382 printpair_fd(tcp, pair[0], pair[1]);
386 do_pipe(struct tcb *tcp, int flags_arg)
389 decode_pair_fd(tcp, tcp->u_arg[0]);
390 if (flags_arg >= 0) {
392 printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
400 #if HAVE_ARCH_GETRVAL2
401 if (exiting(tcp) && !syserror(tcp))
402 printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
405 return do_pipe(tcp, -1);
411 return do_pipe(tcp, 1);
417 printxval(addrfams, tcp->u_arg[0], "AF_???");
419 tprint_sock_type(tcp->u_arg[1]);
420 tprintf(", %" PRI_klu, tcp->u_arg[2]);
423 decode_pair_fd(tcp, tcp->u_arg[3]);
428 #include "xlat/sock_options.h"
429 #include "xlat/getsock_options.h"
430 #include "xlat/setsock_options.h"
431 #include "xlat/sock_ip_options.h"
432 #include "xlat/getsock_ip_options.h"
433 #include "xlat/setsock_ip_options.h"
434 #include "xlat/sock_ipv6_options.h"
435 #include "xlat/getsock_ipv6_options.h"
436 #include "xlat/setsock_ipv6_options.h"
437 #include "xlat/sock_ipx_options.h"
438 #include "xlat/sock_netlink_options.h"
439 #include "xlat/sock_packet_options.h"
440 #include "xlat/sock_raw_options.h"
441 #include "xlat/sock_sctp_options.h"
442 #include "xlat/sock_tcp_options.h"
443 #include "xlat/sock_udp_options.h"
444 #include "xlat/sock_irda_options.h"
445 #include "xlat/sock_llc_options.h"
446 #include "xlat/sock_dccp_options.h"
447 #include "xlat/sock_tipc_options.h"
448 #include "xlat/sock_rxrpc_options.h"
449 #include "xlat/sock_pppol2tp_options.h"
450 #include "xlat/sock_bluetooth_options.h"
451 #include "xlat/sock_pnp_options.h"
452 #include "xlat/sock_rds_options.h"
453 #include "xlat/sock_iucv_options.h"
454 #include "xlat/sock_caif_options.h"
455 #include "xlat/sock_alg_options.h"
456 #include "xlat/sock_nfcllcp_options.h"
457 #include "xlat/sock_kcm_options.h"
458 #include "xlat/sock_tls_options.h"
461 print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
462 unsigned int name, bool is_getsockopt)
466 printxval_search(socketlayers, level, "SOL_??");
471 printxvals(name, "SO_???", sock_options,
472 is_getsockopt ? getsock_options :
473 setsock_options, NULL);
476 printxvals(name, "IP_???", sock_ip_options,
477 is_getsockopt ? getsock_ip_options :
478 setsock_ip_options, NULL);
481 printxvals(name, "IPV6_???", sock_ipv6_options,
482 is_getsockopt ? getsock_ipv6_options :
483 setsock_ipv6_options, NULL);
486 printxval(sock_ipx_options, name, "IPX_???");
489 printxval(sock_packet_options, name, "PACKET_???");
492 printxval(sock_tcp_options, name, "TCP_???");
495 printxval(sock_sctp_options, name, "SCTP_???");
498 printxval(sock_raw_options, name, "RAW_???");
501 printxval(sock_netlink_options, name, "NETLINK_???");
504 printxval(sock_udp_options, name, "UDP_???");
507 printxval_index(sock_irda_options, name, "IRLMP_???");
510 printxval_index(sock_llc_options, name, "LLC_OPT_???");
513 printxval_search(sock_dccp_options, name, "DCCP_SOCKOPT_???");
516 printxval_search(sock_tipc_options, name, "TIPC_???");
519 printxval_index(sock_rxrpc_options, name, "RXRPC_???");
522 printxval_index(sock_pppol2tp_options, name, "PPPOL2TP_SO_???");
525 printxval_search(sock_bluetooth_options, name, "BT_???");
528 printxval(sock_pnp_options, name, "PNPIPE_???");
531 printxval_search(sock_rds_options, name, "RDS_???");
534 printxval(sock_iucv_options, name, "SO_???");
537 printxval(sock_caif_options, name, "CAIFSO_???");
540 printxval_index(sock_alg_options, name, "ALG_???");
543 printxval_index(sock_nfcllcp_options, name, "NFC_LLCP_???");
546 printxval(sock_kcm_options, name, "KCM_???");
549 printxval(sock_tls_options, name, "TLS_???");
552 /* Other SOL_* protocol levels still need work. */
562 print_set_linger(struct tcb *const tcp, const kernel_ulong_t addr,
565 struct linger linger;
567 if (len < (int) sizeof(linger)) {
569 } else if (!umove_or_printaddr(tcp, addr, &linger)) {
570 PRINT_FIELD_D("{", linger, l_onoff);
571 PRINT_FIELD_D(", ", linger, l_linger);
577 print_get_linger(struct tcb *const tcp, const kernel_ulong_t addr,
580 struct linger linger;
582 if (len < sizeof(linger)) {
583 if (len != sizeof(linger.l_onoff)) {
584 printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
588 len = sizeof(linger);
591 if (umoven(tcp, addr, len, &linger) < 0) {
596 PRINT_FIELD_D("{", linger, l_onoff);
597 if (len == sizeof(linger))
598 PRINT_FIELD_D(", ", linger, l_linger);
604 print_ucred(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int len)
608 if (len < sizeof(uc)) {
609 if (len != sizeof(uc.pid)
610 && len != offsetofend(struct ucred, uid)) {
611 printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
618 if (umoven(tcp, addr, len, &uc) < 0) {
623 PRINT_FIELD_D("{", uc, pid);
624 if (len > sizeof(uc.pid))
625 PRINT_FIELD_UID(", ", uc, uid);
626 if (len == sizeof(uc))
627 PRINT_FIELD_UID(", ", uc, gid);
630 #endif /* SO_PEERCRED */
632 #ifdef PACKET_STATISTICS
634 print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr,
637 struct tpacket_stats stats;
639 if (len != sizeof(stats) ||
640 umove(tcp, addr, &stats) < 0) {
643 PRINT_FIELD_U("{", stats, tp_packets);
644 PRINT_FIELD_U("{", stats, tp_drops);
648 #endif /* PACKET_STATISTICS */
650 #include "xlat/icmpfilterflags.h"
653 print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len)
655 struct icmp_filter filter = {};
657 if (len > (int) sizeof(filter))
658 len = sizeof(filter);
664 if (umoven_or_printaddr(tcp, addr, len, &filter))
668 printflags(icmpfilterflags, ~filter.data, "ICMP_???");
673 print_uint32(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
675 tprintf("%u", *(uint32_t *) elem_buf);
681 print_getsockopt(struct tcb *const tcp, const unsigned int level,
682 const unsigned int name, const kernel_ulong_t addr,
683 const int ulen, const int rlen)
685 if (addr && verbose(tcp))
690 print_get_linger(tcp, addr, rlen);
694 print_ucred(tcp, addr, rlen);
697 #ifdef SO_ATTACH_FILTER
698 case SO_ATTACH_FILTER:
699 if (rlen && (unsigned short) rlen == (unsigned int) rlen)
700 print_sock_fprog(tcp, addr, rlen);
704 #endif /* SO_ATTACH_FILTER */
710 #ifdef PACKET_STATISTICS
711 case PACKET_STATISTICS:
712 print_tpacket_stats(tcp, addr, rlen);
721 print_icmp_filter(tcp, addr, rlen);
727 if (ulen < 0 || rlen < 0) {
729 * As the kernel neither accepts nor returns a negative
730 * length, in case of successful getsockopt syscall
731 * invocation these negative values must have come
738 case NETLINK_LIST_MEMBERSHIPS: {
740 print_array(tcp, addr, MIN(ulen, rlen) / sizeof(buf),
742 umoven_or_printaddr, print_uint32, 0);
746 printnum_int(tcp, addr, "%d");
752 /* default arg printing */
755 if (rlen == sizeof(int)) {
756 printnum_int(tcp, addr, "%d");
758 printstrn(tcp, addr, rlen);
770 print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
771 tcp->u_arg[1], tcp->u_arg[2], true);
773 if (verbose(tcp) && tcp->u_arg[4]
774 && umove(tcp, tcp->u_arg[4], &ulen) == 0) {
775 set_tcb_priv_ulong(tcp, ulen);
778 printaddr(tcp->u_arg[3]);
780 printaddr(tcp->u_arg[4]);
784 ulen = get_tcb_priv_ulong(tcp);
786 if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) {
787 printaddr(tcp->u_arg[3]);
788 tprintf(", [%d]", ulen);
790 print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
791 tcp->u_arg[3], ulen, rlen);
793 tprintf(", [%d->%d]", ulen, rlen);
795 tprintf(", [%d]", rlen);
801 #ifdef IP_ADD_MEMBERSHIP
803 print_mreq(struct tcb *const tcp, const kernel_ulong_t addr,
808 if (len < (int) sizeof(mreq)) {
810 } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
811 PRINT_FIELD_INET4_ADDR("{", mreq, imr_multiaddr);
812 PRINT_FIELD_INET4_ADDR(", ", mreq, imr_interface);
816 #endif /* IP_ADD_MEMBERSHIP */
818 #ifdef IPV6_ADD_MEMBERSHIP
820 print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr,
823 struct ipv6_mreq mreq;
825 if (len < (int) sizeof(mreq)) {
827 } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
828 PRINT_FIELD_INET_ADDR("{", mreq, ipv6mr_multiaddr, AF_INET6);
829 PRINT_FIELD_IFINDEX(", ", mreq, ipv6mr_interface);
833 #endif /* IPV6_ADD_MEMBERSHIP */
835 #ifdef PACKET_RX_RING
837 print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
839 struct tpacket_req req;
841 if (len != sizeof(req) ||
842 umove(tcp, addr, &req) < 0) {
845 PRINT_FIELD_U("{", req, tp_block_size);
846 PRINT_FIELD_U(", ", req, tp_block_nr);
847 PRINT_FIELD_U(", ", req, tp_frame_size);
848 PRINT_FIELD_U(", ", req, tp_frame_nr);
852 #endif /* PACKET_RX_RING */
854 #ifdef PACKET_ADD_MEMBERSHIP
855 # include "xlat/packet_mreq_type.h"
858 print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
860 struct packet_mreq mreq;
862 if (len != sizeof(mreq) ||
863 umove(tcp, addr, &mreq) < 0) {
868 PRINT_FIELD_IFINDEX("{", mreq, mr_ifindex);
869 PRINT_FIELD_XVAL(", ", mreq, mr_type, packet_mreq_type,
871 PRINT_FIELD_U(", ", mreq, mr_alen);
872 tprints(", mr_address=");
873 if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address))
874 mreq.mr_alen = ARRAY_SIZE(mreq.mr_address);
875 for (i = 0; i < mreq.mr_alen; ++i)
876 tprintf("%02x", mreq.mr_address[i]);
880 #endif /* PACKET_ADD_MEMBERSHIP */
883 print_setsockopt(struct tcb *const tcp, const unsigned int level,
884 const unsigned int name, const kernel_ulong_t addr,
887 if (addr && verbose(tcp))
892 print_set_linger(tcp, addr, len);
894 #ifdef SO_ATTACH_FILTER
895 case SO_ATTACH_FILTER:
896 # ifdef SO_ATTACH_REUSEPORT_CBPF
897 case SO_ATTACH_REUSEPORT_CBPF:
899 if ((unsigned int) len == get_sock_fprog_size())
900 decode_sock_fprog(tcp, addr);
904 #endif /* SO_ATTACH_FILTER */
910 #ifdef IP_ADD_MEMBERSHIP
911 case IP_ADD_MEMBERSHIP:
912 case IP_DROP_MEMBERSHIP:
913 print_mreq(tcp, addr, len);
915 #endif /* IP_ADD_MEMBERSHIP */
916 #ifdef MCAST_JOIN_GROUP
917 case MCAST_JOIN_GROUP:
918 case MCAST_LEAVE_GROUP:
919 print_group_req(tcp, addr, len);
921 #endif /* MCAST_JOIN_GROUP */
927 #ifdef IPV6_ADD_MEMBERSHIP
928 case IPV6_ADD_MEMBERSHIP:
929 case IPV6_DROP_MEMBERSHIP:
930 # ifdef IPV6_JOIN_ANYCAST
931 case IPV6_JOIN_ANYCAST:
933 # ifdef IPV6_LEAVE_ANYCAST
934 case IPV6_LEAVE_ANYCAST:
936 print_mreq6(tcp, addr, len);
938 #endif /* IPV6_ADD_MEMBERSHIP */
939 #ifdef MCAST_JOIN_GROUP
940 case MCAST_JOIN_GROUP:
941 case MCAST_LEAVE_GROUP:
942 print_group_req(tcp, addr, len);
944 #endif /* MCAST_JOIN_GROUP */
950 #ifdef PACKET_RX_RING
952 # ifdef PACKET_TX_RING
955 print_tpacket_req(tcp, addr, len);
957 #endif /* PACKET_RX_RING */
958 #ifdef PACKET_ADD_MEMBERSHIP
959 case PACKET_ADD_MEMBERSHIP:
960 case PACKET_DROP_MEMBERSHIP:
961 print_packet_mreq(tcp, addr, len);
963 #endif /* PACKET_ADD_MEMBERSHIP */
970 print_icmp_filter(tcp, addr, len);
976 if (len < (int) sizeof(int))
979 printnum_int(tcp, addr, "%d");
983 /* default arg printing */
986 if (len == sizeof(int)) {
987 printnum_int(tcp, addr, "%d");
989 printstrn(tcp, addr, len);
998 print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
999 tcp->u_arg[1], tcp->u_arg[2], false);
1000 print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
1001 tcp->u_arg[3], tcp->u_arg[4]);
1002 tprintf(", %d", (int) tcp->u_arg[4]);
1004 return RVAL_DECODED;