/tools/testing/selftests/bpf/ |
D | tcp_client.py | 11 def read(sock, n): argument 15 try: s = sock.recv(rem) 20 def send(sock, s): argument 24 try: n = sock.send(s) 35 sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) variable 37 sock.connect(('localhost', serverPort)) 47 sock.settimeout(1); 48 n = send(sock, buf) 49 n = read(sock, 500)
|
D | tcp_server.py | 11 def read(sock, n): argument 15 try: s = sock.recv(rem) 20 def send(sock, s): argument 24 try: n = sock.send(s) 66 for sock in readyRead: 67 if sock == serverSocket: 72 sock.settimeout(1); 73 s = read(sock, 1000) 74 n = send(sock, buf) 75 sock.close()
|
/tools/testing/selftests/vm/ |
D | map_populate.c | 33 static int parent_f(int sock, unsigned long *smap, int child) in parent_f() argument 37 ret = read(sock, &status, sizeof(int)); in parent_f() 44 ret = write(sock, &status, sizeof(int)); in parent_f() 53 static int child_f(int sock, unsigned long *smap, int fd) in child_f() argument 63 ret = write(sock, &buf, sizeof(int)); in child_f() 66 ret = read(sock, &buf, sizeof(int)); in child_f() 77 int sock[2], child, ret; in main() local 96 ret = socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sock); in main() 103 ret = close(sock[0]); in main() 106 return parent_f(sock[1], smap, child); in main() [all …]
|
/tools/lib/bpf/ |
D | netlink.c | 35 int sock; in libbpf_netlink_open() local 40 sock = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); in libbpf_netlink_open() 41 if (sock < 0) in libbpf_netlink_open() 44 if (setsockopt(sock, SOL_NETLINK, NETLINK_EXT_ACK, in libbpf_netlink_open() 49 if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) { in libbpf_netlink_open() 55 if (getsockname(sock, (struct sockaddr *)&sa, &addrlen) < 0) { in libbpf_netlink_open() 66 return sock; in libbpf_netlink_open() 69 close(sock); in libbpf_netlink_open() 73 static int bpf_netlink_recv(int sock, __u32 nl_pid, int seq, in bpf_netlink_recv() argument 85 len = recv(sock, buf, sizeof(buf), 0); in bpf_netlink_recv() [all …]
|
D | libbpf.h | 429 int libbpf_nl_get_link(int sock, unsigned int nl_pid, 431 int libbpf_nl_get_class(int sock, unsigned int nl_pid, int ifindex, 433 int libbpf_nl_get_qdisc(int sock, unsigned int nl_pid, int ifindex, 435 int libbpf_nl_get_filter(int sock, unsigned int nl_pid, int ifindex, int handle,
|
/tools/testing/selftests/networking/timestamping/ |
D | timestamping.c | 118 static void sendpacket(int sock, struct sockaddr *addr, socklen_t addr_len) in sendpacket() argument 123 res = sendto(sock, sync, sizeof(sync), 0, in sendpacket() 136 int sock, int recvmsg_flags, in printpacket() argument 242 if (ioctl(sock, SIOCGSTAMP, &tv)) in printpacket() 250 if (ioctl(sock, SIOCGSTAMPNS, &ts)) in printpacket() 259 static void recvpacket(int sock, int recvmsg_flags, in recvpacket() argument 282 res = recvmsg(sock, &msg, recvmsg_flags|MSG_DONTWAIT); in recvpacket() 290 sock, recvmsg_flags, in recvpacket() 306 int sock; in main() local 354 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); in main() [all …]
|
D | hwtstamp_config.c | 91 int sock; in main() local 108 sock = socket(AF_INET, SOCK_DGRAM, 0); in main() 109 if (sock < 0) { in main() 117 if (ioctl(sock, (argc == 2) ? SIOCGHWTSTAMP : SIOCSHWTSTAMP, &ifr)) { in main()
|
/tools/testing/selftests/net/ |
D | psock_tpacket.c | 71 void (*walk)(int sock, struct ring *ring); 101 int ret, sock = socket(PF_PACKET, SOCK_RAW, 0); in pfsocket() local 102 if (sock == -1) { in pfsocket() 107 ret = setsockopt(sock, SOL_PACKET, PACKET_VERSION, &ver, sizeof(ver)); in pfsocket() 113 return sock; in pfsocket() 220 static void walk_v1_v2_rx(int sock, struct ring *ring) in walk_v1_v2_rx() argument 232 pfd.fd = sock; in walk_v1_v2_rx() 342 static void __v1_v2_set_packet_loss_discard(int sock) in __v1_v2_set_packet_loss_discard() argument 346 ret = setsockopt(sock, SOL_PACKET, PACKET_LOSS, (void *) &discard, in __v1_v2_set_packet_loss_discard() 369 static void walk_tx(int sock, struct ring *ring) in walk_tx() argument [all …]
|
/tools/testing/selftests/bpf/progs/ |
D | test_tcp_estats.c | 74 struct sock { struct 82 struct sock sk; 93 static inline struct inet_sock *inet_sk(const struct sock *sk) in inet_sk() 160 struct sock *sock; member 212 struct sock *sk) in tcp_estats_conn_id_init() 227 static __always_inline void tcp_estats_init(struct sock *sk, in tcp_estats_init() 236 static __always_inline void send_basic_event(struct sock *sk, in send_basic_event() 250 if (!arg->sock) in _dummy_tracepoint() 253 send_basic_event(arg->sock, TCP_ESTATS_TX_RESET); in _dummy_tracepoint()
|
D | test_btf_nokv.c | 22 struct sock *sock; member 31 if (!arg->sock) in test_long_fname_2()
|
D | test_btf_haskv.c | 24 struct sock *sock; member 33 if (!arg->sock) in test_long_fname_2()
|
D | test_btf_newkv.c | 32 struct sock *sock; member 41 if (!arg->sock) in test_long_fname_2()
|
/tools/perf/util/ |
D | cpumap.h | 28 static inline int cpu_map__socket(struct perf_cpu_map *sock, int s) in cpu_map__socket() argument 30 if (!sock || s > sock->nr || s < 0) in cpu_map__socket() 32 return sock->map[s]; in cpu_map__socket()
|
/tools/bpf/bpftool/ |
D | net.c | 157 static int show_dev_tc_bpf(int sock, unsigned int nl_pid, in show_dev_tc_bpf() argument 169 ret = libbpf_nl_get_class(sock, nl_pid, dev->ifindex, in show_dev_tc_bpf() 175 ret = libbpf_nl_get_qdisc(sock, nl_pid, dev->ifindex, in show_dev_tc_bpf() 184 ret = libbpf_nl_get_filter(sock, nl_pid, dev->ifindex, in show_dev_tc_bpf() 194 ret = libbpf_nl_get_filter(sock, nl_pid, dev->ifindex, handle, in show_dev_tc_bpf() 201 ret = libbpf_nl_get_filter(sock, nl_pid, dev->ifindex, handle, in show_dev_tc_bpf() 208 ret = libbpf_nl_get_filter(sock, nl_pid, dev->ifindex, handle, in show_dev_tc_bpf() 385 int i, sock, ret, filter_idx = -1; in do_show() local 402 sock = libbpf_netlink_open(&nl_pid); in do_show() 403 if (sock < 0) { in do_show() [all …]
|
/tools/usb/usbip/src/ |
D | usbipd.c | 386 int sock; in listen_all_addrinfo() local 390 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); in listen_all_addrinfo() 391 if (sock < 0) { in listen_all_addrinfo() 397 usbip_net_set_reuseaddr(sock); in listen_all_addrinfo() 398 usbip_net_set_nodelay(sock); in listen_all_addrinfo() 401 usbip_net_set_v6only(sock); in listen_all_addrinfo() 403 ret = bind(sock, ai->ai_addr, ai->ai_addrlen); in listen_all_addrinfo() 407 close(sock); in listen_all_addrinfo() 411 ret = listen(sock, SOMAXCONN); in listen_all_addrinfo() 415 close(sock); in listen_all_addrinfo() [all …]
|
/tools/testing/selftests/cgroup/ |
D | test_memcontrol.c | 902 long current, sock; in tcp_client() local 908 sock = cg_read_key_long(cgroup, "memory.stat", "sock "); in tcp_client() 910 if (current < 0 || sock < 0) in tcp_client() 913 if (current < sock) in tcp_client() 916 if (values_close(current, sock, 10)) { in tcp_client()
|
/tools/bpf/bpftool/Documentation/ |
D | bpftool-btf.rst | 94 'sock' type_id=4 bits_offset=64 97 [5] FWD 'sock' fwd_kind=union
|
D | bpftool-prog.rst | 40 | **cgroup/sock** | **cgroup/dev** | **lwt_in** | **lwt_out** | **lwt_xmit** |
|
/tools/bpf/ |
D | bpf_dbg.c | 500 int sock, ret, i; in bpf_runnable() local 506 sock = socket(AF_INET, SOCK_DGRAM, 0); in bpf_runnable() 507 if (sock < 0) { in bpf_runnable() 511 ret = setsockopt(sock, SOL_SOCKET, SO_ATTACH_FILTER, &bpf, sizeof(bpf)); in bpf_runnable() 512 close(sock); in bpf_runnable()
|
/tools/bpf/bpftool/bash-completion/ |
D | bpftool | 385 xdp perf_event cgroup/skb cgroup/sock \
|