|
1 | 1 | use std::net::Ipv4Addr; |
2 | 2 |
|
3 | 3 | use anyhow::Result; |
4 | | -use aya::maps::{HashMap, SockHash}; |
5 | | -use aya::programs::{tc, SchedClassifier, SkMsg, SockOps, TcAttachType}; |
| 4 | +use aya::maps::HashMap; |
| 5 | +use aya::programs::{tc, SchedClassifier, TcAttachType}; |
6 | 6 | use aya::{include_bytes_aligned, Bpf}; |
7 | | -use common::{NetworkInfo, SockKey, CLUSTER_CIDR_KEY, HOST_IP_KEY}; |
| 7 | +use common::{NetworkInfo, CLUSTER_CIDR_KEY, HOST_IP_KEY}; |
8 | 8 |
|
9 | 9 | pub struct BpfLoader { |
10 | 10 | pub bpf: Bpf, |
11 | 11 | iface: String, |
| 12 | + #[allow(dead_code)] |
12 | 13 | cgroup_path: String, |
13 | 14 | } |
14 | 15 |
|
@@ -77,19 +78,19 @@ impl BpfLoader { |
77 | 78 | .expect("failed to insert node ip"); |
78 | 79 | }); |
79 | 80 |
|
80 | | - let tcp_accelerate: &mut SockOps = |
81 | | - self.bpf.program_mut("tcp_accelerate").unwrap().try_into()?; |
82 | | - let cgroup = std::fs::File::open(&self.cgroup_path)?; |
83 | | - tcp_accelerate.load()?; |
84 | | - tcp_accelerate.attach(cgroup)?; |
| 81 | + // let tcp_accelerate: &mut SockOps = |
| 82 | + // self.bpf.program_mut("tcp_accelerate").unwrap().try_into()?; |
| 83 | + // let cgroup = std::fs::File::open(&self.cgroup_path)?; |
| 84 | + // tcp_accelerate.load()?; |
| 85 | + // tcp_accelerate.attach(cgroup)?; |
85 | 86 |
|
86 | | - let sock_ops_map: SockHash<_, SockKey> = |
87 | | - self.bpf.map("SOCK_OPS_MAP").unwrap().try_into()?; |
88 | | - let map_fd = sock_ops_map.fd().try_clone()?; |
| 87 | + // let sock_ops_map: SockHash<_, SockKey> = |
| 88 | + // self.bpf.map("SOCK_OPS_MAP").unwrap().try_into()?; |
| 89 | + // let map_fd = sock_ops_map.fd().try_clone()?; |
89 | 90 |
|
90 | | - let tcp_bypass: &mut SkMsg = self.bpf.program_mut("tcp_bypass").unwrap().try_into()?; |
91 | | - tcp_bypass.load()?; |
92 | | - tcp_bypass.attach(&map_fd)?; |
| 91 | + // let tcp_bypass: &mut SkMsg = self.bpf.program_mut("tcp_bypass").unwrap().try_into()?; |
| 92 | + // tcp_bypass.load()?; |
| 93 | + // tcp_bypass.attach(&map_fd)?; |
93 | 94 |
|
94 | 95 | Ok(()) |
95 | 96 | } |
|
0 commit comments