├── servers ├── .gitignore ├── dysfunctional-listen-not-accept-tcp.c ├── dysfunctional-listen-not-accept-unix.c ├── Makefile ├── dysfunctional-accept-not-read-unix.c ├── dysfunctional-accept-read-not-write-unix.c ├── dysfunctional-accept-read-write-not-close-unix.c ├── functional-server-tcp.c └── functional-server-unix.c ├── .gitignore ├── ebpf ├── README.md ├── rust-toolchain.toml ├── bindings ├── Cargo.toml ├── Makefile ├── Cargo.lock ├── src │ └── main.rs └── LICENSE ├── shared ├── Cargo.toml └── src │ └── lib.rs ├── Cargo.toml ├── q ├── Cargo.toml └── src │ └── main.rs ├── Makefile ├── README.md ├── LICENSE └── Cargo.lock /servers/.gitignore: -------------------------------------------------------------------------------- 1 | *exec* -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target* 2 | ebpf/target* 3 | .idea* -------------------------------------------------------------------------------- /ebpf/README.md: -------------------------------------------------------------------------------- 1 | # qebpf 2 | 3 | Extended BPF bytecode and probes. -------------------------------------------------------------------------------- /ebpf/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | -------------------------------------------------------------------------------- /ebpf/bindings: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | KVER=$(uname -r) 3 | HEADERS=$(find /lib/modules/$KVER/build/include/net/ -type f -name '*.h') 4 | cat $HEADERS > /tmp/linux.h 5 | bindgen /tmp/linux.h -o src/binding.rs 6 | -------------------------------------------------------------------------------- /shared/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "shared" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | aya = { version = ">=0.11", optional = true } 8 | 9 | [lib] 10 | path = "src/lib.rs" 11 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | 2 | [workspace] 3 | members = ["shared", "q"] 4 | 5 | [profile.dev] 6 | opt-level = 3 7 | debug = false 8 | debug-assertions = false 9 | overflow-checks = false 10 | lto = true 11 | panic = "abort" 12 | incremental = false 13 | codegen-units = 1 14 | rpath = false 15 | 16 | [profile.release] 17 | lto = true 18 | panic = "abort" 19 | codegen-units = 1 -------------------------------------------------------------------------------- /ebpf/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ebpf" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | aya-bpf = { git = "https://github.com/aya-rs/aya", tag = "aya-log-v0.1.13" } 8 | aya-log-ebpf = { git = "https://github.com/aya-rs/aya", tag = "aya-log-v0.1.13" } 9 | shared = { path = "../shared" } 10 | 11 | [[bin]] 12 | name = "qprobe" 13 | path = "src/main.rs" 14 | 15 | [workspace] 16 | members = [] -------------------------------------------------------------------------------- /q/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "userspace" 3 | version = "0.1.0" 4 | edition = "2021" 5 | publish = false 6 | 7 | [dependencies] 8 | aya = { git = "https://github.com/aya-rs/aya", branch = "main", features = [ 9 | "async_tokio", 10 | ] } 11 | aya-log = { git = "https://github.com/aya-rs/aya", branch = "main" } 12 | shared = { path = "../shared" } 13 | anyhow = "1" 14 | clap = { version = "4.1", features = ["derive"] } 15 | env_logger = "0.10" 16 | log = "0.4" 17 | tokio = { version = "1.25", features = [ 18 | "macros", 19 | "rt", 20 | "rt-multi-thread", 21 | "net", 22 | "signal", 23 | ] } 24 | 25 | [[bin]] 26 | name = "q" 27 | path = "src/main.rs" 28 | -------------------------------------------------------------------------------- /shared/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #![no_std] 16 | -------------------------------------------------------------------------------- /ebpf/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright © 2022 Kris Nóva 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | CC = clang 16 | 17 | default: compile ## Default to compile 18 | 19 | .PHONY: clean 20 | clean: ## Clean objects 21 | rm -rvf target/* 22 | 23 | compile: ## Compile local eBPF code 24 | cargo +nightly build --release --target=bpfel-unknown-none -Z build-std=core 25 | 26 | .PHONY: bindings 27 | bindings: ## Use aya-tool to build kernel header bindings 28 | @#TODO add a check for 'aya-tool' and 'bindgen' 29 | cargo install bindgen-cli 30 | cargo install --git https://github.com/aya-rs/aya -- aya-tool 31 | aya-tool generate task_struct > src/binding.rs 32 | 33 | .PHONY: help 34 | help: ## Show help messages for make targets 35 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {//printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' 36 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright © 2023 Kris Nóva 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | CC = clang 16 | 17 | default: compile servers ## Default to compile 18 | 19 | .PHONY: clean 20 | clean: ## Clean objects 21 | cd ebpf && make clean 22 | cd servers && make clean 23 | rm -vrf target/* 24 | rm -vf *.o 25 | rm -vf *.ll 26 | 27 | .PHONY: ebpf 28 | ebpf: ## Compile eBPF probe code 29 | cd ebpf && make compile 30 | 31 | compile: ebpf ## Compile local rust code 32 | cargo build --target=x86_64-unknown-linux-musl 33 | 34 | install: ## Install into $PATH 35 | cargo install --path q --target=x86_64-unknown-linux-musl 36 | 37 | servers: ## Compile "servers" code 38 | cd servers && make compile 39 | 40 | .PHONY: help 41 | help: ## Show help messages for make targets 42 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {//printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' 43 | -------------------------------------------------------------------------------- /servers/dysfunctional-listen-not-accept-tcp.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #define PORT 9074 20 | #define BUFFER_SIZE 1024 21 | 22 | int main() { 23 | int sockfd = socket(AF_INET, SOCK_STREAM, 0); 24 | if (sockfd == -1) { 25 | perror("webserver (socket)"); 26 | return 1; 27 | } 28 | 29 | struct sockaddr_in host_addr; 30 | int host_addrlen = sizeof(host_addr); 31 | 32 | host_addr.sin_family = AF_INET; 33 | host_addr.sin_port = htons(PORT); 34 | host_addr.sin_addr.s_addr = htonl(INADDR_ANY); 35 | 36 | struct sockaddr_in client_addr; 37 | 38 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 39 | perror("webserver (bind)"); 40 | return 1; 41 | } 42 | 43 | if (listen(sockfd, SOMAXCONN) != 0) { 44 | perror("webserver (listen)"); 45 | return 1; 46 | } 47 | for (;;) {} 48 | return 0; 49 | } -------------------------------------------------------------------------------- /servers/dysfunctional-listen-not-accept-unix.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define SOCK "/var/run/q-server.sock" 23 | #define BUFFER_SIZE 1024 24 | 25 | int main() { 26 | unlink(SOCK); 27 | 28 | int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); 29 | if (sockfd == -1) { 30 | perror("webserver (socket)"); 31 | return 1; 32 | } 33 | 34 | struct sockaddr_un host_addr; 35 | int host_addrlen = sizeof(host_addr); 36 | 37 | host_addr.sun_family = AF_UNIX; 38 | strncpy(host_addr.sun_path, SOCK, sizeof(host_addr.sun_path) - 1); 39 | 40 | struct sockaddr_in client_addr; 41 | int client_addrlen = sizeof(client_addr); 42 | 43 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 44 | perror("webserver (bind)"); 45 | return 1; 46 | } 47 | 48 | if (listen(sockfd, SOMAXCONN) != 0) { 49 | perror("webserver (listen)"); 50 | return 1; 51 | } 52 | 53 | for (;;) {} 54 | return 0; 55 | } -------------------------------------------------------------------------------- /servers/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright © 2023 Kris Nóva 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | CC = clang 16 | 17 | default: compile ## Default to compile 18 | 19 | .PHONY: clean 20 | clean: ## Clean objects 21 | rm -vf *exec* 22 | rm -vf *.o 23 | rm -vf *.ll 24 | 25 | compile: ## Compile local code 26 | @echo " -> Compile Servers" 27 | # TCP 28 | ${CC} functional-server-tcp.c -o functional-server-tcp-exec 29 | ${CC} dysfunctional-listen-not-accept-tcp.c -o dysfunctional-listen-not-accept-tcp-exec 30 | 31 | # UDS 32 | ${CC} functional-server-unix.c -o functional-server-unix-exec 33 | ${CC} dysfunctional-listen-not-accept-unix.c -o dysfunctional-listen-not-accept-unix-exec 34 | ${CC} dysfunctional-accept-not-read-unix.c -o dysfunctional-accept-not-read-unix-exec 35 | ${CC} dysfunctional-accept-read-not-write-unix.c -o dysfunctional-accept-read-not-write-unix-exec 36 | ${CC} dysfunctional-accept-read-write-not-close-unix.c -o dysfunctional-accept-read-write-not-close-unix-exec 37 | @echo " -> Compile okay!" 38 | 39 | .PHONY: help 40 | help: ## Show help messages for make targets 41 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {//printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # q 2 | 3 | A smol 🤏 static rust binary which can be used to surface kernel queueing metrics with eBPF kprobes. 4 | 5 | The easiest metrics to surface are anything found in the [sock](https://www.kernel.org/doc/html/v6.2/networking/kapi.html#c.sock) API. 6 | 7 | The following 'accept queues' are currently instrumented. 8 | 9 | - [X] TCP/IPv4 10 | - [X] TCP/IPv6 11 | - [ ] UDP (Connectionless) 12 | - [ ] Unix domain 13 | 14 | ### Building 15 | 16 | ```bash 17 | # Compile the eBPF probe, embed the probe into the binary, compile and install the static binary 18 | make ebpf install 19 | ``` 20 | 21 | ### Running 22 | 23 | ```bash 24 | sudo q 25 | ``` 26 | 27 | ### Observing The Linux Accept Queue 28 | 29 | Execute the `dysfunctional-listen-not-accept-tcp-exec` server and send curl requests to `localhost:9064`. 30 | 31 | Notice that the requests will accumulate in the accept queue even once the client has been killed. The only way to "flush" the queue is to terminate the server. I am currently unsure 32 | if Linux provides another way to clean up these orphaned connections. 33 | 34 | ```bash 35 | [2023-03-13T04:50:35Z INFO q] Success! Loaded eBPF probe into kernel 36 | [2023-03-13T04:50:35Z INFO q] --> Attached: kprobe__tcp_conn_request 37 | [2023-03-13T04:50:35Z INFO q] --> Attached: kprobe__inet_csk_accept 38 | [2023-03-13T04:50:35Z INFO q] Waiting for Ctrl-C... 39 | [2023-03-13T04:50:44Z INFO qprobe] AF_INET 'accept queue' qlen: 8, qmax: 4096, src address: 0.0.0.0, dest address: 0.0.0.0 40 | [2023-03-13T04:50:48Z INFO qprobe] AF_INET 'accept queue' qlen: 9, qmax: 4096, src address: 0.0.0.0, dest address: 0.0.0.0 41 | [2023-03-13T04:50:50Z INFO qprobe] AF_INET 'accept queue' qlen: 10, qmax: 4096, src address: 0.0.0.0, dest address: 0.0.0.0 42 | [2023-03-13T04:50:51Z INFO qprobe] AF_INET 'accept queue' qlen: 11, qmax: 4096, src address: 0.0.0.0, dest address: 0.0.0.0 43 | ``` 44 | -------------------------------------------------------------------------------- /servers/dysfunctional-accept-not-read-unix.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define SOCK "/var/run/q-server.sock" 23 | #define BUFFER_SIZE 1024 24 | 25 | int main() { 26 | unlink(SOCK); 27 | 28 | int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); 29 | if (sockfd == -1) { 30 | perror("webserver (socket)"); 31 | return 1; 32 | } 33 | 34 | struct sockaddr_un host_addr; 35 | int host_addrlen = sizeof(host_addr); 36 | 37 | host_addr.sun_family = AF_UNIX; 38 | strncpy(host_addr.sun_path, SOCK, sizeof(host_addr.sun_path) - 1); 39 | 40 | struct sockaddr_in client_addr; 41 | int client_addrlen = sizeof(client_addr); 42 | 43 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 44 | perror("webserver (bind)"); 45 | return 1; 46 | } 47 | 48 | if (listen(sockfd, SOMAXCONN) != 0) { 49 | perror("webserver (listen)"); 50 | return 1; 51 | } 52 | 53 | for (;;) { 54 | int newsockfd = accept(sockfd, (struct sockaddr *)&host_addr, 55 | (socklen_t *)&host_addrlen); 56 | if (newsockfd < 0) { 57 | perror("webserver (accept)"); 58 | continue; 59 | } 60 | 61 | int sockn = getsockname(newsockfd, (struct sockaddr *)&client_addr, 62 | (socklen_t *)&client_addrlen); 63 | if (sockn < 0) { 64 | perror("webserver (getsockname)"); 65 | continue; 66 | } 67 | } 68 | 69 | return 0; 70 | } -------------------------------------------------------------------------------- /servers/dysfunctional-accept-read-not-write-unix.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define SOCK "/var/run/q-server.sock" 23 | #define BUFFER_SIZE 1024 24 | 25 | int main() { 26 | char buffer[BUFFER_SIZE]; 27 | unlink(SOCK); 28 | 29 | int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); 30 | if (sockfd == -1) { 31 | perror("webserver (socket)"); 32 | return 1; 33 | } 34 | 35 | struct sockaddr_un host_addr; 36 | int host_addrlen = sizeof(host_addr); 37 | 38 | host_addr.sun_family = AF_UNIX; 39 | strncpy(host_addr.sun_path, SOCK, sizeof(host_addr.sun_path) - 1); 40 | 41 | struct sockaddr_in client_addr; 42 | int client_addrlen = sizeof(client_addr); 43 | 44 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 45 | perror("webserver (bind)"); 46 | return 1; 47 | } 48 | 49 | if (listen(sockfd, SOMAXCONN) != 0) { 50 | perror("webserver (listen)"); 51 | return 1; 52 | } 53 | 54 | for (;;) { 55 | int newsockfd = accept(sockfd, (struct sockaddr *)&host_addr, 56 | (socklen_t *)&host_addrlen); 57 | if (newsockfd < 0) { 58 | perror("webserver (accept)"); 59 | continue; 60 | } 61 | 62 | int sockn = getsockname(newsockfd, (struct sockaddr *)&client_addr, 63 | (socklen_t *)&client_addrlen); 64 | if (sockn < 0) { 65 | perror("webserver (getsockname)"); 66 | continue; 67 | } 68 | 69 | int valread = read(newsockfd, buffer, BUFFER_SIZE); 70 | if (valread < 0) { 71 | perror("webserver (read)"); 72 | continue; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /servers/dysfunctional-accept-read-write-not-close-unix.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define SOCK "/var/run/q-server.sock" 23 | #define BUFFER_SIZE 1024 24 | 25 | int main() { 26 | char buffer[BUFFER_SIZE]; 27 | char resp[] = "HTTP/1.0 200 OK\r\n" 28 | "Server: upstream-basic-server-tcp-c\r\n" 29 | "Content-type: text/html\r\n\r\n" 30 | "Nginx Proxy Test Server\r\n"; 31 | 32 | unlink(SOCK); 33 | 34 | int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); 35 | if (sockfd == -1) { 36 | perror("webserver (socket)"); 37 | return 1; 38 | } 39 | 40 | struct sockaddr_un host_addr; 41 | int host_addrlen = sizeof(host_addr); 42 | 43 | host_addr.sun_family = AF_UNIX; 44 | strncpy(host_addr.sun_path, SOCK, sizeof(host_addr.sun_path) - 1); 45 | 46 | struct sockaddr_in client_addr; 47 | int client_addrlen = sizeof(client_addr); 48 | 49 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 50 | perror("webserver (bind)"); 51 | return 1; 52 | } 53 | 54 | if (listen(sockfd, SOMAXCONN) != 0) { 55 | perror("webserver (listen)"); 56 | return 1; 57 | } 58 | 59 | for (;;) { 60 | int newsockfd = accept(sockfd, (struct sockaddr *)&host_addr, 61 | (socklen_t *)&host_addrlen); 62 | if (newsockfd < 0) { 63 | perror("webserver (accept)"); 64 | continue; 65 | } 66 | 67 | int sockn = getsockname(newsockfd, (struct sockaddr *)&client_addr, 68 | (socklen_t *)&client_addrlen); 69 | if (sockn < 0) { 70 | perror("webserver (getsockname)"); 71 | continue; 72 | } 73 | 74 | int valread = read(newsockfd, buffer, BUFFER_SIZE); 75 | if (valread < 0) { 76 | perror("webserver (read)"); 77 | continue; 78 | } 79 | 80 | int valwrite = write(newsockfd, resp, strlen(resp)); 81 | if (valwrite < 0) { 82 | perror("webserver (write)"); 83 | continue; 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /servers/functional-server-tcp.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define PORT 9074 22 | #define BUFFER_SIZE 1024 23 | 24 | int main() { 25 | char buffer[BUFFER_SIZE]; 26 | char resp[] = "HTTP/1.0 200 OK\r\n" 27 | "Server: upstream-basic-server-tcp-c\r\n" 28 | "Content-type: text/html\r\n\r\n" 29 | "Nginx Proxy Test Server\r\n"; 30 | 31 | int sockfd = socket(AF_INET, SOCK_STREAM, 0); 32 | if (sockfd == -1) { 33 | perror("webserver (socket)"); 34 | return 1; 35 | } 36 | 37 | struct sockaddr_in host_addr; 38 | int host_addrlen = sizeof(host_addr); 39 | 40 | host_addr.sin_family = AF_INET; 41 | host_addr.sin_port = htons(PORT); 42 | host_addr.sin_addr.s_addr = htonl(INADDR_ANY); 43 | 44 | struct sockaddr_in client_addr; 45 | int client_addrlen = sizeof(client_addr); 46 | 47 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 48 | perror("webserver (bind)"); 49 | return 1; 50 | } 51 | 52 | if (listen(sockfd, SOMAXCONN) != 0) { 53 | perror("webserver (listen)"); 54 | return 1; 55 | } 56 | 57 | for (;;) { 58 | int newsockfd = accept(sockfd, (struct sockaddr *)&host_addr, 59 | (socklen_t *)&host_addrlen); 60 | if (newsockfd < 0) { 61 | perror("webserver (accept)"); 62 | continue; 63 | } 64 | 65 | int sockn = getsockname(newsockfd, (struct sockaddr *)&client_addr, 66 | (socklen_t *)&client_addrlen); 67 | if (sockn < 0) { 68 | perror("webserver (getsockname)"); 69 | continue; 70 | } 71 | 72 | int valread = read(newsockfd, buffer, BUFFER_SIZE); 73 | if (valread < 0) { 74 | perror("webserver (read)"); 75 | continue; 76 | } 77 | 78 | char method[BUFFER_SIZE], uri[BUFFER_SIZE], version[BUFFER_SIZE]; 79 | sscanf(buffer, "%s %s %s", method, uri, version); 80 | 81 | int valwrite = write(newsockfd, resp, strlen(resp)); 82 | if (valwrite < 0) { 83 | perror("webserver (write)"); 84 | continue; 85 | } 86 | close(newsockfd); 87 | } 88 | 89 | return 0; 90 | } -------------------------------------------------------------------------------- /q/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | use aya::{include_bytes_aligned, programs::KProbe, Bpf}; 16 | use aya_log::BpfLogger; 17 | use clap::Parser; 18 | use log::{info, warn, LevelFilter}; 19 | use tokio::signal; 20 | 21 | #[derive(Debug, Parser)] 22 | struct Opt {} 23 | 24 | #[tokio::main] 25 | async fn main() -> Result<(), anyhow::Error> { 26 | info!("Initializing 'q'..."); 27 | let _opt = Opt::parse(); 28 | env_logger::builder().filter(None, LevelFilter::Info).init(); 29 | 30 | // Compile the eBPF probe directly into the binary. 31 | // 32 | // The "release" binary is critical here or the symbol offset 33 | // will return an error! Ensure that you are both building a 34 | // --release binary for the eBPF probe as well as referencing 35 | // a release binary for the logger! 36 | let mut bpf = Bpf::load(include_bytes_aligned!( 37 | "../../ebpf/target/bpfel-unknown-none/release/qprobe" 38 | ))?; 39 | info!("Success! Loaded eBPF probe into kernel"); 40 | 41 | if let Err(e) = BpfLogger::init(&mut bpf) { 42 | warn!("failed to initialize eBPF logger: {e}"); 43 | } 44 | 45 | // ============================================================================================= 46 | // q_tcp_conn_request -> kprobe__tcp_conn_request 47 | // 48 | let program: &mut KProbe = bpf.program_mut("q_tcp_conn_request").unwrap().try_into()?; 49 | program.load()?; 50 | program.attach("tcp_conn_request", 0)?; 51 | info!(" --> Attached: kprobe__tcp_conn_request"); 52 | // 53 | // ============================================================================================= 54 | 55 | // ============================================================================================= 56 | // q_inet_csk_accept -> kprobe__inet_csk_accept 57 | // 58 | let program: &mut KProbe = bpf.program_mut("q_inet_csk_accept").unwrap().try_into()?; 59 | program.load()?; 60 | program.attach("inet_csk_accept", 0)?; 61 | info!(" --> Attached: kprobe__inet_csk_accept"); 62 | // 63 | // ============================================================================================= 64 | 65 | info!("Waiting for Ctrl-C..."); 66 | signal::ctrl_c().await?; 67 | info!("Exiting..."); 68 | Ok(()) 69 | } 70 | -------------------------------------------------------------------------------- /servers/functional-server-unix.c: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define SOCK "/var/run/q-server.sock" 23 | #define BUFFER_SIZE 1024 24 | 25 | int main() { 26 | char buffer[BUFFER_SIZE]; 27 | char resp[] = "HTTP/1.0 200 OK\r\n" 28 | "Server: upstream-basic-server-tcp-c\r\n" 29 | "Content-type: text/html\r\n\r\n" 30 | "Nginx Proxy Test Server\r\n"; 31 | 32 | unlink(SOCK); 33 | 34 | int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); 35 | if (sockfd == -1) { 36 | perror("webserver (socket)"); 37 | return 1; 38 | } 39 | 40 | struct sockaddr_un host_addr; 41 | int host_addrlen = sizeof(host_addr); 42 | 43 | host_addr.sun_family = AF_UNIX; 44 | strncpy(host_addr.sun_path, SOCK, sizeof(host_addr.sun_path) - 1); 45 | 46 | struct sockaddr_in client_addr; 47 | int client_addrlen = sizeof(client_addr); 48 | 49 | if (bind(sockfd, (struct sockaddr *)&host_addr, host_addrlen) != 0) { 50 | perror("webserver (bind)"); 51 | return 1; 52 | } 53 | 54 | if (listen(sockfd, SOMAXCONN) != 0) { 55 | perror("webserver (listen)"); 56 | return 1; 57 | } 58 | 59 | for (;;) { 60 | int newsockfd = accept(sockfd, (struct sockaddr *)&host_addr, 61 | (socklen_t *)&host_addrlen); 62 | if (newsockfd < 0) { 63 | perror("webserver (accept)"); 64 | continue; 65 | } 66 | 67 | int sockn = getsockname(newsockfd, (struct sockaddr *)&client_addr, 68 | (socklen_t *)&client_addrlen); 69 | if (sockn < 0) { 70 | perror("webserver (getsockname)"); 71 | continue; 72 | } 73 | 74 | int valread = read(newsockfd, buffer, BUFFER_SIZE); 75 | if (valread < 0) { 76 | perror("webserver (read)"); 77 | continue; 78 | } 79 | 80 | char method[BUFFER_SIZE], uri[BUFFER_SIZE], version[BUFFER_SIZE]; 81 | sscanf(buffer, "%s %s %s", method, uri, version); 82 | 83 | int valwrite = write(newsockfd, resp, strlen(resp)); 84 | if (valwrite < 0) { 85 | perror("webserver (write)"); 86 | continue; 87 | } 88 | 89 | close(newsockfd); 90 | } 91 | return 0; 92 | } -------------------------------------------------------------------------------- /ebpf/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aya-bpf" 7 | version = "0.1.0" 8 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 9 | dependencies = [ 10 | "aya-bpf-bindings", 11 | "aya-bpf-cty", 12 | "aya-bpf-macros", 13 | "rustversion", 14 | ] 15 | 16 | [[package]] 17 | name = "aya-bpf-bindings" 18 | version = "0.1.0" 19 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 20 | dependencies = [ 21 | "aya-bpf-cty", 22 | ] 23 | 24 | [[package]] 25 | name = "aya-bpf-cty" 26 | version = "0.2.1" 27 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 28 | 29 | [[package]] 30 | name = "aya-bpf-macros" 31 | version = "0.1.0" 32 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 33 | dependencies = [ 34 | "proc-macro2", 35 | "quote", 36 | "syn", 37 | ] 38 | 39 | [[package]] 40 | name = "aya-log-common" 41 | version = "0.1.13" 42 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 43 | dependencies = [ 44 | "num_enum", 45 | ] 46 | 47 | [[package]] 48 | name = "aya-log-ebpf" 49 | version = "0.1.0" 50 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 51 | dependencies = [ 52 | "aya-bpf", 53 | "aya-log-common", 54 | "aya-log-ebpf-macros", 55 | ] 56 | 57 | [[package]] 58 | name = "aya-log-ebpf-macros" 59 | version = "0.1.0" 60 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 61 | dependencies = [ 62 | "aya-log-common", 63 | "aya-log-parser", 64 | "proc-macro2", 65 | "quote", 66 | "syn", 67 | ] 68 | 69 | [[package]] 70 | name = "aya-log-parser" 71 | version = "0.1.11-dev.0" 72 | source = "git+https://github.com/aya-rs/aya?tag=aya-log-v0.1.13#832bdd280c19095d79ba2d27281c17f0b09adc15" 73 | dependencies = [ 74 | "aya-log-common", 75 | ] 76 | 77 | [[package]] 78 | name = "ebpf" 79 | version = "0.1.0" 80 | dependencies = [ 81 | "aya-bpf", 82 | "aya-log-ebpf", 83 | "shared", 84 | ] 85 | 86 | [[package]] 87 | name = "num_enum" 88 | version = "0.5.11" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" 91 | dependencies = [ 92 | "num_enum_derive", 93 | ] 94 | 95 | [[package]] 96 | name = "num_enum_derive" 97 | version = "0.5.11" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" 100 | dependencies = [ 101 | "proc-macro2", 102 | "quote", 103 | "syn", 104 | ] 105 | 106 | [[package]] 107 | name = "proc-macro2" 108 | version = "1.0.51" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" 111 | dependencies = [ 112 | "unicode-ident", 113 | ] 114 | 115 | [[package]] 116 | name = "quote" 117 | version = "1.0.23" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" 120 | dependencies = [ 121 | "proc-macro2", 122 | ] 123 | 124 | [[package]] 125 | name = "rustversion" 126 | version = "1.0.12" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" 129 | 130 | [[package]] 131 | name = "shared" 132 | version = "0.1.0" 133 | 134 | [[package]] 135 | name = "syn" 136 | version = "1.0.109" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 139 | dependencies = [ 140 | "proc-macro2", 141 | "quote", 142 | "unicode-ident", 143 | ] 144 | 145 | [[package]] 146 | name = "unicode-ident" 147 | version = "1.0.8" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 150 | -------------------------------------------------------------------------------- /ebpf/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Kris Nóva 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #![no_std] 16 | #![no_main] 17 | #[allow(non_upper_case_globals)] 18 | #[allow(non_snake_case)] 19 | #[allow(non_camel_case_types)] 20 | #[allow(dead_code)] 21 | mod binding; 22 | use crate::binding::{sock, sock_common}; 23 | use aya_bpf::{helpers::bpf_probe_read_kernel, macros::kprobe, programs::ProbeContext}; 24 | use aya_log_ebpf::info; 25 | 26 | #[link_section = "license"] 27 | #[used] 28 | pub static LICENSE: [u8; 4] = *b"GPL\0"; 29 | 30 | // Taken from 6.2 headers /include/linux/socket.h 31 | // https://github.com/torvalds/linux/blob/v6.2/include/linux/socket.h 32 | const AF_INET: u16 = 2; 33 | const AF_INET6: u16 = 10; 34 | 35 | // Areas to instrument: 36 | // All of the implementation of this code can be found in /net/ipv4/*.c 37 | // Most of the layer 3 IP code is in /net/ipv4/inet_connection_sock.c 38 | // The layer 4 connection code is in /net/ipv4/tcp_input.c 39 | // ----------------------------------------------------------------------- 40 | // [X] tcp_connect (outbound) // example will be removed 41 | // [ ] inet_csk_listen_start (inbound) // listen() layer 3 42 | // [X] tcp_conn_request (inbound) // New connection received layer 4 43 | // [X] inet_csk_accept (inbound) // accept() layer 3 44 | // ----------------------------------------------------------------------- 45 | // 46 | // Also areas to consider: 47 | // 48 | // - https://github.com/torvalds/linux/blob/v6.2/net/ipv4/tcp_fastopen.c#L238 49 | // - Looks like this is specifically where children are added to TFO 50 | // - https://github.com/torvalds/linux/blob/v6.2/net/ipv4/tcp_fastopen.c#L296 51 | // - Looks like this is a function that is used to check the length 52 | 53 | // kretprobe q_inet_csk_accept 54 | // 55 | // struct sock *sk, int flags, int *err, bool kern 56 | // 57 | // Research: 58 | // 59 | // Confirmed that this kprobe will execute when a client sends a HTTP 60 | // request to a server that calls accept() after the server has begun listening 61 | // for new connections. It is safe to assume that if this function has been 62 | // executed an element has been removed from the corresponding "accept queue". 63 | #[kprobe(name = "q_inet_csk_accept")] 64 | pub fn q_inet_csk_accept(ctx: ProbeContext) -> u32 { 65 | // sock_common (tcp_connect) 66 | match try_inet_csk_accept(ctx) { 67 | Ok(ret) => ret, 68 | Err(ret) => match ret.try_into() { 69 | Ok(rt) => rt, 70 | Err(_) => 1, 71 | }, 72 | } 73 | } 74 | 75 | fn try_inet_csk_accept(ctx: ProbeContext) -> Result { 76 | // arg 0 -> struct sock *sk 77 | // arg 1 -> int flags 78 | // arg 2 -> int *err 79 | // arg 3 -> bool kern 80 | let sock: *mut sock = ctx.arg(0).ok_or(1i64)?; 81 | let sk_common = unsafe { 82 | bpf_probe_read_kernel(&(*sock).__sk_common as *const sock_common).map_err(|e| e)? 83 | }; 84 | let qlen = 85 | unsafe { bpf_probe_read_kernel(&(*sock).sk_ack_backlog as *const u32).map_err(|e| e)? }; 86 | let qmax = 87 | unsafe { bpf_probe_read_kernel(&(*sock).sk_max_ack_backlog as *const u32).map_err(|e| e)? }; 88 | log_q(ctx, sk_common, qlen, qmax); 89 | Ok(0) 90 | } 91 | 92 | // q_tcp_conn_request 93 | // 94 | // int tcp_conn_request(struct request_sock_ops *rsk_ops, 95 | // const struct tcp_request_sock_ops *af_ops, 96 | // struct sock *sk, struct sk_buff *skb) 97 | // 98 | // Research: 99 | // 100 | // Confirmed that this kprobe will execute when a client sends a HTTP 101 | // request to a server that calls listen() but has not yet accepted() 102 | // a connection. 103 | // 104 | // This is the "entry point" for all new inbound connections "coming off the wire" 105 | // in the Net Device subsystem (tcpdump and wireshark) 106 | // 107 | // According to (https://www.kernel.org/doc/html/v4.16/networking/kapi.html) 108 | // the sock.sk_ack_backlog is the "current listen backlog" which the name 109 | // corresponds to the TCP states we can expect to find connections in the accept 110 | // queue. 111 | #[kprobe(name = "q_tcp_conn_request")] 112 | pub fn q_tcp_conn_request(ctx: ProbeContext) -> u32 { 113 | // sock_common (tcp_connect) 114 | match try_tcp_conn_request(ctx) { 115 | Ok(ret) => ret, 116 | Err(ret) => match ret.try_into() { 117 | Ok(rt) => rt, 118 | Err(_) => 1, 119 | }, 120 | } 121 | } 122 | 123 | fn try_tcp_conn_request(ctx: ProbeContext) -> Result { 124 | // arg 0 -> struct request_sock_ops *rsk_ops 125 | // arg 1 -> const struct tcp_request_sock_ops *af_ops 126 | // arg 2 -> struct sock *sk 127 | // arg 3 -> struct sk_buff *skb 128 | let sock: *mut sock = ctx.arg(2).ok_or(1i64)?; 129 | let sk_common = unsafe { 130 | bpf_probe_read_kernel(&(*sock).__sk_common as *const sock_common).map_err(|e| e)? 131 | }; 132 | let qlen = 133 | unsafe { bpf_probe_read_kernel(&(*sock).sk_ack_backlog as *const u32).map_err(|e| e)? }; 134 | let qmax = 135 | unsafe { bpf_probe_read_kernel(&(*sock).sk_max_ack_backlog as *const u32).map_err(|e| e)? }; 136 | log_q(ctx, sk_common, qlen, qmax); 137 | Ok(0) 138 | } 139 | 140 | // Generic method to log a queue structure 141 | #[allow(dead_code)] 142 | fn log_q(ctx: ProbeContext, sk_common: sock_common, qlen: u32, qmax: u32) { 143 | match sk_common.skc_family { 144 | AF_INET => { 145 | let src_addr = 146 | u32::from_be(unsafe { sk_common.__bindgen_anon_1.__bindgen_anon_1.skc_rcv_saddr }); 147 | let dest_addr: u32 = 148 | u32::from_be(unsafe { sk_common.__bindgen_anon_1.__bindgen_anon_1.skc_daddr }); 149 | info!( 150 | &ctx, 151 | "AF_INET 'accept queue' qlen: {}, qmax: {}, src address: {:ipv4}, dest address: {:ipv4}", 152 | qlen, 153 | qmax, 154 | src_addr, 155 | dest_addr, 156 | ); 157 | } 158 | AF_INET6 => { 159 | let src_addr = sk_common.skc_v6_rcv_saddr; 160 | let dest_addr = sk_common.skc_v6_daddr; 161 | info!( 162 | &ctx, 163 | "AF_INET6 'accept queue' qlen: {}, qmax: {}, src address: {:ipv4}, dest address: {:ipv4}", 164 | qlen, 165 | qmax, 166 | unsafe { src_addr.in6_u.u6_addr8 }, 167 | unsafe { dest_addr.in6_u.u6_addr8 } 168 | ); 169 | } 170 | 0_u16..=1_u16 | 3_u16..=9_u16 | 11_u16..=u16::MAX => todo!(), 171 | } 172 | } 173 | 174 | // Generic method to log a common socket structure 175 | #[allow(dead_code)] 176 | fn log_sock(ctx: ProbeContext, sk_common: sock_common) { 177 | match sk_common.skc_family { 178 | AF_INET => { 179 | let src_addr = 180 | u32::from_be(unsafe { sk_common.__bindgen_anon_1.__bindgen_anon_1.skc_rcv_saddr }); 181 | let dest_addr: u32 = 182 | u32::from_be(unsafe { sk_common.__bindgen_anon_1.__bindgen_anon_1.skc_daddr }); 183 | info!( 184 | &ctx, 185 | "AF_INET sock src address: {:ipv4}, dest address: {:ipv4}", src_addr, dest_addr, 186 | ); 187 | } 188 | AF_INET6 => { 189 | let src_addr = sk_common.skc_v6_rcv_saddr; 190 | let dest_addr = sk_common.skc_v6_daddr; 191 | info!( 192 | &ctx, 193 | "AF_INET6 sock src addr: {:ipv6}, dest addr: {:ipv6}", 194 | unsafe { src_addr.in6_u.u6_addr8 }, 195 | unsafe { dest_addr.in6_u.u6_addr8 } 196 | ); 197 | } 198 | 0_u16..=1_u16 | 3_u16..=9_u16 | 11_u16..=u16::MAX => todo!(), 199 | } 200 | } 201 | 202 | // kprobe q_tcp_fastopen_queue_check 203 | #[kprobe(name = "q_tcp_fastopen_queue_check")] 204 | pub fn q_tcp_fastopen_queue_check(ctx: ProbeContext) -> u32 { 205 | // sock_common (tcp_connect) 206 | match try_tcp_fastopen_queue_check(ctx) { 207 | Ok(ret) => ret, 208 | Err(ret) => match ret.try_into() { 209 | Ok(rt) => rt, 210 | Err(_) => 1, 211 | }, 212 | } 213 | } 214 | 215 | fn try_tcp_fastopen_queue_check(_ctx: ProbeContext) -> Result { 216 | // TODO 217 | Ok(0) 218 | } 219 | 220 | #[panic_handler] 221 | fn panic(_info: &core::panic::PanicInfo) -> ! { 222 | unsafe { core::hint::unreachable_unchecked() } 223 | } 224 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /ebpf/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "0.7.20" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "anyhow" 16 | version = "1.0.69" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.1.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 | 26 | [[package]] 27 | name = "aya" 28 | version = "0.11.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "758d57288601ecc9d149e3413a5f23d6b72c0373febc97044d4f4aa149033b5e" 31 | dependencies = [ 32 | "bitflags", 33 | "bytes", 34 | "lazy_static", 35 | "libc", 36 | "log", 37 | "object 0.28.4", 38 | "parking_lot", 39 | "thiserror", 40 | ] 41 | 42 | [[package]] 43 | name = "aya" 44 | version = "0.11.0" 45 | source = "git+https://github.com/aya-rs/aya?branch=main#113e3ef0183acc69202fa6587643449f793cfff8" 46 | dependencies = [ 47 | "aya-obj", 48 | "bitflags", 49 | "bytes", 50 | "lazy_static", 51 | "libc", 52 | "log", 53 | "object 0.30.3", 54 | "parking_lot", 55 | "thiserror", 56 | "tokio", 57 | ] 58 | 59 | [[package]] 60 | name = "aya-log" 61 | version = "0.1.13" 62 | source = "git+https://github.com/aya-rs/aya?branch=main#113e3ef0183acc69202fa6587643449f793cfff8" 63 | dependencies = [ 64 | "aya 0.11.0 (git+https://github.com/aya-rs/aya?branch=main)", 65 | "aya-log-common", 66 | "bytes", 67 | "log", 68 | "thiserror", 69 | "tokio", 70 | ] 71 | 72 | [[package]] 73 | name = "aya-log-common" 74 | version = "0.1.13" 75 | source = "git+https://github.com/aya-rs/aya?branch=main#113e3ef0183acc69202fa6587643449f793cfff8" 76 | dependencies = [ 77 | "aya 0.11.0 (git+https://github.com/aya-rs/aya?branch=main)", 78 | "num_enum", 79 | ] 80 | 81 | [[package]] 82 | name = "aya-obj" 83 | version = "0.1.0" 84 | source = "git+https://github.com/aya-rs/aya?branch=main#113e3ef0183acc69202fa6587643449f793cfff8" 85 | dependencies = [ 86 | "bytes", 87 | "log", 88 | "object 0.30.3", 89 | "thiserror", 90 | ] 91 | 92 | [[package]] 93 | name = "bitflags" 94 | version = "1.3.2" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 97 | 98 | [[package]] 99 | name = "bytes" 100 | version = "1.4.0" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 103 | 104 | [[package]] 105 | name = "cc" 106 | version = "1.0.79" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 109 | 110 | [[package]] 111 | name = "cfg-if" 112 | version = "1.0.0" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 115 | 116 | [[package]] 117 | name = "clap" 118 | version = "4.1.8" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" 121 | dependencies = [ 122 | "bitflags", 123 | "clap_derive", 124 | "clap_lex", 125 | "is-terminal", 126 | "once_cell", 127 | "strsim", 128 | "termcolor", 129 | ] 130 | 131 | [[package]] 132 | name = "clap_derive" 133 | version = "4.1.8" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" 136 | dependencies = [ 137 | "heck", 138 | "proc-macro-error", 139 | "proc-macro2", 140 | "quote", 141 | "syn", 142 | ] 143 | 144 | [[package]] 145 | name = "clap_lex" 146 | version = "0.3.2" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" 149 | dependencies = [ 150 | "os_str_bytes", 151 | ] 152 | 153 | [[package]] 154 | name = "env_logger" 155 | version = "0.10.0" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" 158 | dependencies = [ 159 | "humantime", 160 | "is-terminal", 161 | "log", 162 | "regex", 163 | "termcolor", 164 | ] 165 | 166 | [[package]] 167 | name = "errno" 168 | version = "0.2.8" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" 171 | dependencies = [ 172 | "errno-dragonfly", 173 | "libc", 174 | "winapi", 175 | ] 176 | 177 | [[package]] 178 | name = "errno-dragonfly" 179 | version = "0.1.2" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 182 | dependencies = [ 183 | "cc", 184 | "libc", 185 | ] 186 | 187 | [[package]] 188 | name = "heck" 189 | version = "0.4.1" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 192 | 193 | [[package]] 194 | name = "hermit-abi" 195 | version = "0.2.6" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 198 | dependencies = [ 199 | "libc", 200 | ] 201 | 202 | [[package]] 203 | name = "hermit-abi" 204 | version = "0.3.1" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 207 | 208 | [[package]] 209 | name = "humantime" 210 | version = "2.1.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 213 | 214 | [[package]] 215 | name = "io-lifetimes" 216 | version = "1.0.6" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" 219 | dependencies = [ 220 | "libc", 221 | "windows-sys", 222 | ] 223 | 224 | [[package]] 225 | name = "is-terminal" 226 | version = "0.4.4" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" 229 | dependencies = [ 230 | "hermit-abi 0.3.1", 231 | "io-lifetimes", 232 | "rustix", 233 | "windows-sys", 234 | ] 235 | 236 | [[package]] 237 | name = "lazy_static" 238 | version = "1.4.0" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 241 | 242 | [[package]] 243 | name = "libc" 244 | version = "0.2.140" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" 247 | 248 | [[package]] 249 | name = "linux-raw-sys" 250 | version = "0.1.4" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" 253 | 254 | [[package]] 255 | name = "lock_api" 256 | version = "0.4.9" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 259 | dependencies = [ 260 | "autocfg", 261 | "scopeguard", 262 | ] 263 | 264 | [[package]] 265 | name = "log" 266 | version = "0.4.17" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 269 | dependencies = [ 270 | "cfg-if", 271 | ] 272 | 273 | [[package]] 274 | name = "memchr" 275 | version = "2.5.0" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 278 | 279 | [[package]] 280 | name = "mio" 281 | version = "0.8.6" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 284 | dependencies = [ 285 | "libc", 286 | "log", 287 | "wasi", 288 | "windows-sys", 289 | ] 290 | 291 | [[package]] 292 | name = "num_cpus" 293 | version = "1.15.0" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 296 | dependencies = [ 297 | "hermit-abi 0.2.6", 298 | "libc", 299 | ] 300 | 301 | [[package]] 302 | name = "num_enum" 303 | version = "0.5.11" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" 306 | dependencies = [ 307 | "num_enum_derive", 308 | ] 309 | 310 | [[package]] 311 | name = "num_enum_derive" 312 | version = "0.5.11" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" 315 | dependencies = [ 316 | "proc-macro2", 317 | "quote", 318 | "syn", 319 | ] 320 | 321 | [[package]] 322 | name = "object" 323 | version = "0.28.4" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" 326 | dependencies = [ 327 | "memchr", 328 | ] 329 | 330 | [[package]] 331 | name = "object" 332 | version = "0.30.3" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" 335 | dependencies = [ 336 | "memchr", 337 | ] 338 | 339 | [[package]] 340 | name = "once_cell" 341 | version = "1.17.1" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 344 | 345 | [[package]] 346 | name = "os_str_bytes" 347 | version = "6.4.1" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" 350 | 351 | [[package]] 352 | name = "parking_lot" 353 | version = "0.12.1" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 356 | dependencies = [ 357 | "lock_api", 358 | "parking_lot_core", 359 | ] 360 | 361 | [[package]] 362 | name = "parking_lot_core" 363 | version = "0.9.7" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 366 | dependencies = [ 367 | "cfg-if", 368 | "libc", 369 | "redox_syscall", 370 | "smallvec", 371 | "windows-sys", 372 | ] 373 | 374 | [[package]] 375 | name = "pin-project-lite" 376 | version = "0.2.9" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 379 | 380 | [[package]] 381 | name = "proc-macro-error" 382 | version = "1.0.4" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 385 | dependencies = [ 386 | "proc-macro-error-attr", 387 | "proc-macro2", 388 | "quote", 389 | "syn", 390 | "version_check", 391 | ] 392 | 393 | [[package]] 394 | name = "proc-macro-error-attr" 395 | version = "1.0.4" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 398 | dependencies = [ 399 | "proc-macro2", 400 | "quote", 401 | "version_check", 402 | ] 403 | 404 | [[package]] 405 | name = "proc-macro2" 406 | version = "1.0.51" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" 409 | dependencies = [ 410 | "unicode-ident", 411 | ] 412 | 413 | [[package]] 414 | name = "quote" 415 | version = "1.0.23" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" 418 | dependencies = [ 419 | "proc-macro2", 420 | ] 421 | 422 | [[package]] 423 | name = "redox_syscall" 424 | version = "0.2.16" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 427 | dependencies = [ 428 | "bitflags", 429 | ] 430 | 431 | [[package]] 432 | name = "regex" 433 | version = "1.7.1" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" 436 | dependencies = [ 437 | "aho-corasick", 438 | "memchr", 439 | "regex-syntax", 440 | ] 441 | 442 | [[package]] 443 | name = "regex-syntax" 444 | version = "0.6.28" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" 447 | 448 | [[package]] 449 | name = "rustix" 450 | version = "0.36.9" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" 453 | dependencies = [ 454 | "bitflags", 455 | "errno", 456 | "io-lifetimes", 457 | "libc", 458 | "linux-raw-sys", 459 | "windows-sys", 460 | ] 461 | 462 | [[package]] 463 | name = "scopeguard" 464 | version = "1.1.0" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 467 | 468 | [[package]] 469 | name = "shared" 470 | version = "0.1.0" 471 | dependencies = [ 472 | "aya 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 473 | ] 474 | 475 | [[package]] 476 | name = "signal-hook-registry" 477 | version = "1.4.1" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 480 | dependencies = [ 481 | "libc", 482 | ] 483 | 484 | [[package]] 485 | name = "smallvec" 486 | version = "1.10.0" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 489 | 490 | [[package]] 491 | name = "socket2" 492 | version = "0.4.9" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 495 | dependencies = [ 496 | "libc", 497 | "winapi", 498 | ] 499 | 500 | [[package]] 501 | name = "strsim" 502 | version = "0.10.0" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 505 | 506 | [[package]] 507 | name = "syn" 508 | version = "1.0.109" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 511 | dependencies = [ 512 | "proc-macro2", 513 | "quote", 514 | "unicode-ident", 515 | ] 516 | 517 | [[package]] 518 | name = "termcolor" 519 | version = "1.2.0" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 522 | dependencies = [ 523 | "winapi-util", 524 | ] 525 | 526 | [[package]] 527 | name = "thiserror" 528 | version = "1.0.39" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" 531 | dependencies = [ 532 | "thiserror-impl", 533 | ] 534 | 535 | [[package]] 536 | name = "thiserror-impl" 537 | version = "1.0.39" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" 540 | dependencies = [ 541 | "proc-macro2", 542 | "quote", 543 | "syn", 544 | ] 545 | 546 | [[package]] 547 | name = "tokio" 548 | version = "1.26.0" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" 551 | dependencies = [ 552 | "autocfg", 553 | "libc", 554 | "mio", 555 | "num_cpus", 556 | "pin-project-lite", 557 | "signal-hook-registry", 558 | "socket2", 559 | "tokio-macros", 560 | "windows-sys", 561 | ] 562 | 563 | [[package]] 564 | name = "tokio-macros" 565 | version = "1.8.2" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" 568 | dependencies = [ 569 | "proc-macro2", 570 | "quote", 571 | "syn", 572 | ] 573 | 574 | [[package]] 575 | name = "unicode-ident" 576 | version = "1.0.8" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 579 | 580 | [[package]] 581 | name = "userspace" 582 | version = "0.1.0" 583 | dependencies = [ 584 | "anyhow", 585 | "aya 0.11.0 (git+https://github.com/aya-rs/aya?branch=main)", 586 | "aya-log", 587 | "clap", 588 | "env_logger", 589 | "log", 590 | "shared", 591 | "tokio", 592 | ] 593 | 594 | [[package]] 595 | name = "version_check" 596 | version = "0.9.4" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 599 | 600 | [[package]] 601 | name = "wasi" 602 | version = "0.11.0+wasi-snapshot-preview1" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 605 | 606 | [[package]] 607 | name = "winapi" 608 | version = "0.3.9" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 611 | dependencies = [ 612 | "winapi-i686-pc-windows-gnu", 613 | "winapi-x86_64-pc-windows-gnu", 614 | ] 615 | 616 | [[package]] 617 | name = "winapi-i686-pc-windows-gnu" 618 | version = "0.4.0" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 621 | 622 | [[package]] 623 | name = "winapi-util" 624 | version = "0.1.5" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 627 | dependencies = [ 628 | "winapi", 629 | ] 630 | 631 | [[package]] 632 | name = "winapi-x86_64-pc-windows-gnu" 633 | version = "0.4.0" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 636 | 637 | [[package]] 638 | name = "windows-sys" 639 | version = "0.45.0" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 642 | dependencies = [ 643 | "windows-targets", 644 | ] 645 | 646 | [[package]] 647 | name = "windows-targets" 648 | version = "0.42.1" 649 | source = "registry+https://github.com/rust-lang/crates.io-index" 650 | checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" 651 | dependencies = [ 652 | "windows_aarch64_gnullvm", 653 | "windows_aarch64_msvc", 654 | "windows_i686_gnu", 655 | "windows_i686_msvc", 656 | "windows_x86_64_gnu", 657 | "windows_x86_64_gnullvm", 658 | "windows_x86_64_msvc", 659 | ] 660 | 661 | [[package]] 662 | name = "windows_aarch64_gnullvm" 663 | version = "0.42.1" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" 666 | 667 | [[package]] 668 | name = "windows_aarch64_msvc" 669 | version = "0.42.1" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" 672 | 673 | [[package]] 674 | name = "windows_i686_gnu" 675 | version = "0.42.1" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" 678 | 679 | [[package]] 680 | name = "windows_i686_msvc" 681 | version = "0.42.1" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" 684 | 685 | [[package]] 686 | name = "windows_x86_64_gnu" 687 | version = "0.42.1" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" 690 | 691 | [[package]] 692 | name = "windows_x86_64_gnullvm" 693 | version = "0.42.1" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" 696 | 697 | [[package]] 698 | name = "windows_x86_64_msvc" 699 | version = "0.42.1" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" 702 | --------------------------------------------------------------------------------