Home
last modified time | relevance | path

Searched refs:optlen (Results 1 – 19 of 19) sorted by relevance

/tools/testing/selftests/bpf/prog_tests/
Dsockopt_sk.c24 socklen_t optlen; in getsetsockopt() local
35 optlen = getpagesize() * 2; in getsetsockopt()
36 big_buf = calloc(1, optlen); in getsetsockopt()
43 err = setsockopt(fd, SOL_IP, IP_TOS, big_buf, optlen); in getsetsockopt()
49 memset(big_buf, 0, optlen); in getsetsockopt()
50 optlen = 1; in getsetsockopt()
51 err = getsockopt(fd, SOL_IP, IP_TOS, big_buf, &optlen); in getsetsockopt()
82 optlen = 4; in getsetsockopt()
83 err = getsockopt(fd, SOL_CUSTOM, 0, &buf, &optlen); in getsetsockopt()
89 if (optlen != 1) { in getsetsockopt()
[all …]
Dsockopt_multi.c60 socklen_t optlen; in run_getsockopt_test() local
74 optlen = 1; in run_getsockopt_test()
75 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
97 optlen = 1; in run_getsockopt_test()
98 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
121 optlen = 1; in run_getsockopt_test()
122 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
148 optlen = 1; in run_getsockopt_test()
149 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
167 optlen = 1; in run_getsockopt_test()
[all …]
Dsockopt_qos_to_cc.c9 socklen_t optlen; in run_setsockopt_test() local
20 optlen = sizeof(cc); in run_setsockopt_test()
21 err = getsockopt(sock_fd, SOL_TCP, TCP_CONGESTION, cc, &optlen); in run_setsockopt_test()
Dsockopt.c229 offsetof(struct bpf_sockopt, optlen)),
257 offsetof(struct bpf_sockopt, optlen)),
300 offsetof(struct bpf_sockopt, optlen)),
477 offsetof(struct bpf_sockopt, optlen)),
531 offsetof(struct bpf_sockopt, optlen)),
578 offsetof(struct bpf_sockopt, optlen)),
585 offsetof(struct bpf_sockopt, optlen)),
606 offsetof(struct bpf_sockopt, optlen)),
622 offsetof(struct bpf_sockopt, optlen)),
640 offsetof(struct bpf_sockopt, optlen)),
[all …]
Dtcp_rtt.c25 socklen_t optlen; in wait_for_ack() local
29 optlen = sizeof(info); in wait_for_ack()
30 err = getsockopt(fd, SOL_TCP, TCP_INFO, &info, &optlen); in wait_for_ack()
Dbpf_iter_setsockopt.c38 socklen_t optlen = sizeof(tcp_cc); in check_bpf_dctcp() local
43 tcp_cc, &optlen) || in check_bpf_dctcp()
Dsockopt_inherit.c41 socklen_t optlen = 1; in verify_sockopt() local
45 err = getsockopt(fd, SOL_CUSTOM, optname, &buf, &optlen); in verify_sockopt()
/tools/testing/selftests/bpf/progs/
Dsockopt_sk.c55 ctx->optlen = 0; /* bypass optval>PAGE_SIZE */ in _getsockopt()
98 ctx->optlen = 1; in _getsockopt()
128 ctx->optlen = 1; in _getsockopt()
159 ctx->optlen = 0; /* bypass optval>PAGE_SIZE */ in _setsockopt()
170 ctx->optlen = 4; in _setsockopt()
182 ctx->optlen = 5; in _setsockopt()
189 if (ctx->optlen != page_size * 2) in _setsockopt()
197 ctx->optlen = 1; in _setsockopt()
221 ctx->optlen = -1; /* BPF has consumed this option, don't call kernel in _setsockopt()
Dsockopt_multi.c27 ctx->optlen = 1; in _getsockopt_child()
50 ctx->optlen = 1; in _getsockopt_parent()
68 ctx->optlen = 1; in _setsockopt()
Dtest_tcp_hdr_options.c164 __u8 optlen; in synack_opt_len() local
179 optlen = option_total_len(passive_synack_out.flags); in synack_opt_len()
180 if (optlen) { in synack_opt_len()
181 err = bpf_reserve_hdr_opt(skops, optlen, 0); in synack_opt_len()
208 __u8 optlen; in syn_opt_len() local
214 optlen = option_total_len(active_syn_out.flags); in syn_opt_len()
215 if (optlen) { in syn_opt_len()
216 err = bpf_reserve_hdr_opt(skops, optlen, 0); in syn_opt_len()
236 __u8 optlen; in fin_opt_len() local
251 optlen = option_total_len(opt->flags); in fin_opt_len()
[all …]
Dsockopt_inherit.c71 ctx->optlen = 1; in _getsockopt()
94 ctx->optlen = -1; in _setsockopt()
/tools/testing/selftests/net/
Dgro.c105 int optlen = 0; in setup_sock_filter() local
117 optlen = sizeof(struct ip_timestamp); in setup_sock_filter()
119 optlen = sizeof(struct ip6_frag); in setup_sock_filter()
129 BPF_STMT(BPF_LD + BPF_H + BPF_ABS, dport_off + optlen), in setup_sock_filter()
556 int optlen = sizeof(struct ip_timestamp); in add_ipv4_ts_option() local
559 if (optlen % 4) in add_ipv4_ts_option()
563 ts->ipt_len = optlen; in add_ipv4_ts_option()
568 memcpy(optpkt + tcp_offset + optlen, buf + tcp_offset, in add_ipv4_ts_option()
572 iph->ihl = 5 + (optlen / 4); in add_ipv4_ts_option()
573 iph->tot_len = htons(ntohs(iph->tot_len) + optlen); in add_ipv4_ts_option()
[all …]
Dnettest.c376 socklen_t optlen = len; in get_bind_to_device() local
379 rc = getsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, name, &optlen); in get_bind_to_device()
/tools/testing/selftests/bpf/
Dnetwork_helpers.c242 socklen_t addrlen, optlen; in connect_to_fd_opts() local
248 optlen = sizeof(type); in connect_to_fd_opts()
249 if (getsockopt(server_fd, SOL_SOCKET, SO_TYPE, &type, &optlen)) { in connect_to_fd_opts()
Dxdpxceiver.c695 socklen_t optlen; in rx_stats_are_valid() local
698 optlen = sizeof(stats); in rx_stats_are_valid()
699 err = getsockopt(fd, SOL_XDP, XDP_STATISTICS, &stats, &optlen); in rx_stats_are_valid()
706 if (optlen == sizeof(struct xdp_statistics)) { in rx_stats_are_valid()
736 socklen_t optlen; in tx_stats_validate() local
739 optlen = sizeof(stats); in tx_stats_validate()
740 err = getsockopt(fd, SOL_XDP, XDP_STATISTICS, &stats, &optlen); in tx_stats_validate()
Dtest_maps.c1608 socklen_t optlen, addrlen; in prepare_reuseport_grp() local
1623 optlen = sizeof(sk_cookie); in prepare_reuseport_grp()
1663 &optlen); in prepare_reuseport_grp()
/tools/lib/bpf/
Dxsk.c205 socklen_t optlen; in xsk_get_mmap_offsets() local
208 optlen = sizeof(*off); in xsk_get_mmap_offsets()
209 err = getsockopt(fd, SOL_XDP, XDP_MMAP_OFFSETS, off, &optlen); in xsk_get_mmap_offsets()
213 if (optlen == sizeof(*off)) in xsk_get_mmap_offsets()
216 if (optlen == sizeof(struct xdp_mmap_offsets_v1)) { in xsk_get_mmap_offsets()
/tools/testing/selftests/net/mptcp/
Dmptcp_connect.c905 static void xsetsockopt(int fd, int level, int optname, const void *optval, socklen_t optlen) in xsetsockopt() argument
909 err = setsockopt(fd, level, optname, optval, optlen); in xsetsockopt()
/tools/include/uapi/linux/
Dbpf.h6242 __s32 optlen; member