Home
last modified time | relevance | path

Searched refs:saddr (Results 1 – 25 of 37) sorted by relevance

12

/tools/testing/selftests/net/
Dpsock_lib.h77 struct sockaddr_in saddr, daddr; in pair_udp_open() local
86 memset(&saddr, 0, sizeof(saddr)); in pair_udp_open()
87 saddr.sin_family = AF_INET; in pair_udp_open()
88 saddr.sin_port = htons(port); in pair_udp_open()
89 saddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); in pair_udp_open()
101 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) { in pair_udp_open()
Dreuseport_dualstack.c75 struct sockaddr_in saddr, daddr; in send_from_v4() local
78 saddr.sin_family = AF_INET; in send_from_v4()
79 saddr.sin_addr.s_addr = htonl(INADDR_ANY); in send_from_v4()
80 saddr.sin_port = 0; in send_from_v4()
90 if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr))) in send_from_v4()
Dreuseport_bpf_numa.c109 struct sockaddr_storage saddr, daddr; in send_from_node() local
116 saddr4 = (struct sockaddr_in *)&saddr; in send_from_node()
127 saddr6 = (struct sockaddr_in6 *)&saddr; in send_from_node()
148 if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr))) in send_from_node()
Dreuseport_bpf_cpu.c96 struct sockaddr_storage saddr, daddr; in send_from_cpu() local
104 saddr4 = (struct sockaddr_in *)&saddr; in send_from_cpu()
115 saddr6 = (struct sockaddr_in6 *)&saddr; in send_from_cpu()
138 if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr))) in send_from_cpu()
Dmsg_zerocopy.c260 struct sockaddr_in *saddr = (void *) &cfg_src_addr; in setup_iph() local
268 iph->saddr = saddr->sin_addr.s_addr; in setup_iph()
280 struct sockaddr_in6 *saddr = (void *) &cfg_src_addr; in setup_ip6h() local
288 ip6h->saddr = saddr->sin6_addr; in setup_ip6h()
707 char *daddr = NULL, *saddr = NULL; in parse_opts() local
753 saddr = optarg; in parse_opts()
771 if (!cfg_rx && !saddr) in parse_opts()
775 setup_sockaddr(cfg_family, saddr, &cfg_src_addr); in parse_opts()
Dreuseport_addr_any.c103 struct sockaddr *saddr, *daddr; in connect_and_send() local
118 saddr = (struct sockaddr *)&saddr4; in connect_and_send()
131 saddr = (struct sockaddr *)&saddr6; in connect_and_send()
152 if (bind(fd, saddr, sz)) in connect_and_send()
Dtcp_fastopen_backup_key.c149 struct sockaddr *saddr, *daddr; in connect_and_send() local
165 saddr = (struct sockaddr *)&saddr4; in connect_and_send()
178 saddr = (struct sockaddr *)&saddr6; in connect_and_send()
192 if (bind(fd, saddr, sz)) in connect_and_send()
/tools/testing/selftests/bpf/progs/
Dtest_lwt_ip_encap.c31 hdr.iph.saddr = 0x640110ac; /* 172.16.1.100 */ in bpf_lwt_encap_gre()
34 hdr.iph.saddr = 0xac100164; /* 172.16.1.100 */ in bpf_lwt_encap_gre()
67 hdr.ip6hdr.saddr.s6_addr[0] = 0xfb; in bpf_lwt_encap_gre6()
68 hdr.ip6hdr.saddr.s6_addr[1] = 1; in bpf_lwt_encap_gre6()
69 hdr.ip6hdr.saddr.s6_addr[15] = 1; in bpf_lwt_encap_gre6()
Dtest_tcp_estats.c180 __be32 *saddr, __be32 *daddr) in conn_id_ipv4_init() argument
184 unaligned_u32_set(conn_id->localaddress.data, (__u8 *)saddr); in conn_id_ipv4_init()
189 __be32 *saddr, __be32 *daddr) in conn_id_ipv6_init() argument
193 unaligned_u32_set(conn_id->localaddress.data, (__u8 *)saddr); in conn_id_ipv6_init()
195 (__u8 *)(saddr + 1)); in conn_id_ipv6_init()
197 (__u8 *)(saddr + 2)); in conn_id_ipv6_init()
199 (__u8 *)(saddr + 3)); in conn_id_ipv6_init()
Dtest_tcp_check_syncookie_kern.c77 tup.ipv4.saddr = ipv4h->saddr; in check_syncookie()
109 memcpy(tup.ipv6.saddr, &ipv6h->saddr, sizeof(tup.ipv6.saddr)); in check_syncookie()
Dxdping_kern.c111 raddr = iph->saddr; in xdping_client()
139 iph->saddr = iph->daddr; in xdping_client()
171 raddr = iph->saddr; in xdping_server()
175 iph->saddr = iph->daddr; in xdping_server()
Dtest_xdp.c138 iph->saddr = tnl->saddr.v4; in handle_ipv4()
205 memcpy(ip6h->saddr.s6_addr32, tnl->saddr.v6, sizeof(tnl->saddr.v6)); in handle_ipv6()
Dtest_xdp_loop.c134 iph->saddr = tnl->saddr.v4; in handle_ipv4()
201 memcpy(ip6h->saddr.s6_addr32, tnl->saddr.v6, sizeof(tnl->saddr.v6)); in handle_ipv6()
Dconnect4_prog.c29 memset(&tuple.ipv4.saddr, 0, sizeof(tuple.ipv4.saddr)); in connect_v4_prog()
Dconnect6_prog.c37 memset(&tuple.ipv6.saddr, 0, sizeof(tuple.ipv6.saddr)); in connect_v6_prog()
Dtest_xdp_noinline.c312 ip6h->saddr.in6_u.u6_addr32[0] = 1; in encap_v6()
313 ip6h->saddr.in6_u.u6_addr32[1] = 2; in encap_v6()
314 ip6h->saddr.in6_u.u6_addr32[2] = 3; in encap_v6()
315 ip6h->saddr.in6_u.u6_addr32[3] = ip_suffix; in encap_v6()
361 iph->saddr = ((0xFFFF0000 & ip_suffix) | 4268) ^ dst->dst; in encap_v4()
448 iph->daddr = iph->saddr; in send_icmp_reply()
449 iph->saddr = tmp_addr; in send_icmp_reply()
477 memcpy(tmp_addr, ip6h->saddr.in6_u.u6_addr32, 16); in send_icmp6_reply()
478 memcpy(ip6h->saddr.in6_u.u6_addr32, ip6h->daddr.in6_u.u6_addr32, 16); in send_icmp6_reply()
504 memcpy(pckt->flow.dstv6, ip6h->saddr.in6_u.u6_addr32, 16); in parse_icmpv6()
[all …]
Dtest_sk_lookup_kern.c38 result = (struct bpf_sock_tuple *)&iph->saddr; in get_tuple()
47 result = (struct bpf_sock_tuple *)&ip6h->saddr; in get_tuple()
Dtest_select_reuseport_kern.c87 offsetof(struct iphdr, saddr), in _select_by_skb_data()
93 offsetof(struct ipv6hdr, saddr), in _select_by_skb_data()
/tools/perf/examples/bpf/
Daugmented_raw_syscalls.c77 struct sockaddr_storage saddr; member
146 if (socklen > sizeof(augmented_args->saddr)) in sys_enter_connect()
147 socklen = sizeof(augmented_args->saddr); in sys_enter_connect()
149 probe_read(&augmented_args->saddr, socklen, sockaddr_arg); in sys_enter_connect()
165 if (socklen > sizeof(augmented_args->saddr)) in sys_enter_sendto()
166 socklen = sizeof(augmented_args->saddr); in sys_enter_sendto()
168 probe_read(&augmented_args->saddr, socklen, sockaddr_arg); in sys_enter_sendto()
/tools/testing/selftests/bpf/prog_tests/
Dqueue_stack_map.c54 pkt_v4.iph.saddr = vals[i] * 5; in test_queue_stack_map_by_type()
57 pkt_v4.iph.saddr = vals[MAP_SIZE - 1 - i] * 5; in test_queue_stack_map_by_type()
91 pkt_v4.iph.saddr = 0; in test_queue_stack_map_by_type()
/tools/testing/selftests/bpf/
Dtest_iptunnel_common.h25 } saddr; member
Dtest_flow_dissector.c178 iph->saddr = src; in build_ipv4_header()
206 memcpy(&ip6h->saddr, &src->sin6_addr, sizeof(ip6h->saddr)); in build_ipv6_header()
215 int num_u16 = sizeof(iph->saddr); /* halfwords: twice byte len */ in build_udp_v4_csum()
217 pseudo_sum = add_csum_hword((void *) &iph->saddr, num_u16); in build_udp_v4_csum()
228 int num_u16 = sizeof(ip6h->saddr); /* halfwords: twice byte len */ in build_udp_v6_csum()
230 pseudo_sum = add_csum_hword((void *) &ip6h->saddr, num_u16); in build_udp_v6_csum()
Dtest_queue_stack_map.h52 err = bpf_map_push_elem(&map_out, &iph->saddr, 0); in _test()
/tools/testing/selftests/networking/timestamping/
Dtxtimestamp.c191 static void print_pktinfo(int family, int ifindex, void *saddr, void *daddr) in print_pktinfo() argument
197 saddr ? inet_ntop(family, saddr, sa, sizeof(sa)) : "unknown", in print_pktinfo()
344 iph->saddr = daddr.sin_addr.s_addr; /* set for udp csum calc */ in fill_header_ipv4()
364 ip6h->saddr = daddr6.sin6_addr; in fill_header_ipv6()
/tools/testing/selftests/cgroup/
Dtest_memcontrol.c824 struct sockaddr_in6 saddr = { 0 }; in tcp_server() local
825 socklen_t slen = sizeof(saddr); in tcp_server()
831 saddr.sin6_family = AF_INET6; in tcp_server()
832 saddr.sin6_addr = in6addr_any; in tcp_server()
833 saddr.sin6_port = htons(srv_args->port); in tcp_server()
842 if (bind(sk, (struct sockaddr *)&saddr, slen)) { in tcp_server()

12