/samples/bpf/ |
D | sock_example.h | 16 int sock; in open_raw_sock() local 18 sock = socket(PF_PACKET, SOCK_RAW | SOCK_NONBLOCK | SOCK_CLOEXEC, htons(ETH_P_ALL)); in open_raw_sock() 19 if (sock < 0) { in open_raw_sock() 28 if (bind(sock, (struct sockaddr *)&sll, sizeof(sll)) < 0) { in open_raw_sock() 30 close(sock); in open_raw_sock() 34 return sock; in open_raw_sock()
|
D | sockex1_user.c | 16 int i, sock; in main() local 27 sock = open_raw_sock("lo"); in main() 29 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd, in main()
|
D | sockex2_user.c | 23 int i, sock; in main() local 35 sock = open_raw_sock("lo"); in main() 37 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd, in main()
|
D | xdp_router_ipv4_user.c | 28 int sock, sock_arp, flags = XDP_FLAGS_UPDATE_IF_NOEXIST; variable 66 close(sock); in close_and_exit() 92 static int recv_msg(struct sockaddr_nl sock_addr, int sock) in recv_msg() argument 100 len = recv(sock, buf_ptr, sizeof(buf) - nll, 0); in recv_msg() 316 int sock, seq = 0; in get_route_table() local 328 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in get_route_table() 329 if (sock < 0) { in get_route_table() 335 if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) { in get_route_table() 354 ret = sendmsg(sock, &msg, 0); in get_route_table() 361 nll = recv_msg(sa, sock); in get_route_table() [all …]
|
D | fds_example.c | 112 int fd, sock, ret; in bpf_do_prog() local 128 sock = open_raw_sock("lo"); in bpf_do_prog() 129 assert(sock > 0); in bpf_do_prog() 131 ret = setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &fd, sizeof(fd)); in bpf_do_prog() 132 printf("bpf: sock:%d <- fd:%d attached ret:(%d,%s)\n", sock, fd, in bpf_do_prog()
|
D | sockex3_user.c | 36 int i, sock, err, id, key = PARSE_IP; in main() local 55 sock = open_raw_sock("lo"); in main() 57 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd[4], in main()
|
D | sock_example.c | 37 int sock = -1, map_fd, prog_fd, i, key; in test_sock() local 70 sock = open_raw_sock("lo"); in test_sock() 72 if (setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd, in test_sock()
|
/samples/seccomp/ |
D | user-trap.c | 32 static int send_fd(int sock, int fd) in send_fd() argument 53 if (sendmsg(sock, &msg, 0) < 0) { in send_fd() 61 static int recv_fd(int sock) in recv_fd() argument 76 if (recvmsg(sock, &msg, 0) < 0) { in recv_fd()
|
/samples/connector/ |
D | cn_test.c | 22 static struct sock *nls;
|
/samples/qmi/ |
D | qmi_sample_client.c | 471 ret = kernel_connect(sample->qmi.sock, (struct sockaddr *)sq, in qmi_sample_probe()
|