instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'tools/testing/selftests/net/udpgso' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <stddef.h> #include <arpa/inet.h> #include <error.h> #include <errno.h> #include <net/if.h> #include <linux/in.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <netinet/if_ether.h> #include <netinet/ip.h> #include <netinet/ip6.h>...
Linux kernel'inin 'tools/testing/selftests/net/txring_overwrite' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Verify that consecutive sends over packet tx_ring are mirrored * with their original content intact. */ #define _GNU_SOURCE #include <arpa/inet.h> #include <assert.h> #include <error.h> #include <errno.h> #include <fcntl.h> #include <linux/filter.h> #include <linux/if...
Linux kernel'inin 'tools/testing/selftests/net/tcp_port_share' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause // Copyright (c) 2025 Cloudflare, Inc. /* Tests for TCP port sharing (bind bucket reuse). */ #include <arpa/inet.h> #include <net/if.h> #include <sys/ioctl.h> #include <fcntl.h> #include <sched.h> #include <stdlib.h> #include "kselftest_harness.h" #define DST...
Linux kernel'inin 'tools/testing/selftests/net/reuseport_addr_any' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test that sockets listening on a specific address are preferred * over sockets listening on addr_any. */ #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <linux/in.h> #include <linux/unistd.h> #include <stdbool.h> #include <stdio....
Linux kernel'inin 'tools/testing/selftests/net/sk_connect_zero_addr' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <arpa/inet.h> #include <error.h> #include <errno.h> #include <unistd.h> int main(void) { int fd1, fd2, one = 1; struct sockaddr_in6 bind_addr = { .sin6_family = AF_INET6, .sin6_port = htons(20000), .sin6_flowinfo = htonl(0), .sin6_addr = {}, .sin6_scope_id...
Linux kernel'inin 'tools/testing/selftests/net/tun' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <linux/if_tun.h> #include <sys/ioctl.h> #include <sys/socket.h> #include "kselftest_harness.h" #include "tuntap_helpers.h" static...
Linux kernel'inin 'tools/testing/selftests/net/so_incoming_cpu' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ #define _GNU_SOURCE #include <sched.h> #include <fcntl.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/sysinfo.h> #include "kselftest_harness.h" FIXTURE(so_incoming_cpu) { int *servers; union { struct so...
Linux kernel'inin 'tools/testing/selftests/net/hwtstamp_config' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test program for SIOC{G,S}HWTSTAMP * Copyright 2013 Solarflare Communications * Author: Ben Hutchings */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <linux/if.h> #include <linux/ne...
Linux kernel'inin 'tools/testing/selftests/net/fin_ack_lat' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <sys/time.h> #include <unistd.h> static int child_pid; static unsigned lon...
Linux kernel'inin 'tools/testing/selftests/net/socket' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <errno.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include "kselftest.h" struct socket_testcase { int domain; int type; int protocol; /* 0 = valid file descriptor * -fo...
Linux kernel'inin 'tools/testing/selftests/net/proc_net_pktgen' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * proc_net_pktgen: kselftest for /proc/net/pktgen interface * * Copyright (c) 2025 Peter Seiderer <ps.report@gmx.net> * */ #include <errno.h> #include <fcntl.h> #include <stdlib.h> #include <unistd.h> #include "kselftest_harness.h" static const char ctrl_cmd_stop[] = "...
Linux kernel'inin 'tools/testing/selftests/net/so_rcv_listener' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <netdb.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <linux/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #ifndef SO_RCVPRIORITY #define SO_RCVPRIORI...
Linux kernel'inin 'tools/testing/selftests/net/stress_reuseport_listen' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */ /* Test listening on the same port 443 with multiple VIPS. * Each VIP:443 will have multiple sk listening on by using * SO_REUSEPORT. */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <error...
Linux kernel'inin 'tools/testing/selftests/net/udpgso_bench_rx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <arpa/inet.h> #include <error.h> #include <errno.h> #include <limits.h> #include <linux/errqueue.h> #include <linux/if_packet.h> #include <linux/socket.h> #include <linux/sockios.h> #include <net/ethernet.h> #include <net/if.h> #include <netinet/ip...
Linux kernel'inin 'tools/testing/selftests/net/sctp_hello' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> static void set_addr(struct sockaddr_storage *ss, char *ip, char *port, int *len) { if (ss->ss_family == AF_INET) { struct so...
Linux kernel'inin 'tools/testing/selftests/net/reuseaddr_ports_exhausted' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Check if we can fully utilize 4-tuples for connect(). * * Rules to bind sockets to the same port when all ephemeral ports are * exhausted. * * 1. if there are TCP_LISTEN sockets on the port, fail to bind. * 2. if there are sockets without SO_REUSEADDR, fail ...
Linux kernel'inin 'tools/testing/selftests/net/txtimestamp' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014 Google Inc. * Author: willemb@google.com (Willem de Bruijn) * * Test software tx timestamping, including * * - SCHED, SND and ACK timestamps * - RAW, UDP and TCP * - IPv4 and IPv6 * - various packet sizes (to test GSO and TSO) * * Consult the ...
Linux kernel'inin 'tools/testing/selftests/net/so_txtime' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test the SO_TXTIME API * * Takes a stream of { payload, delivery time }[], to be sent across two * processes. Start this program on two separate network namespaces or * connected hosts, one instance in transmit mode and the other in receive * mode using the '-r' optio...
Linux kernel'inin 'tools/testing/selftests/net/ipv6_fragmentation' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Author: Brett A C Sheffield <bacs@librecast.net> * * Kernel selftest for the IPv6 fragmentation regression which affected stable * kernels: * * https://lore.kernel.org/stable/aElivdUXqd1OqgMY@karahi.gladserv.com * * Commit: a18dfa9925b9 ("ipv6: save dontfrag in co...
Linux kernel'inin 'tools/testing/selftests/net/ip_defrag' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <linux/in.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/udp.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #i...
Linux kernel'inin 'tools/testing/selftests/net/tcp_inq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2018 Google Inc. * Author: Soheil Hassas Yeganeh (soheil@google.com) * * Simple example on how to use TCP_INQ and TCP_CM_INQ. */ #define _GNU_SOURCE #include <error.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <pthread.h> #include <stdio...
Linux kernel'inin 'tools/testing/selftests/net/sk_bind_sendto_listen' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <arpa/inet.h> #include <error.h> #include <errno.h> #include <unistd.h> int main(void) { int fd1, fd2, one = 1; struct sockaddr_in6 bind_addr = { .sin6_family = AF_INET6, .sin6_port = htons(20000), .sin6_flowinfo = htonl(0), .sin6_addr = {}, .sin6_scope_id...
Linux kernel'inin 'tools/testing/selftests/net/udpgso_bench_tx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <linux/errqueue.h> #include <linux/net_tstamp.h> #include <netinet/if_ether.h> #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/udp.h> #include <...
Linux kernel'inin 'tools/testing/selftests/net/busy_poller' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <assert.h> #include <errno.h> #include <error.h> #include <fcntl.h> #include <inttypes.h> #include <limits.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <ynl.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/e...
Linux kernel'inin 'tools/testing/selftests/net/psock_snd' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <fcntl.h> #include <limits.h> #include <linux/filter.h> #include <linux/bpf.h> #include <linux/if_packet.h> #include <linux/if_vlan.h> #include <linux/virtio_net.h> #include <net/if.h> #i...
Linux kernel'inin 'tools/testing/selftests/net/reuseport_bpf_cpu' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test functionality of BPF filters with SO_REUSEPORT. This program creates * an SO_REUSEPORT receiver group containing one socket per CPU core. It then * creates a BPF program that will select a socket from this group based * on the core id that receives the packet. Th...
Linux kernel'inin 'tools/testing/selftests/net/tap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <net/if.h> #include <linux/if_tun.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <sys/ioctl.h> #include <sys/s...
Linux kernel'inin 'tools/testing/selftests/net/rxtimestamp' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #include <errno.h> #include <error.h> #include <getopt.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/time.h> #include <sys/socket.h> #include <sys/select.h> #include <sys/ioctl.h> #include <arpa/inet.h> #include <net/if.h> #include <asm/types...
Linux kernel'inin 'tools/testing/selftests/net/skf_net_off' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Open a tun device. * * [modifications: use IFF_NAPI_FRAGS, add sk filter] * * Expects the device to have been configured previously, e.g.: * sudo ip tuntap add name tap1 mode tap * sudo ip link set tap1 up * sudo ip link set dev tap1 addr 02:00:00:00:00:01 * ...
Linux kernel'inin 'tools/testing/selftests/net/bind_wildcard' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ #include <sys/socket.h> #include <netinet/in.h> #include "kselftest_harness.h" static const __u32 in4addr_any = INADDR_ANY; static const __u32 in4addr_loopback = INADDR_LOOPBACK; static const struct in6_addr in6addr_v4mapped_...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/net/psock_lib' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright 2013 Google Inc. * Author: Willem de Bruijn <willemb@google.com> * Daniel Borkmann <dborkman@redhat.com> */ #ifndef PSOCK_LIB_H #define PSOCK_LIB_H #include <sys/types.h> #include <sys/socket.h> #include <string.h> #include <arpa/inet.h> #inc...
Linux kernel'inin 'tools/testing/selftests/net/io_uring_zerocopy_tx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: MIT */ /* based on linux-kernel/tools/testing/selftests/net/msg_zerocopy.c */ #include <assert.h> #include <errno.h> #include <error.h> #include <fcntl.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <un...
Linux kernel'inin 'tools/testing/selftests/net/psock_fanout' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2013 Google Inc. * Author: Willem de Bruijn (willemb@google.com) * * A basic test of packet socket fanout behavior. * * Control: * - create fanout fails as expected with illegal flag combinations * - join fanout fails as expected with diverging type...
Linux kernel'inin 'tools/testing/selftests/net/reuseport_bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Test functionality of BPF filters for SO_REUSEPORT. The tests below will use * a BPF program (both classic and extended) to read the first word from an * incoming packet (expected to be in network byte-order), calculate a modulus * of that number, and then dispatch the packet to the Nth socket using the ...
Linux kernel'inin 'tools/testing/selftests/net/msg_zerocopy' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* Evaluate MSG_ZEROCOPY * * Send traffic between two processes over one of the supported * protocols and modes: * * PF_INET/PF_INET6 * - SOCK_STREAM * - SOCK_DGRAM * - SOCK_DGRAM with UDP_CORK * - SOCK_RAW * - SOCK_RAW with IP_HDRINCL * * PF_PACKET * - SOCK_DGRAM * - SOCK_RAW * * PF_RDS * - SOCK_...
Linux kernel'inin 'tools/testing/selftests/net/reuseport_bpf_numa' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test functionality of BPF filters with SO_REUSEPORT. Same test as * in reuseport_bpf_cpu, only as one socket per NUMA node. */ #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <linux/filter.h> #include <linux/bpf.h> #include <li...
Linux kernel'inin 'tools/testing/selftests/net/netlink-dumps' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <fcntl.h> #include <stdio.h> #include <string.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/types.h> #include <unistd.h> #include <linux/genetlink.h> #include <linux/neighbour.h> #include <linux/netdevice....
Linux kernel'inin 'tools/testing/selftests/net/ip_local_port_range' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause // Copyright (c) 2023 Cloudflare /* Test IP_LOCAL_PORT_RANGE socket option: IPv4 + IPv6, TCP + UDP. * * Tests assume that net.ipv4.ip_local_port_range is [40000, 49999]. * Don't run these directly but with ip_local_port_range.sh script. */ #include <fcntl.h...
Linux kernel'inin 'tools/testing/selftests/net/bind_bhash' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This times how long it takes to bind to a port when the port already * has multiple sockets in its bhash table. * * In the setup(), we populate the port's bhash table with * MAX_THREADS * MAX_CONNECTIONS number of entries. */ #include <unistd.h> #include <stdio.h> #i...
Linux kernel'inin 'tools/testing/selftests/net/icmp_rfc4884' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <arpa/inet.h> #include <error.h> #include <linux/errqueue.h> #include <linux/icmp.h> #include <linux/icmpv6.h> #include <linux/in6.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <netinet/in.h> #include <netinet/udp.h> #include <poll.h> #include <sched.h> #in...
Linux kernel'inin 'tools/testing/selftests/net/ipsec' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ipsec.c - Check xfrm on veth inside a net-ns. * Copyright (c) 2018 Dmitry Safonov */ #define _GNU_SOURCE #include <arpa/inet.h> #include <asm/types.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/limits.h> #include <linux/netlink.h> #includ...
Linux kernel'inin 'tools/testing/selftests/net/tls' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <error.h> #include <fcntl.h> #include <poll.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <linux/tls.h> #include <linux/tcp.h> #include <linux/socket.h> #include <sys/epoll.h> #in...
Linux kernel'inin 'tools/testing/selftests/net/timestamping' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * This program demonstrates how the various time stamping features in * the Linux kernel work. It emulates the behavior of a PTP * implementation in stand-alone master mode by sending PTPv1 Sync * multicasts once every second. It looks for similar packets, but * bey...
Linux kernel'inin 'tools/testing/selftests/net/tcp_fastopen_backup_key' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test key rotation for TFO. * New keys are 'rotated' in two steps: * 1) Add new key as the 'backup' key 'behind' the primary key * 2) Make new key the primary by swapping the backup and primary keys * * The rotation is done in stages using multiple sockets bound * to...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/net/tuntap_helpers' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef _TUNTAP_HELPERS_H #define _TUNTAP_HELPERS_H #include <errno.h> #include <linux/if_packet.h> #include <linux/ipv6.h> #include <linux/virtio_net.h> #include <netinet/in.h> #include <netinet/if_ether.h> #include <netinet/udp.h> #include <stdio.h> #include <stdlib....
Linux kernel'inin 'tools/testing/selftests/net/ipv6_flowlabel_mgr' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO_MGR */ #define _GNU_SOURCE #include <arpa/inet.h> #include <error.h> #include <errno.h> #include <limits.h> #include <linux/in6.h> #include <stdbool.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> ...
Linux kernel'inin 'tools/testing/selftests/net/tcp_mmap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2018 Google Inc. * Author: Eric Dumazet (edumazet@google.com) * * Reference program demonstrating tcp mmap() usage, * and SO_RCVLOWAT hints for receiver. * * Note : NIC with header split is needed to use mmap() on TCP : * Each incoming frame must be a...
Linux kernel'inin 'tools/testing/selftests/net/nat6to4.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * This code is taken from the Android Open Source Project and the author * (Maciej Żenczykowski) has gave permission to relicense it under the * GPLv2. Therefore this program is free software; * You can redistribute it and/or modify it under the terms of the GNU * G...
Linux kernel'inin 'tools/testing/selftests/net/sample_map_ret0.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ #include <linux/bpf.h> #include <bpf/bpf_helpers.h> struct { __uint(type, BPF_MAP_TYPE_HASH); __type(key, __u32); __type(value, long); __uint(max_entries, 2); } htab SEC(".maps"); struct { __uint(type, BPF_MAP_TYPE_ARRAY); __type(key, __u32); __type...
Linux kernel'inin 'tools/testing/selftests/net/reuseport_dualstack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * It is possible to use SO_REUSEPORT to open multiple sockets bound to * equivalent local addresses using AF_INET and AF_INET6 at the same time. If * the AF_INET6 socket has IPV6_V6ONLY set, it's clear which socket should * receive a given incoming packet. However, when...
Linux kernel'inin 'tools/testing/selftests/net/cmsg_sender' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later #include <errno.h> #include <error.h> #include <netdb.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <linux/errqueue.h> #include <linux/icmp.h> #include <linux/icmpv6.h> #include <linux/n...
Linux kernel'inin 'tools/testing/selftests/net/bind_timewait' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ #include <sys/socket.h> #include <netinet/in.h> #include "kselftest_harness.h" FIXTURE(bind_timewait) { struct sockaddr_in addr; socklen_t addrlen; }; FIXTURE_VARIANT(bind_timewait) { __u32 addr_const; }; FIXTURE_VARIANT...
Linux kernel'inin 'tools/testing/selftests/net/sample_ret0.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ #define SEC(name) __attribute__((section(name), used)) /* Sample program which should always load for testing control paths. */ SEC("xdp") int func() { return 0; } ```
Linux kernel'inin 'tools/testing/selftests/net/reuseaddr_conflict' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Test for the regression introduced by * * b9470c27607b ("inet: kill smallest_size and smallest_port") * * If we open an ipv4 socket on a port with reuseaddr we shouldn't reset the tb * when we open the ipv6 conterpart, which is what was happening previously. */ #include <errno.h> #include <error.h> #in...
Linux kernel'inin 'tools/testing/selftests/net/nettest' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* nettest - used for functional tests of networking APIs * * Copyright (c) 2013-2019 David Ahern <dsahern@gmail.com>. All rights reserved. */ #define _GNU_SOURCE #include <features.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/wait.h...
Linux kernel'inin 'tools/testing/selftests/net/psock_tpacket' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2013 Red Hat, Inc. * Author: Daniel Borkmann <dborkman@redhat.com> * Chetan Loke <loke.chetan@gmail.com> (TPACKET_V3 usage example) * * A basic test of packet socket's TPACKET_V1/TPACKET_V2/TPACKET_V3 behavior. * * Control: * Test the setup ...
Linux kernel'inin 'tools/testing/selftests/net/so_netns_cookie' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <sched.h> #include <unistd.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #include <sys/types.h> #include <sys/socket.h> #ifndef SO_NETNS_COOKIE #define SO_NETNS_COOKIE 71 #endif #define pr_err(...
Linux kernel'inin 'tools/testing/selftests/net/ipv6_flowlabel' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO cmsg on send and recv */ #define _GNU_SOURCE #include <arpa/inet.h> #include <asm/byteorder.h> #include <error.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/icmpv6.h> #include <linux/in6.h> #include <stdbool.h> #include <std...
Linux kernel'inin 'tools/testing/selftests/net/ioam6_parser' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * Author: Justin Iurman (justin.iurman@uliege.be) * * IOAM tester for IPv6, see ioam6.sh for details on each test case. */ #include <arpa/inet.h> #include <errno.h> #include <limits.h> #include <linux/const.h> #include <linux/if_ether.h> #include <linux/ioam6.h> #include...
Linux kernel'inin 'tools/testing/selftests/net/tfo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <error.h> #include <fcntl.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netinet/tcp.h> #include <errno.h> static in...
Linux kernel'inin 'tools/testing/selftests/net/epoll_busy_poll' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* Basic per-epoll context busy poll test. * * Only tests the ioctls, but should be expanded to test two connected hosts in * the future */ #define _GNU_SOURCE #include <error.h> #include <errno.h> #include <inttypes.h> #include <limits.h> #include <stdio.h> #inc...
Linux kernel'inin 'tools/testing/selftests/net/can/test_raw_filter' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) /* * Copyright (c) 2011 Volkswagen Group Electronic Research * All rights reserved. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/t...
Linux kernel'inin 'tools/testing/selftests/net/lib/xdp_metadata.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stddef.h> #include <linux/bpf.h> #include <linux/in.h> #include <linux/if_ether.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/udp.h> #include <linux/tcp.h> #include <bpf/bpf_endian.h> #include <bpf/bpf_helpers.h> enum { XDP_PORT = 1, XDP_PROTO = ...
Linux kernel'inin 'tools/testing/selftests/net/lib/xdp_helper' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/mman.h> #include <sys/socket.h> #include <linux/if_xdp.h> #include <linux/if_link.h> #include <net/if.h> #include <inttypes.h> #include "ksft.h" #define UMEM_SZ (1U ...
Linux kernel'inin 'tools/testing/selftests/net/lib/gro' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This testsuite provides conformance testing for GRO coalescing. * * Test cases: * * data_*: * Data packets of the same size and same header setup with correct * sequence numbers coalesce. The one exception being the last data * packet coalesced: it can be smaller...
Linux kernel'inin 'tools/testing/selftests/net/lib/xdp_native.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stddef.h> #include <linux/bpf.h> #include <linux/in.h> #include <linux/if_ether.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/udp.h> #include <bpf/bpf_endian.h> #include <bpf/bpf_helpers.h> #define MAX_ADJST_OFFSET 256 #define MAX_PAYLOAD_LEN 5000 ...
Linux kernel'inin 'tools/testing/selftests/net/lib/csum' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test hardware checksum offload: Rx + Tx, IPv4 + IPv6, TCP + UDP. * * The test runs on two machines to exercise the NIC. For this reason it * is not integrated in kselftests. * * CMD=$((./csum -[46] -[tu] -S $SADDR -D $DADDR -[RT] -r 1 $EXTRA_ARGS)) * * Rx: * * T...
Linux kernel'inin 'tools/testing/selftests/net/lib/xdp_dummy.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define KBUILD_MODNAME "xdp_dummy" #include <linux/bpf.h> #include <bpf/bpf_helpers.h> SEC("xdp") int xdp_dummy_prog(struct xdp_md *ctx) { return XDP_PASS; } SEC("xdp.frags") int xdp_dummy_prog_frags(struct xdp_md *ctx) { return XDP_PASS; } char _license[] SEC("license") =...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/net/lib/ksft' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #if !defined(__NET_KSFT_H__) #define __NET_KSFT_H__ #include <stdio.h> #include <stdlib.h> #include <unistd.h> static inline void ksft_ready(void) { const char msg[7] = "ready\n"; char *env_str; int fd; env_str = getenv("KSFT_READY_FD"); if (env_str) { fd = atoi(env...
Linux kernel'inin 'tools/testing/selftests/net/mptcp/mptcp_connect' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <limits.h> #include <fcntl.h> #include <string.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <signal.h> #include <unistd.h> #include <time.h> ...
Linux kernel'inin 'tools/testing/selftests/net/mptcp/pm_nl_ctl' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <error.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <limits.h> #include <sys/socket.h> #include <sys/types.h> #include <arpa/inet.h> #include <net/if.h> #include <linux/rtnetlink.h...
Linux kernel'inin 'tools/testing/selftests/net/mptcp/mptcp_sockopt' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <string.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <time.h...
Linux kernel'inin 'tools/testing/selftests/net/mptcp/mptcp_inq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <string.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <unistd...
Linux kernel'inin 'tools/testing/selftests/net/mptcp/mptcp_diag' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2025, Kylin Software */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <linux/compiler.h> #include <linux/inet_diag.h> #includ...
Linux kernel'inin 'tools/testing/selftests/net/netfilter/nf_queue' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <stdbool.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <time.h> #include <arpa/inet.h> #include <libmnl/libmnl.h> #include <linux/netfilter.h> #include <linux/netfilter/nfnetlink.h> #i...
Linux kernel'inin 'tools/testing/selftests/net/netfilter/connect_close' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <string.h> #include <unistd.h> #include <signal.h> #include <arpa/inet.h> #include <sys/socket.h> #define PORT 12345 #define RUNTIME 10 static struct { unsigned int timeout; unsigned int port; } opts = { ....
Linux kernel'inin 'tools/testing/selftests/net/netfilter/conntrack_reverse_clash' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Needs something like: * * iptables -t nat -A POSTROUTING -o nomatch -j MASQUERADE * * so NAT engine attaches a NAT null-binding to each connection. * * With unmodified kernels, child or parent will exit with * "Port number changed" error, even though no port transla...
Linux kernel'inin 'tools/testing/selftests/net/netfilter/audit_logread' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <poll.h> #include <signal.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <unistd.h> #include <linux/audit.h> #include <linux/netlink.h> static...
Linux kernel'inin 'tools/testing/selftests/net/netfilter/conntrack_dump_flush' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <time.h> #include <libmnl/libmnl.h> #include <netinet/ip.h> #include <linux/netlink.h> #include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink_conntrack.h> #include <linux/netfilter/nf_conntrack_tcp.h> #include "kselftest_harnes...
Linux kernel'inin 'tools/testing/selftests/net/netfilter/udpclash' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Usage: ./udpclash <IP> <PORT> * * Emit THREAD_COUNT UDP packets sharing the same saddr:daddr pair. * * This mimics DNS resolver libraries that emit A and AAAA requests * in parallel. * * This exercises conntrack clash resolution logic added and later * refined in * ...
Linux kernel'inin 'tools/testing/selftests/net/netfilter/sctp_collision' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { struct sockaddr_in saddr = {}, daddr = {}; socklen_t len = sizeof(daddr); struct timeval tv = {25, 0}; char buf[] = "hello"; int sd, re...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/diag_uid' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ #define _GNU_SOURCE #include <sched.h> #include <unistd.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <linux/sock_diag.h> #include <linux/unix_diag.h> #include <sys/socket.h> #include <sys/stat.h> #includ...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/scm_rights' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ #define _GNU_SOURCE #include <sched.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include "kselftest_harness.h" FIXTURE(scm_rights) { int fd...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/scm_inq' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright 2025 Google LLC */ #include <linux/sockios.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/types.h> #include "kselftest_harness.h" #define NR_CHUNKS 100 #define MSG_LEN 256 FIXTURE(scm_inq) { int fd[2]; }; FIXTURE_VARIANT(scm_inq) { int type;...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/msg_oob' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ #include <fcntl.h> #include <string.h> #include <unistd.h> #include <netinet/in.h> #include <sys/epoll.h> #include <sys/ioctl.h> #include <sys/signalfd.h> #include <sys/socket.h> #include "kselftest_harness.h" #define BUF_SZ...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/unix_connreset' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Selftest for AF_UNIX socket close and ECONNRESET behaviour. * * This test verifies: * 1. SOCK_STREAM returns EOF when the peer closes normally. * 2. SOCK_STREAM returns ECONNRESET if peer closes with unread data. * 3. SOCK_SEQPACKET returns EOF when the peer closes...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/scm_pidfd' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 OR MIT #define _GNU_SOURCE #include <error.h> #include <limits.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <linux/socket.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/un.h> #include <sys/signal.h> #...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/so_peek_off' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright 2025 Google LLC */ #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include "../../kselftest_harness.h" FIXTURE(so_peek_off) { int fd[2]; /* 0: sender, 1: receiver */ }; FIXTURE_VARIANT(so_peek_off) { int type; }; FIXTURE_VARIANT_ADD(so_peek_...
Linux kernel'inin 'tools/testing/selftests/net/af_unix/unix_connect' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <sched.h> #include <stddef.h> #include <stdio.h> #include <unistd.h> #include <sys/socket.h> #include <sys/un.h> #include "kselftest_harness.h" FIXTURE(unix_connect) { int server, client; int family; }; FIXTURE_VARIANT(unix_connect) { int ty...
Linux kernel'inin 'tools/testing/selftests/net/bench/page_pool/bench_page_pool_simple' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Benchmark module for page_pool. * */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/interrupt.h> #include <linux/limits.h> #include <linux/module.h> #include <linux/mutex.h> #include <net/page_pool/helpers.h> #include "time_bench.h" static int verbos...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/net/bench/page_pool/time_bench' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Benchmarking code execution time inside the kernel * * Copyright (C) 2014, Red Hat, Inc., Jesper Dangaard Brouer * for licensing details see kernel-base/COPYING */ #ifndef _LINUX_TIME_BENCH_H #define _LINUX_TIME_BENCH_H /* Main structure used for recording a ...
Linux kernel'inin 'tools/testing/selftests/net/bench/page_pool/time_bench' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Benchmarking code execution time inside the kernel * * Copyright (C) 2014, Red Hat, Inc., Jesper Dangaard Brouer */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/time.h> #include <linux/perf_event.h> /* perf_event_create_ke...
Linux kernel'inin 'tools/testing/selftests/net/ovpn/ovpn-cli' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* OpenVPN data channel accelerator * * Copyright (C) 2020-2025 OpenVPN, Inc. * * Author: Antonio Quartulli <antonio@openvpn.net> */ #include <stdint.h> #include <stdio.h> #include <inttypes.h> #include <stdbool.h> #include <string.h> #include <errno.h> #include <unistd...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/restore' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ /* This is over-simplified TCP_REPAIR for TCP_ESTABLISHED sockets * It tests that TCP-AO enabled connection can be restored. * For the proper socket repair see: * https://github.com/checkpoint-restore/criu/blob/criu-dev/soccr/soc...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/bench-lookups' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <arpa/inet.h> #include <inttypes.h> #include <math.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include "../../../../include/linux/bits.h" #include "../../../../include/linux/kernel.h" #include "aolib.h" #...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/rst' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * The test checks that both active and passive reset have correct TCP-AO * signature. An "active" reset (abort) here is procured from closing * listen() socket with non-accepted connections in the queue: * inet_csk_listen_stop() => inet_child_forget() => * ...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/icmps-accept' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Selftest that verifies that incomping ICMPs are ignored, * the TCP connection stays alive, no hard or soft errors get reported * to the usespace and the counter for ignored ICMPs is updated. * * RFC5925, 7.8: * >> A TCP-AO implementation MUST default to ignore incomin...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/seq-ext' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Check that after SEQ number wrap-around: * 1. SEQ-extension has upper bytes set * 2. TCP connection is alive and no TCPAOBad segments * In order to test (2), the test doesn't just adjust seq number for a queue * on a connected socket, but migrates it to another sk+port nu...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/connect' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <inttypes.h> #include "aolib.h" static void *server_fn(void *arg) { int sk, lsk; ssize_t bytes; lsk = test_listen_socket(this_ip_addr, test_server_port, 1); if (test_add_key(lsk, DEFAULT_TEST_PASSWORD, this_ip_dest, ...
Linux kernel'inin 'tools/testing/selftests/net/tcp_ao/connect-deny' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Author: Dmitry Safonov <dima@arista.com> */ #include <inttypes.h> #include "aolib.h" #define fault(type) (inj == FAULT_ ## type) static volatile int sk_pair; static inline int test_add_key_maclen(int sk, const char *key, uint8_t maclen, union tcp_addr in_addr, uin...