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-2019 The strace developers.
9 * SPDX-License-Identifier: LGPL-2.1-or-later
13 #include "print_fields.h"
16 #include <sys/socket.h>
19 #include <netinet/in.h>
20 #ifdef HAVE_NETINET_TCP_H
21 # include <netinet/tcp.h>
23 #ifdef HAVE_NETINET_UDP_H
24 # include <netinet/udp.h>
26 #ifdef HAVE_NETINET_SCTP_H
27 # include <netinet/sctp.h>
29 #include <arpa/inet.h>
31 #include <asm/types.h>
32 #ifdef HAVE_NETIPX_IPX_H
33 # include <netipx/ipx.h>
35 # include <linux/ipx.h>
38 #if defined(HAVE_LINUX_IP_VS_H)
39 # include <linux/ip_vs.h>
42 #if defined(HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H)
43 # include <linux/netfilter_arp/arp_tables.h>
45 #if defined(HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H)
46 # include <linux/netfilter_bridge/ebtables.h>
48 #if defined(HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H)
49 # include <linux/netfilter_ipv4/ip_tables.h>
51 #if defined(HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H)
52 # include <linux/netfilter_ipv6/ip6_tables.h>
54 #include <linux/if_packet.h>
55 #include <linux/icmp.h>
57 #include "xlat/socktypes.h"
58 #include "xlat/sock_type_flags.h"
59 #ifndef SOCK_TYPE_MASK
60 # define SOCK_TYPE_MASK 0xf
63 #include "xlat/socketlayers.h"
65 #include "xlat/inet_protocols.h"
67 #define XLAT_MACROS_ONLY
68 #include "xlat/addrfams.h"
69 #include "xlat/ethernet_protocols.h"
70 #undef XLAT_MACROS_ONLY
71 #include "xlat/ax25_protocols.h"
72 #include "xlat/irda_protocols.h"
73 #include "xlat/can_protocols.h"
74 #include "xlat/bt_protocols.h"
75 #include "xlat/isdn_protocols.h"
76 #include "xlat/phonet_protocols.h"
77 #include "xlat/caif_protocols.h"
78 #include "xlat/nfc_protocols.h"
79 #include "xlat/kcm_protocols.h"
80 #include "xlat/smc_protocols.h"
82 const size_t inet_protocols_size = ARRAY_SIZE(inet_protocols) - 1;
85 decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
86 const kernel_ulong_t addrlen)
89 switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) {
90 case SOCK_PROTO_NETLINK:
91 decode_netlink(tcp, fd, addr, addrlen);
94 printstrn(tcp, addr, addrlen);
99 * low bits of the socket type define real socket type,
100 * other bits are socket type flags.
103 tprint_sock_type(unsigned int flags)
105 const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
108 print_xlat_ex(flags & SOCK_TYPE_MASK, str, XLAT_STYLE_DEFAULT);
109 flags &= ~SOCK_TYPE_MASK;
114 printflags(sock_type_flags, flags, "SOCK_???");
119 printxval(addrfams, tcp->u_arg[0], "AF_???");
121 tprint_sock_type(tcp->u_arg[1]);
123 switch (tcp->u_arg[0]) {
126 printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
130 /* Those are not available in public headers. */
131 printxval_ex(ax25_protocols, tcp->u_arg[2], "AX25_P_???",
136 printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
141 printxval(ethernet_protocols, ntohs(tcp->u_arg[2]),
147 printxval(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
151 printxval(can_protocols, tcp->u_arg[2], "CAN_???");
155 printxval(bt_protocols, tcp->u_arg[2], "BTPROTO_???");
159 printxval(addrfams, tcp->u_arg[2], "AF_???");
163 printxval(isdn_protocols, tcp->u_arg[2], "ISDN_P_???");
167 printxval(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???");
171 printxval(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???");
175 printxval(nfc_protocols, tcp->u_arg[2], "NFC_SOCKPROTO_???");
179 printxval(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???");
183 printxval(smc_protocols, tcp->u_arg[2], "SMCPROTO_???");
187 tprintf("%" PRI_klu, tcp->u_arg[2]);
191 return RVAL_DECODED | RVAL_FD;
195 fetch_socklen(struct tcb *const tcp, int *const plen,
196 const kernel_ulong_t sockaddr, const kernel_ulong_t socklen)
198 return verbose(tcp) && sockaddr && socklen
199 && umove(tcp, socklen, plen) == 0;
203 decode_sockname(struct tcb *tcp)
208 printfd(tcp, tcp->u_arg[0]);
210 if (fetch_socklen(tcp, &ulen, tcp->u_arg[1], tcp->u_arg[2])) {
211 set_tcb_priv_ulong(tcp, ulen);
214 printaddr(tcp->u_arg[1]);
216 printaddr(tcp->u_arg[2]);
221 ulen = get_tcb_priv_ulong(tcp);
223 if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &rlen) < 0) {
224 printaddr(tcp->u_arg[1]);
225 tprintf(", [%d]", ulen);
227 decode_sockaddr(tcp, tcp->u_arg[1], ulen > rlen ? rlen : ulen);
229 tprintf(", [%d->%d]", ulen, rlen);
231 tprintf(", [%d]", rlen);
239 return decode_sockname(tcp) | RVAL_FD;
244 int rc = decode_sockname(tcp);
246 if (rc & RVAL_DECODED) {
248 printflags(sock_type_flags, tcp->u_arg[3], "SOCK_???");
256 printfd(tcp, tcp->u_arg[0]);
258 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
259 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
261 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
268 printfd(tcp, tcp->u_arg[0]);
270 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
271 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
273 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
275 const int addrlen = tcp->u_arg[5];
277 decode_sockaddr(tcp, tcp->u_arg[4], addrlen);
279 tprintf(", %d", addrlen);
287 printfd(tcp, tcp->u_arg[0]);
291 printaddr(tcp->u_arg[1]);
293 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
294 MIN((kernel_ulong_t) tcp->u_rval,
298 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
299 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
309 printfd(tcp, tcp->u_arg[0]);
311 if (fetch_socklen(tcp, &ulen, tcp->u_arg[4], tcp->u_arg[5])) {
312 set_tcb_priv_ulong(tcp, ulen);
317 printaddr(tcp->u_arg[1]);
319 decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
320 MIN((kernel_ulong_t) tcp->u_rval,
324 tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
326 printflags(msg_flags, tcp->u_arg[3], "MSG_???");
329 ulen = get_tcb_priv_ulong(tcp);
331 if (!fetch_socklen(tcp, &rlen, tcp->u_arg[4], tcp->u_arg[5])) {
333 printaddr(tcp->u_arg[4]);
336 printaddr(tcp->u_arg[5]);
341 printaddr(tcp->u_arg[4]);
343 tprintf(", [%d]", ulen);
347 decode_sockaddr(tcp, tcp->u_arg[4], ulen > rlen ? rlen : ulen);
350 tprintf(", [%d->%d]", ulen, rlen);
352 tprintf(", [%d]", rlen);
357 SYS_FUNC(getsockname)
359 return decode_sockname(tcp);
363 printpair_fd(struct tcb *tcp, const int i0, const int i1)
373 decode_pair_fd(struct tcb *const tcp, const kernel_ulong_t addr)
377 if (umove_or_printaddr(tcp, addr, &pair))
380 printpair_fd(tcp, pair[0], pair[1]);
384 do_pipe(struct tcb *tcp, int flags_arg)
387 decode_pair_fd(tcp, tcp->u_arg[0]);
388 if (flags_arg >= 0) {
390 printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
398 #if HAVE_ARCH_GETRVAL2
399 if (exiting(tcp) && !syserror(tcp))
400 printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
403 return do_pipe(tcp, -1);
409 return do_pipe(tcp, 1);
415 printxval(addrfams, tcp->u_arg[0], "AF_???");
417 tprint_sock_type(tcp->u_arg[1]);
418 tprintf(", %" PRI_klu, tcp->u_arg[2]);
421 decode_pair_fd(tcp, tcp->u_arg[3]);
426 #include "xlat/sock_options.h"
427 #include "xlat/getsock_options.h"
428 #include "xlat/setsock_options.h"
429 #include "xlat/sock_ip_options.h"
430 #include "xlat/getsock_ip_options.h"
431 #include "xlat/setsock_ip_options.h"
432 #include "xlat/sock_ipv6_options.h"
433 #include "xlat/getsock_ipv6_options.h"
434 #include "xlat/setsock_ipv6_options.h"
435 #include "xlat/sock_ipx_options.h"
436 #include "xlat/sock_ax25_options.h"
437 #include "xlat/sock_netlink_options.h"
438 #include "xlat/sock_packet_options.h"
439 #include "xlat/sock_raw_options.h"
440 #include "xlat/sock_sctp_options.h"
441 #include "xlat/sock_tcp_options.h"
442 #include "xlat/sock_udp_options.h"
443 #include "xlat/sock_irda_options.h"
444 #include "xlat/sock_llc_options.h"
445 #include "xlat/sock_dccp_options.h"
446 #include "xlat/sock_tipc_options.h"
447 #include "xlat/sock_rxrpc_options.h"
448 #include "xlat/sock_pppol2tp_options.h"
449 #include "xlat/sock_bluetooth_options.h"
450 #include "xlat/sock_pnp_options.h"
451 #include "xlat/sock_rds_options.h"
452 #include "xlat/sock_iucv_options.h"
453 #include "xlat/sock_caif_options.h"
454 #include "xlat/sock_alg_options.h"
455 #include "xlat/sock_nfcllcp_options.h"
456 #include "xlat/sock_kcm_options.h"
457 #include "xlat/sock_tls_options.h"
458 #include "xlat/sock_xdp_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(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_ax25_options, name, "AX25_???");
492 printxval(sock_packet_options, name, "PACKET_???");
495 printxval(sock_tcp_options, name, "TCP_???");
498 printxval(sock_sctp_options, name, "SCTP_???");
501 printxval(sock_raw_options, name, "RAW_???");
504 printxval(sock_netlink_options, name, "NETLINK_???");
507 printxval(sock_udp_options, name, "UDP_???");
510 printxval(sock_irda_options, name, "IRLMP_???");
513 printxval(sock_llc_options, name, "LLC_OPT_???");
516 printxval(sock_dccp_options, name, "DCCP_SOCKOPT_???");
519 printxval(sock_tipc_options, name, "TIPC_???");
522 printxval(sock_rxrpc_options, name, "RXRPC_???");
525 printxval(sock_pppol2tp_options, name, "PPPOL2TP_SO_???");
528 printxval(sock_bluetooth_options, name, "BT_???");
531 printxval(sock_pnp_options, name, "PNPIPE_???");
534 printxval(sock_rds_options, name, "RDS_???");
537 printxval(sock_iucv_options, name, "SO_???");
540 printxval(sock_caif_options, name, "CAIFSO_???");
543 printxval(sock_alg_options, name, "ALG_???");
546 printxval(sock_nfcllcp_options, name, "NFC_LLCP_???");
549 printxval(sock_kcm_options, name, "KCM_???");
552 printxval(sock_tls_options, name, "TLS_???");
555 printxval(sock_xdp_options, name, "XDP_???");
558 /* Other SOL_* protocol levels still need work. */
568 print_get_linger(struct tcb *const tcp, const kernel_ulong_t addr,
571 struct linger linger;
574 * The kernel cannot return len > sizeof(linger) because struct linger
575 * cannot change, but extra safety won't harm either.
577 if (len > sizeof(linger))
578 len = sizeof(linger);
579 if (umoven_or_printaddr(tcp, addr, len, &linger))
582 if (len < sizeof(linger.l_onoff)) {
583 tprints("{l_onoff=");
584 print_quoted_string((void *) &linger.l_onoff,
585 len, QUOTE_FORCE_HEX);
587 PRINT_FIELD_D("{", linger, l_onoff);
589 if (len > offsetof(struct linger, l_linger)) {
590 len -= offsetof(struct linger, l_linger);
591 if (len < sizeof(linger.l_linger)) {
592 tprints(", l_linger=");
593 print_quoted_string((void *) &linger.l_linger,
594 len, QUOTE_FORCE_HEX);
596 PRINT_FIELD_D(", ", linger, l_linger);
604 print_get_ucred(struct tcb *const tcp, const kernel_ulong_t addr,
610 * The kernel is very unlikely to return len > sizeof(uc)
611 * because struct ucred is very unlikely to change,
612 * but extra safety won't harm either.
614 if (len > sizeof(uc))
617 if (umoven_or_printaddr(tcp, addr, len, &uc))
620 if (len < sizeof(uc.pid)) {
622 print_quoted_string((void *) &uc.pid,
623 len, QUOTE_FORCE_HEX);
625 PRINT_FIELD_D("{", uc, pid);
627 if (len > offsetof(struct ucred, uid)) {
628 len -= offsetof(struct ucred, uid);
629 if (len < sizeof(uc.uid)) {
631 print_quoted_string((void *) &uc.uid,
632 len, QUOTE_FORCE_HEX);
634 PRINT_FIELD_UID(", ", uc, uid);
636 if (len > offsetof(struct ucred, gid) -
637 offsetof(struct ucred, uid)) {
638 len -= offsetof(struct ucred, gid) -
639 offsetof(struct ucred, uid);
640 if (len < sizeof(uc.gid)) {
642 print_quoted_string((void *) &uc.gid,
646 PRINT_FIELD_UID(", ", uc, gid);
656 print_get_error(struct tcb *const tcp, const kernel_ulong_t addr,
661 if (len > sizeof(err))
664 if (umoven_or_printaddr(tcp, addr, len, &err))
668 print_err(err, false);
672 #ifdef PACKET_STATISTICS
674 print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr,
678 unsigned int tp_packets, tp_drops, tp_freeze_q_cnt;
682 * The kernel may return len > sizeof(stats) if the kernel structure
683 * grew as it happened when tpacket_stats_v3 was introduced.
685 if (len > sizeof(stats))
688 if (umoven_or_printaddr(tcp, addr, len, &stats))
691 if (len < sizeof(stats.tp_packets)) {
692 tprints("{tp_packets=");
693 print_quoted_string((void *) &stats.tp_packets,
694 len, QUOTE_FORCE_HEX);
696 PRINT_FIELD_U("{", stats, tp_packets);
698 if (len > offsetof(struct tp_stats, tp_drops)) {
699 len -= offsetof(struct tp_stats, tp_drops);
700 if (len < sizeof(stats.tp_drops)) {
701 tprints(", tp_drops=");
702 print_quoted_string((void *) &stats.tp_drops,
703 len, QUOTE_FORCE_HEX);
705 PRINT_FIELD_U(", ", stats, tp_drops);
707 if (len > offsetof(struct tp_stats, tp_freeze_q_cnt) -
708 offsetof(struct tp_stats, tp_drops)) {
709 len -= offsetof(struct tp_stats, tp_freeze_q_cnt) -
710 offsetof(struct tp_stats, tp_drops);
711 if (len < sizeof(stats.tp_freeze_q_cnt)) {
712 tprints(", tp_freeze_q_cnt=");
713 print_quoted_string((void *) &stats.tp_freeze_q_cnt,
717 PRINT_FIELD_U(", ", stats, tp_freeze_q_cnt);
725 #endif /* PACKET_STATISTICS */
727 #include "xlat/icmpfilterflags.h"
730 print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len)
732 struct icmp_filter filter = {};
734 if (len > (int) sizeof(filter))
735 len = sizeof(filter);
741 if (umoven_or_printaddr(tcp, addr, len, &filter))
745 printflags(icmpfilterflags, ~filter.data, "ICMP_???");
750 print_getsockopt(struct tcb *const tcp, const unsigned int level,
751 const unsigned int name, const kernel_ulong_t addr,
752 const int ulen, const int rlen)
754 if (ulen <= 0 || rlen <= 0) {
756 * As the kernel neither accepts nor returns a negative
757 * length in case of successful getsockopt syscall
758 * invocation, negative values must have been forged
765 if (addr && verbose(tcp))
770 print_get_linger(tcp, addr, rlen);
773 print_get_ucred(tcp, addr, rlen);
775 case SO_ATTACH_FILTER:
777 * The length returned by the kernel in case of
778 * successful getsockopt syscall invocation is struct
779 * sock_fprog.len that has type unsigned short,
780 * anything else must have been forged by userspace.
782 if ((unsigned short) rlen == (unsigned int) rlen)
783 print_sock_fprog(tcp, addr, rlen);
788 print_get_error(tcp, addr, rlen);
795 #ifdef PACKET_STATISTICS
796 case PACKET_STATISTICS:
797 print_tpacket_stats(tcp, addr, rlen);
806 print_icmp_filter(tcp, addr, rlen);
813 case NETLINK_LIST_MEMBERSHIPS: {
815 print_array(tcp, addr, MIN(ulen, rlen) / sizeof(buf),
817 tfetch_mem, print_uint32_array_member, 0);
821 printnum_int(tcp, addr, "%d");
827 /* default arg printing */
830 if (rlen == sizeof(int)) {
831 printnum_int(tcp, addr, "%d");
833 printstrn(tcp, addr, rlen);
845 print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
846 tcp->u_arg[1], tcp->u_arg[2], true);
848 if (verbose(tcp) && tcp->u_arg[4]
849 && umove(tcp, tcp->u_arg[4], &ulen) == 0) {
850 set_tcb_priv_ulong(tcp, ulen);
853 printaddr(tcp->u_arg[3]);
855 printaddr(tcp->u_arg[4]);
859 ulen = get_tcb_priv_ulong(tcp);
861 if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) {
862 printaddr(tcp->u_arg[3]);
863 tprintf(", [%d]", ulen);
865 print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
866 tcp->u_arg[3], ulen, rlen);
868 tprintf(", [%d->%d]", ulen, rlen);
870 tprintf(", [%d]", rlen);
877 print_set_linger(struct tcb *const tcp, const kernel_ulong_t addr,
880 struct linger linger;
882 if (len < (int) sizeof(linger)) {
884 } else if (!umove_or_printaddr(tcp, addr, &linger)) {
885 PRINT_FIELD_D("{", linger, l_onoff);
886 PRINT_FIELD_D(", ", linger, l_linger);
891 #ifdef IP_ADD_MEMBERSHIP
893 print_mreq(struct tcb *const tcp, const kernel_ulong_t addr,
898 if (len < (int) sizeof(mreq)) {
900 } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
901 PRINT_FIELD_INET_ADDR("{", mreq, imr_multiaddr, AF_INET);
902 PRINT_FIELD_INET_ADDR(", ", mreq, imr_interface, AF_INET);
906 #endif /* IP_ADD_MEMBERSHIP */
908 #ifdef IPV6_ADD_MEMBERSHIP
910 print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr,
913 struct ipv6_mreq mreq;
915 if (len < (int) sizeof(mreq)) {
917 } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
918 PRINT_FIELD_INET_ADDR("{", mreq, ipv6mr_multiaddr, AF_INET6);
919 PRINT_FIELD_IFINDEX(", ", mreq, ipv6mr_interface);
923 #endif /* IPV6_ADD_MEMBERSHIP */
925 #ifdef PACKET_RX_RING
927 print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
929 struct tpacket_req req;
931 if (len != sizeof(req) ||
932 umove(tcp, addr, &req) < 0) {
935 PRINT_FIELD_U("{", req, tp_block_size);
936 PRINT_FIELD_U(", ", req, tp_block_nr);
937 PRINT_FIELD_U(", ", req, tp_frame_size);
938 PRINT_FIELD_U(", ", req, tp_frame_nr);
942 #endif /* PACKET_RX_RING */
944 #ifdef PACKET_ADD_MEMBERSHIP
945 # include "xlat/packet_mreq_type.h"
948 print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
950 struct packet_mreq mreq;
952 if (len != sizeof(mreq) ||
953 umove(tcp, addr, &mreq) < 0) {
956 PRINT_FIELD_IFINDEX("{", mreq, mr_ifindex);
957 PRINT_FIELD_XVAL(", ", mreq, mr_type, packet_mreq_type,
959 PRINT_FIELD_U(", ", mreq, mr_alen);
960 PRINT_FIELD_MAC_SZ(", ", mreq, mr_address,
961 (mreq.mr_alen > sizeof(mreq.mr_address)
962 ? sizeof(mreq.mr_address) : mreq.mr_alen));
966 #endif /* PACKET_ADD_MEMBERSHIP */
969 print_setsockopt(struct tcb *const tcp, const unsigned int level,
970 const unsigned int name, const kernel_ulong_t addr,
973 if (addr && verbose(tcp))
978 print_set_linger(tcp, addr, len);
980 case SO_ATTACH_FILTER:
981 case SO_ATTACH_REUSEPORT_CBPF:
982 if ((unsigned int) len == get_sock_fprog_size())
983 decode_sock_fprog(tcp, addr);
992 #ifdef IP_ADD_MEMBERSHIP
993 case IP_ADD_MEMBERSHIP:
994 case IP_DROP_MEMBERSHIP:
995 print_mreq(tcp, addr, len);
997 #endif /* IP_ADD_MEMBERSHIP */
998 #ifdef MCAST_JOIN_GROUP
999 case MCAST_JOIN_GROUP:
1000 case MCAST_LEAVE_GROUP:
1001 print_group_req(tcp, addr, len);
1003 #endif /* MCAST_JOIN_GROUP */
1009 #ifdef IPV6_ADD_MEMBERSHIP
1010 case IPV6_ADD_MEMBERSHIP:
1011 case IPV6_DROP_MEMBERSHIP:
1012 # ifdef IPV6_JOIN_ANYCAST
1013 case IPV6_JOIN_ANYCAST:
1015 # ifdef IPV6_LEAVE_ANYCAST
1016 case IPV6_LEAVE_ANYCAST:
1018 print_mreq6(tcp, addr, len);
1020 #endif /* IPV6_ADD_MEMBERSHIP */
1021 #ifdef MCAST_JOIN_GROUP
1022 case MCAST_JOIN_GROUP:
1023 case MCAST_LEAVE_GROUP:
1024 print_group_req(tcp, addr, len);
1026 #endif /* MCAST_JOIN_GROUP */
1032 #ifdef PACKET_RX_RING
1033 case PACKET_RX_RING:
1034 # ifdef PACKET_TX_RING
1035 case PACKET_TX_RING:
1037 print_tpacket_req(tcp, addr, len);
1039 #endif /* PACKET_RX_RING */
1040 #ifdef PACKET_ADD_MEMBERSHIP
1041 case PACKET_ADD_MEMBERSHIP:
1042 case PACKET_DROP_MEMBERSHIP:
1043 print_packet_mreq(tcp, addr, len);
1045 #endif /* PACKET_ADD_MEMBERSHIP */
1052 print_icmp_filter(tcp, addr, len);
1058 if (len < (int) sizeof(int))
1061 printnum_int(tcp, addr, "%d");
1065 /* default arg printing */
1068 if (len == sizeof(int)) {
1069 printnum_int(tcp, addr, "%d");
1071 printstrn(tcp, addr, len);
1078 SYS_FUNC(setsockopt)
1080 print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
1081 tcp->u_arg[1], tcp->u_arg[2], false);
1082 print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
1083 tcp->u_arg[3], tcp->u_arg[4]);
1084 tprintf(", %d", (int) tcp->u_arg[4]);
1086 return RVAL_DECODED;