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"
100 const size_t inet_protocols_size = ARRAY_SIZE(inet_protocols) - 1;
103 decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
104 const kernel_ulong_t addrlen)
107 switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) {
108 case SOCK_PROTO_NETLINK:
109 decode_netlink(tcp, fd, addr, addrlen);
112 printstrn(tcp, addr, addrlen);
117 * low bits of the socket type define real socket type,
118 * other bits are socket type flags.
121 tprint_sock_type(unsigned int flags)
123 const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
126 print_xlat_ex(flags & SOCK_TYPE_MASK, str, XLAT_STYLE_DEFAULT);
127 flags &= ~SOCK_TYPE_MASK;
132 printflags(sock_type_flags, flags, "SOCK_???");
137 printxval(addrfams, tcp->u_arg[0], "AF_???");
139 tprint_sock_type(tcp->u_arg[1]);
141 switch (tcp->u_arg[0]) {
144 printxval_search(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
148 printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
152 printxval_index(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
156 printxval_index(can_protocols, tcp->u_arg[2], "CAN_???");
160 printxval_index(bt_protocols, tcp->u_arg[2], "BTPROTO_???");
164 printxval(addrfams, tcp->u_arg[2], "AF_???");
168 printxval(isdn_protocols, tcp->u_arg[2], "ISDN_P_???");
172 printxval_index(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???");
176 printxval_index(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???");
180 printxval_index(nfc_protocols, tcp->u_arg[2],
181 "NFC_SOCKPROTO_???");
185 printxval_index(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???");
189 printxval_index(smc_protocols, tcp->u_arg[2], "SMCPROTO_???");
193 tprintf("%" PRI_klu, tcp->u_arg[2]);
197 return RVAL_DECODED | RVAL_FD;
201 fetch_socklen(struct tcb *const tcp, int *const plen,
202 const kernel_ulong_t sockaddr, const kernel_ulong_t socklen)
204 return verbose(tcp) && sockaddr && socklen
205 && umove(tcp, socklen, plen) == 0;
209 decode_sockname(struct tcb *tcp)
214 printfd(tcp, tcp->u_arg[0]);
216 if (fetch_socklen(tcp, &ulen, tcp->u_arg[1], tcp->u_arg[2])) {
217 set_tcb_priv_ulong(tcp, ulen);
220 printaddr(tcp->u_arg[1]);
222 printaddr(tcp->u_arg[2]);
227 ulen = get_tcb_priv_ulong(tcp);
229 if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &rlen) < 0) {
230 printaddr(tcp->u_arg[1]);
231 tprintf(", [%d]", ulen);
233 decode_sockaddr(tcp, tcp->u_arg[1], ulen > rlen ? rlen : ulen);
235 tprintf(", [%d->%d]", ulen, rlen);
237 tprintf(", [%d]", rlen);
245 return decode_sockname(tcp) | RVAL_FD;
250 int rc = decode_sockname(tcp);
252 if (rc & RVAL_DECODED) {
254 printflags(sock_type_flags, tcp->u_arg[3], "SOCK_???");
262 printfd(tcp, tcp->u_arg[0]);
264 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
265 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
267 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
274 printfd(tcp, tcp->u_arg[0]);
276 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
277 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
279 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
281 const int addrlen = tcp->u_arg[5];
283 decode_sockaddr(tcp, tcp->u_arg[4], addrlen);
285 tprintf(", %d", addrlen);
293 printfd(tcp, tcp->u_arg[0]);
297 printaddr(tcp->u_arg[1]);
299 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
303 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
304 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
314 printfd(tcp, tcp->u_arg[0]);
316 if (fetch_socklen(tcp, &ulen, tcp->u_arg[4], tcp->u_arg[5])) {
317 set_tcb_priv_ulong(tcp, ulen);
322 printaddr(tcp->u_arg[1]);
324 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
328 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
330 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
333 ulen = get_tcb_priv_ulong(tcp);
335 if (!fetch_socklen(tcp, &rlen, tcp->u_arg[4], tcp->u_arg[5])) {
337 printaddr(tcp->u_arg[4]);
340 printaddr(tcp->u_arg[5]);
345 printaddr(tcp->u_arg[4]);
347 tprintf(", [%d]", ulen);
351 decode_sockaddr(tcp, tcp->u_arg[4], ulen > rlen ? rlen : ulen);
354 tprintf(", [%d->%d]", ulen, rlen);
356 tprintf(", [%d]", rlen);
361 SYS_FUNC(getsockname)
363 return decode_sockname(tcp);
367 printpair_fd(struct tcb *tcp, const int i0, const int i1)
377 decode_pair_fd(struct tcb *const tcp, const kernel_ulong_t addr)
381 if (umove_or_printaddr(tcp, addr, &pair))
384 printpair_fd(tcp, pair[0], pair[1]);
388 do_pipe(struct tcb *tcp, int flags_arg)
391 decode_pair_fd(tcp, tcp->u_arg[0]);
392 if (flags_arg >= 0) {
394 printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
402 #if HAVE_ARCH_GETRVAL2
403 if (exiting(tcp) && !syserror(tcp))
404 printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
407 return do_pipe(tcp, -1);
413 return do_pipe(tcp, 1);
419 printxval(addrfams, tcp->u_arg[0], "AF_???");
421 tprint_sock_type(tcp->u_arg[1]);
422 tprintf(", %" PRI_klu, tcp->u_arg[2]);
425 decode_pair_fd(tcp, tcp->u_arg[3]);
430 #include "xlat/sock_options.h"
431 #include "xlat/getsock_options.h"
432 #include "xlat/setsock_options.h"
433 #include "xlat/sock_ip_options.h"
434 #include "xlat/getsock_ip_options.h"
435 #include "xlat/setsock_ip_options.h"
436 #include "xlat/sock_ipv6_options.h"
437 #include "xlat/getsock_ipv6_options.h"
438 #include "xlat/setsock_ipv6_options.h"
439 #include "xlat/sock_ipx_options.h"
440 #include "xlat/sock_netlink_options.h"
441 #include "xlat/sock_packet_options.h"
442 #include "xlat/sock_raw_options.h"
443 #include "xlat/sock_sctp_options.h"
444 #include "xlat/sock_tcp_options.h"
445 #include "xlat/sock_udp_options.h"
446 #include "xlat/sock_irda_options.h"
447 #include "xlat/sock_llc_options.h"
448 #include "xlat/sock_dccp_options.h"
449 #include "xlat/sock_tipc_options.h"
450 #include "xlat/sock_rxrpc_options.h"
451 #include "xlat/sock_pppol2tp_options.h"
452 #include "xlat/sock_bluetooth_options.h"
453 #include "xlat/sock_pnp_options.h"
454 #include "xlat/sock_rds_options.h"
455 #include "xlat/sock_iucv_options.h"
456 #include "xlat/sock_caif_options.h"
457 #include "xlat/sock_alg_options.h"
458 #include "xlat/sock_nfcllcp_options.h"
459 #include "xlat/sock_kcm_options.h"
460 #include "xlat/sock_tls_options.h"
463 print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
464 unsigned int name, bool is_getsockopt)
468 printxval_search(socketlayers, level, "SOL_??");
473 printxvals(name, "SO_???", sock_options,
474 is_getsockopt ? getsock_options :
475 setsock_options, NULL);
478 printxvals(name, "IP_???", sock_ip_options,
479 is_getsockopt ? getsock_ip_options :
480 setsock_ip_options, NULL);
483 printxvals(name, "IPV6_???", sock_ipv6_options,
484 is_getsockopt ? getsock_ipv6_options :
485 setsock_ipv6_options, NULL);
488 printxval(sock_ipx_options, name, "IPX_???");
491 printxval(sock_packet_options, name, "PACKET_???");
494 printxval_index(sock_tcp_options, name, "TCP_???");
497 printxval(sock_sctp_options, name, "SCTP_???");
500 printxval(sock_raw_options, name, "RAW_???");
503 printxval(sock_netlink_options, name, "NETLINK_???");
506 printxval(sock_udp_options, name, "UDP_???");
509 printxval_index(sock_irda_options, name, "IRLMP_???");
512 printxval_index(sock_llc_options, name, "LLC_OPT_???");
515 printxval_search(sock_dccp_options, name, "DCCP_SOCKOPT_???");
518 printxval_search(sock_tipc_options, name, "TIPC_???");
521 printxval_index(sock_rxrpc_options, name, "RXRPC_???");
524 printxval_index(sock_pppol2tp_options, name, "PPPOL2TP_SO_???");
527 printxval_search(sock_bluetooth_options, name, "BT_???");
530 printxval(sock_pnp_options, name, "PNPIPE_???");
533 printxval_search(sock_rds_options, name, "RDS_???");
536 printxval(sock_iucv_options, name, "SO_???");
539 printxval(sock_caif_options, name, "CAIFSO_???");
542 printxval_index(sock_alg_options, name, "ALG_???");
545 printxval_index(sock_nfcllcp_options, name, "NFC_LLCP_???");
548 printxval(sock_kcm_options, name, "KCM_???");
551 printxval(sock_tls_options, name, "TLS_???");
554 /* Other SOL_* protocol levels still need work. */
564 print_set_linger(struct tcb *const tcp, const kernel_ulong_t addr,
567 struct linger linger;
569 if (len < (int) sizeof(linger)) {
571 } else if (!umove_or_printaddr(tcp, addr, &linger)) {
572 PRINT_FIELD_D("{", linger, l_onoff);
573 PRINT_FIELD_D(", ", linger, l_linger);
579 print_get_linger(struct tcb *const tcp, const kernel_ulong_t addr,
582 struct linger linger;
584 if (len < sizeof(linger)) {
585 if (len != sizeof(linger.l_onoff)) {
586 printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
590 len = sizeof(linger);
593 if (umoven(tcp, addr, len, &linger) < 0) {
598 PRINT_FIELD_D("{", linger, l_onoff);
599 if (len == sizeof(linger))
600 PRINT_FIELD_D(", ", linger, l_linger);
606 print_ucred(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int len)
610 if (len < sizeof(uc)) {
611 if (len != sizeof(uc.pid)
612 && len != offsetofend(struct ucred, uid)) {
613 printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
620 if (umoven(tcp, addr, len, &uc) < 0) {
625 PRINT_FIELD_D("{", uc, pid);
626 if (len > sizeof(uc.pid))
627 PRINT_FIELD_UID(", ", uc, uid);
628 if (len == sizeof(uc))
629 PRINT_FIELD_UID(", ", uc, gid);
632 #endif /* SO_PEERCRED */
634 #ifdef PACKET_STATISTICS
636 print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr,
639 struct tpacket_stats stats;
641 if (len != sizeof(stats) ||
642 umove(tcp, addr, &stats) < 0) {
645 PRINT_FIELD_U("{", stats, tp_packets);
646 PRINT_FIELD_U(", ", stats, tp_drops);
650 #endif /* PACKET_STATISTICS */
652 #include "xlat/icmpfilterflags.h"
655 print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len)
657 struct icmp_filter filter = {};
659 if (len > (int) sizeof(filter))
660 len = sizeof(filter);
666 if (umoven_or_printaddr(tcp, addr, len, &filter))
670 printflags(icmpfilterflags, ~filter.data, "ICMP_???");
675 print_uint32(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
677 tprintf("%u", *(uint32_t *) elem_buf);
683 print_getsockopt(struct tcb *const tcp, const unsigned int level,
684 const unsigned int name, const kernel_ulong_t addr,
685 const int ulen, const int rlen)
687 if (addr && verbose(tcp))
692 print_get_linger(tcp, addr, rlen);
696 print_ucred(tcp, addr, rlen);
699 #ifdef SO_ATTACH_FILTER
700 case SO_ATTACH_FILTER:
701 if (rlen && (unsigned short) rlen == (unsigned int) rlen)
702 print_sock_fprog(tcp, addr, rlen);
706 #endif /* SO_ATTACH_FILTER */
712 #ifdef PACKET_STATISTICS
713 case PACKET_STATISTICS:
714 print_tpacket_stats(tcp, addr, rlen);
723 print_icmp_filter(tcp, addr, rlen);
729 if (ulen < 0 || rlen < 0) {
731 * As the kernel neither accepts nor returns a negative
732 * length, in case of successful getsockopt syscall
733 * invocation these negative values must have come
740 case NETLINK_LIST_MEMBERSHIPS: {
742 print_array(tcp, addr, MIN(ulen, rlen) / sizeof(buf),
744 tfetch_mem, print_uint32, 0);
748 printnum_int(tcp, addr, "%d");
754 /* default arg printing */
757 if (rlen == sizeof(int)) {
758 printnum_int(tcp, addr, "%d");
760 printstrn(tcp, addr, rlen);
772 print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
773 tcp->u_arg[1], tcp->u_arg[2], true);
775 if (verbose(tcp) && tcp->u_arg[4]
776 && umove(tcp, tcp->u_arg[4], &ulen) == 0) {
777 set_tcb_priv_ulong(tcp, ulen);
780 printaddr(tcp->u_arg[3]);
782 printaddr(tcp->u_arg[4]);
786 ulen = get_tcb_priv_ulong(tcp);
788 if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) {
789 printaddr(tcp->u_arg[3]);
790 tprintf(", [%d]", ulen);
792 print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
793 tcp->u_arg[3], ulen, rlen);
795 tprintf(", [%d->%d]", ulen, rlen);
797 tprintf(", [%d]", rlen);
803 #ifdef IP_ADD_MEMBERSHIP
805 print_mreq(struct tcb *const tcp, const kernel_ulong_t addr,
810 if (len < (int) sizeof(mreq)) {
812 } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
813 PRINT_FIELD_INET4_ADDR("{", mreq, imr_multiaddr);
814 PRINT_FIELD_INET4_ADDR(", ", mreq, imr_interface);
818 #endif /* IP_ADD_MEMBERSHIP */
820 #ifdef IPV6_ADD_MEMBERSHIP
822 print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr,
825 struct ipv6_mreq mreq;
827 if (len < (int) sizeof(mreq)) {
829 } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
830 PRINT_FIELD_INET_ADDR("{", mreq, ipv6mr_multiaddr, AF_INET6);
831 PRINT_FIELD_IFINDEX(", ", mreq, ipv6mr_interface);
835 #endif /* IPV6_ADD_MEMBERSHIP */
837 #ifdef PACKET_RX_RING
839 print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
841 struct tpacket_req req;
843 if (len != sizeof(req) ||
844 umove(tcp, addr, &req) < 0) {
847 PRINT_FIELD_U("{", req, tp_block_size);
848 PRINT_FIELD_U(", ", req, tp_block_nr);
849 PRINT_FIELD_U(", ", req, tp_frame_size);
850 PRINT_FIELD_U(", ", req, tp_frame_nr);
854 #endif /* PACKET_RX_RING */
856 #ifdef PACKET_ADD_MEMBERSHIP
857 # include "xlat/packet_mreq_type.h"
860 print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
862 struct packet_mreq mreq;
864 if (len != sizeof(mreq) ||
865 umove(tcp, addr, &mreq) < 0) {
870 PRINT_FIELD_IFINDEX("{", mreq, mr_ifindex);
871 PRINT_FIELD_XVAL(", ", mreq, mr_type, packet_mreq_type,
873 PRINT_FIELD_U(", ", mreq, mr_alen);
874 tprints(", mr_address=");
875 if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address))
876 mreq.mr_alen = ARRAY_SIZE(mreq.mr_address);
877 for (i = 0; i < mreq.mr_alen; ++i)
878 tprintf("%02x", mreq.mr_address[i]);
882 #endif /* PACKET_ADD_MEMBERSHIP */
885 print_setsockopt(struct tcb *const tcp, const unsigned int level,
886 const unsigned int name, const kernel_ulong_t addr,
889 if (addr && verbose(tcp))
894 print_set_linger(tcp, addr, len);
896 #ifdef SO_ATTACH_FILTER
897 case SO_ATTACH_FILTER:
898 # ifdef SO_ATTACH_REUSEPORT_CBPF
899 case SO_ATTACH_REUSEPORT_CBPF:
901 if ((unsigned int) len == get_sock_fprog_size())
902 decode_sock_fprog(tcp, addr);
906 #endif /* SO_ATTACH_FILTER */
912 #ifdef IP_ADD_MEMBERSHIP
913 case IP_ADD_MEMBERSHIP:
914 case IP_DROP_MEMBERSHIP:
915 print_mreq(tcp, addr, len);
917 #endif /* IP_ADD_MEMBERSHIP */
918 #ifdef MCAST_JOIN_GROUP
919 case MCAST_JOIN_GROUP:
920 case MCAST_LEAVE_GROUP:
921 print_group_req(tcp, addr, len);
923 #endif /* MCAST_JOIN_GROUP */
929 #ifdef IPV6_ADD_MEMBERSHIP
930 case IPV6_ADD_MEMBERSHIP:
931 case IPV6_DROP_MEMBERSHIP:
932 # ifdef IPV6_JOIN_ANYCAST
933 case IPV6_JOIN_ANYCAST:
935 # ifdef IPV6_LEAVE_ANYCAST
936 case IPV6_LEAVE_ANYCAST:
938 print_mreq6(tcp, addr, len);
940 #endif /* IPV6_ADD_MEMBERSHIP */
941 #ifdef MCAST_JOIN_GROUP
942 case MCAST_JOIN_GROUP:
943 case MCAST_LEAVE_GROUP:
944 print_group_req(tcp, addr, len);
946 #endif /* MCAST_JOIN_GROUP */
952 #ifdef PACKET_RX_RING
954 # ifdef PACKET_TX_RING
957 print_tpacket_req(tcp, addr, len);
959 #endif /* PACKET_RX_RING */
960 #ifdef PACKET_ADD_MEMBERSHIP
961 case PACKET_ADD_MEMBERSHIP:
962 case PACKET_DROP_MEMBERSHIP:
963 print_packet_mreq(tcp, addr, len);
965 #endif /* PACKET_ADD_MEMBERSHIP */
972 print_icmp_filter(tcp, addr, len);
978 if (len < (int) sizeof(int))
981 printnum_int(tcp, addr, "%d");
985 /* default arg printing */
988 if (len == sizeof(int)) {
989 printnum_int(tcp, addr, "%d");
991 printstrn(tcp, addr, len);
1000 print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
1001 tcp->u_arg[1], tcp->u_arg[2], false);
1002 print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
1003 tcp->u_arg[3], tcp->u_arg[4]);
1004 tprintf(", %d", (int) tcp->u_arg[4]);
1006 return RVAL_DECODED;