-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rename
Cargo.toml
-> Cargo.toml.hidden
to fix cargo behavior
- Loading branch information
1 parent
21e4dc2
commit 5058347
Showing
7 changed files
with
117 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ vendor | |
# nix build | ||
/result* | ||
.home | ||
/ockam_ebpf_impl/Cargo.toml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,63 @@ | ||
# ockam-ebpf | ||
# ockam_ebpf | ||
|
||
[![crate][crate-image]][crate-link] | ||
[![docs][docs-image]][docs-link] | ||
[![license][license-image]][license-link] | ||
[![discuss][discuss-image]][discuss-link] | ||
|
||
Ockam is a library for building devices that communicate securely, privately | ||
and trustfully with cloud services and other devices. | ||
|
||
This crate contains the eBPF part of Ockam Reliable TCP Portals. | ||
|
||
### Build | ||
|
||
This crate exposes eBPF binary through the `EBPF_BINARY` static constant in the root of the crate. That binary can be | ||
used to attach Ockam eBPF to network devices. | ||
|
||
### Features | ||
|
||
By default, this crate ships a prebuilt eBPF binary downloaded from the corresponding GitHub release artifacts. This | ||
allows to build Ockam without all the dependencies that are required to build eBPF. | ||
|
||
* build - build the eBPF locally instead of downloading the prebuilt binary. This might be useful during development and debugging. | ||
* logging - this will enable logs for eBPF. Note that eBPF sends logs to the user space using `AsyncPerfEventArray`, therefore it implies performance penalty. | ||
|
||
```bash | ||
cargo build | ||
``` | ||
|
||
### Requirements to build eBPF | ||
|
||
Please refer to [ockam_ebpf_impl/README.md](ockam_ebpf_impl/README.md) | ||
|
||
### Requirements to use eBPF | ||
|
||
Using ockam with eBPFs requires: | ||
- Linux | ||
- root (CAP_BPF, CAP_NET_RAW, CAP_NET_ADMIN, CAP_SYS_ADMIN) | ||
|
||
## Usage | ||
|
||
Add this to your `Cargo.toml`: | ||
|
||
``` | ||
[dependencies] | ||
ockam_ebpf = "0.5.0" | ||
``` | ||
|
||
## License | ||
|
||
This code is licensed under the terms of the [Apache License 2.0][license-link]. | ||
|
||
[crate-image]: https://img.shields.io/crates/v/ockam_ebpf.svg | ||
[crate-link]: https://crates.io/crates/ockam_ebpf | ||
|
||
[docs-image]: https://docs.rs/ockam_ebpf/badge.svg | ||
[docs-link]: https://docs.rs/ockam_ebpf | ||
|
||
[license-image]: https://img.shields.io/badge/License-Apache%202.0-green.svg | ||
[license-link]: https://github.com/build-trust/ockam/blob/HEAD/LICENSE | ||
|
||
[discuss-image]: https://img.shields.io/badge/Discuss-Github%20Discussions-ff70b4.svg | ||
[discuss-link]: https://github.com/build-trust/ockam/discussions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,25 @@ | ||
# ockam_ebpf | ||
# ockam_ebpf_impl | ||
|
||
[![crate][crate-image]][crate-link] | ||
[![docs][docs-image]][docs-link] | ||
[![license][license-image]][license-link] | ||
[![discuss][discuss-image]][discuss-link] | ||
|
||
Ockam is a library for building devices that communicate securely, privately | ||
and trustfully with cloud services and other devices. | ||
|
||
This crate contains the eBPF part of Ockam Reliable TCP Portals. | ||
This crate is shipped as a part of `ockam_ebpf` crate rather than a stand-alone crate. Please refer to the ../README.md | ||
for more information. | ||
|
||
### Build | ||
|
||
In order to build the crate it's required to copy `Cargo.toml.hidden` file and rename it to `Cargo.toml`. Note, that | ||
`Cargo.toml` file is added to `.gitignore` and shouldn't be commited, instead all changes should be inside | ||
`Cargo.toml.hidden` file. The reason for that is special cargo behaviour that doesn't allow including other crates as | ||
part of a crate. Therefore, if `ockam_ebpf_impl` subdirectory has `Cargo.toml` file, that directory will be completely | ||
ignored during `ockam_ebpf` crate release even if it's added to `include` field of root `Cargo.toml`. | ||
|
||
```bash | ||
cargo build-ebpf | ||
cargo build | ||
``` | ||
### Requirements | ||
|
||
Building eBPFs have roughly following requirements: | ||
- Linux | ||
- Rust nightly | ||
- Some dependencies to be installed | ||
|
||
Because of that crate with the eBPF code is kept out of the workspace. | ||
Example of a virtual machine to build it can be found in `ubuntu_x86.yaml`. | ||
|
||
Using ockam with eBPFs requires: | ||
- Linux | ||
- root (CAP_BPF, CAP_NET_RAW, CAP_NET_ADMIN, CAP_SYS_ADMIN) | ||
|
||
Example of a virtual machine to run ockam with eBPF can be found in `ubuntu_arm.yaml`. | ||
|
||
eBPF is a small architecture-independent object file that is small enough, | ||
to include it in the repo. | ||
|
||
The built eBPF object should be copied to `/implementations/rust/ockam/ockam_ebpf/ockam_ebpf`, | ||
from where it will be grabbed by `ockam_transport_tcp` crate. | ||
|
||
## Usage | ||
|
||
Add this to your `Cargo.toml`: | ||
|
||
``` | ||
[dependencies] | ||
ockam_ebpf = "0.1.0" | ||
``` | ||
|
||
## License | ||
|
||
This code is licensed under the terms of the [Apache License 2.0][license-link]. | ||
|
||
[main-ockam-crate-link]: https://crates.io/crates/ockam | ||
|
||
[crate-image]: https://img.shields.io/crates/v/ockam_ebpf.svg | ||
[crate-link]: https://crates.io/crates/ockam_ebpf | ||
|
||
[docs-image]: https://docs.rs/ockam_ebpf/badge.svg | ||
[docs-link]: https://docs.rs/ockam_ebpf | ||
|
||
[license-image]: https://img.shields.io/badge/License-Apache%202.0-green.svg | ||
[license-link]: https://github.com/build-trust/ockam/blob/HEAD/LICENSE | ||
|
||
[discuss-image]: https://img.shields.io/badge/Discuss-Github%20Discussions-ff70b4.svg | ||
[discuss-link]: https://github.com/build-trust/ockam/discussions | ||
Because of that, crate with the eBPF code is kept out of the workspace. | ||
Example of a virtual machine to build and run eBPF can be found in [ubuntu_arm.yaml](../vm/ubuntu_arm.yaml) |