Skip to content

Commit

Permalink
build: bump aya from 0.12.0 to 0.13.0
Browse files Browse the repository at this point in the history
Bumps [aya](https://github.com/aya-rs/aya) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/aya-rs/aya/releases)
- [Changelog](https://github.com/aya-rs/aya/blob/main/release.toml)
- [Commits](aya-rs/aya@aya-v0.12.0...aya-v0.13.0)

---
updated-dependencies:
- dependency-name: aya
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and SanjoDeundiak committed Oct 22, 2024
1 parent 2bfb3a2 commit da4e2eb
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 57 deletions.
49 changes: 27 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ This file contains attributions for any 3rd-party open source code used in this
| flexi_logger | MIT, Apache-2.0 | https://crates.io/crates/flexi_logger |
| flume | Apache-2.0, MIT | https://crates.io/crates/flume |
| fnv | Apache-2.0, MIT | https://crates.io/crates/fnv |
| foldhash | Zlib | https://crates.io/crates/foldhash |
| foreign-types | MIT, Apache-2.0 | https://crates.io/crates/foreign-types |
| foreign-types-macros | MIT, Apache-2.0 | https://crates.io/crates/foreign-types-macros |
| foreign-types-shared | MIT, Apache-2.0 | https://crates.io/crates/foreign-types-shared |
Expand Down
28 changes: 14 additions & 14 deletions implementations/rust/ockam/ockam_ebpf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions implementations/rust/ockam/ockam_ebpf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ eBPF program used by Ockam TCP Portals
"""

[dependencies]
aya-ebpf = "0.1.0"
aya-log-ebpf = "0.1.0"
network-types = "0.0.6"
aya-ebpf = "0.1.1"
aya-log-ebpf = "0.1.1"
network-types = "0.0.7"

[[bin]]
name = "ockam_ebpf"
Expand Down
Binary file modified implementations/rust/ockam/ockam_ebpf/ockam_ebpf
Binary file not shown.
6 changes: 3 additions & 3 deletions implementations/rust/ockam/ockam_transport_tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ tokio-rustls = { version = "0.26", default-features = false, features = ["loggin
tracing = { version = "0.1", default-features = false }

[target.'cfg( target_os = "linux" )'.dependencies]
aya = { version = "=0.12.0", optional = true }
aya-log = { version = "=0.2.0", optional = true }
aya-log-common = { version = "=0.1.14", optional = true }
aya = { version = "=0.13.0", optional = true }
aya-log = { version = "=0.2.1", optional = true }
aya-log-common = { version = "=0.1.15", optional = true }

[target.'cfg( any(target_os = "linux", target_os = "macos") )'.dependencies]
env_logger = { version = "0.11", optional = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::ebpf_portal::{InletRegistry, OutletRegistry, RawSocketProcessor};
use aya::maps::{MapData, MapError};
use aya::programs::tc::SchedClassifierLink;
use aya::programs::{tc, Link, ProgramError, SchedClassifier, TcAttachType};
use aya::{Bpf, BpfError};
use aya_log::BpfLogger;
use aya::{Ebpf, EbpfError};
use aya_log::EbpfLogger;
use core::fmt::{Debug, Formatter};
use ockam_core::compat::collections::HashMap;
use ockam_core::errcode::{Kind, Origin};
Expand Down Expand Up @@ -41,7 +41,7 @@ struct IfaceLink {
}

struct OckamBpf {
bpf: Bpf,
ebpf: Ebpf,

inlet_port_map: aya::maps::HashMap<MapData, Port, Proto>,
outlet_port_map: aya::maps::HashMap<MapData, Port, Proto>,
Expand Down Expand Up @@ -145,26 +145,27 @@ impl TcpTransportEbpfSupport {
// reach for `Bpf::load_file` instead.

let ebpf_binary = aya::include_bytes_aligned!("../../../ockam_ebpf/ockam_ebpf");
let mut bpf = Bpf::load(ebpf_binary).map_err(map_bpf_error)?;
let mut ebpf = Ebpf::load(ebpf_binary).map_err(map_ebpf_error)?;
// eBPF can be read from the filesystem in the runtime for development purposes
// let ebpf_binary = std::fs::read(PATH).unwrap();
// let mut bpf = Bpf::load(&ebpf_binary).map_err(map_bpf_error)?;
// let mut ebpf = Ebpf::load(&ebpf_binary).map_err(map_bpf_error)?;

if let Err(e) = BpfLogger::init(&mut bpf) {
if let Err(e) = EbpfLogger::init(&mut ebpf) {
// This can happen if you remove all log statements from your eBPF program.
warn!("failed to initialize eBPF logger for ingress: {}", e);
}

let inlet_port_map =
aya::maps::HashMap::<_, Port, Proto>::try_from(bpf.take_map("INLET_PORT_MAP").unwrap())
.map_err(map_map_error)?;
let inlet_port_map = aya::maps::HashMap::<_, Port, Proto>::try_from(
ebpf.take_map("INLET_PORT_MAP").unwrap(),
)
.map_err(map_map_error)?;
let outlet_port_map = aya::maps::HashMap::<_, Port, Proto>::try_from(
bpf.take_map("OUTLET_PORT_MAP").unwrap(),
ebpf.take_map("OUTLET_PORT_MAP").unwrap(),
)
.map_err(map_map_error)?;

let bpf = OckamBpf {
bpf,
ebpf,
inlet_port_map,
outlet_port_map,
};
Expand Down Expand Up @@ -216,7 +217,7 @@ impl TcpTransportEbpfSupport {
debug!("Attaching eBPF ingress to {}", iface);

let program_ingress: &mut SchedClassifier = bpf
.bpf
.ebpf
.program_mut("ockam_ingress")
.unwrap()
.try_into()
Expand Down Expand Up @@ -245,7 +246,7 @@ impl TcpTransportEbpfSupport {
debug!("Attaching eBPF egress to {}", iface);

let program_egress: &mut SchedClassifier = bpf
.bpf
.ebpf
.program_mut("ockam_egress")
.unwrap()
.try_into()
Expand Down Expand Up @@ -332,8 +333,8 @@ impl TcpTransportEbpfSupport {
}

#[track_caller]
fn map_bpf_error(bpf_error: BpfError) -> Error {
Error::new(Origin::Core, Kind::Io, bpf_error)
fn map_ebpf_error(ebpf_error: EbpfError) -> Error {
Error::new(Origin::Core, Kind::Io, ebpf_error)
}

#[track_caller]
Expand Down

0 comments on commit da4e2eb

Please sign in to comment.