190 Commits (main)
 

Author SHA1 Message Date
Kenjiro Nakayama 8621ea7d5f Add cgroup_sockopt template for BPF_PROG_TYPE_CGROUP_SOCKOPT 2 years ago
Alessandro Decina c6b6f1ed3d
Merge pull request #46 from nak3/add-cgroup-sysctl
Add cgroup_sysctl template for BPF_PROG_TYPE_CGROUP_SYSCTL
2 years ago
Kenjiro Nakayama 886182d1bc Add cgroup_sysctl to CI 2 years ago
Kenjiro Nakayama 3bf8e87b3e Add cgroup_sysctl template for BPF_PROG_TYPE_CGROUP_SYSCTL
Since https://github.com/aya-rs/aya/pull/256 supports `BPF_PROG_TYPE_CGROUP_SYSCTL`,
this patch adds cgroup_sysctl template.
2 years ago
Alessandro Decina 0df4d8f969
Merge pull request #45 from vadorovsky/use-main
aya: Switch (again) from crates.io to git
2 years ago
Michal Rostecki 9f69ee52b2 aya: Switch (again) from crates.io to git
This time we need to switch to git again, because of this unreleased
change:

aya-rs/aya@d1f2215193

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Dave Tucker 807131b955
Merge pull request #33 from nak3/add-socket-filter
Add template for socket_filter program type
2 years ago
Dave Tucker aeb81111ea
Merge pull request #44 from vadorovsky/xtask-clap
xtask: Use clap instead of structopt
2 years ago
Michal Rostecki 9297249e01 xtask: Use clap instead of structopt
structopt was merged into clap (starting from clap 3.0), therefore
becoming a deprecated project.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina 5dd77572e6
Merge pull request #43 from vadorovsky/aya-log
Add aya-log
2 years ago
Michal Rostecki 0ea4a7eb04 Add aya-log
This change adds aya-log and example log messsages to all eBPF
programs.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina 1f179c0af1
Merge pull request #41 from vadorovsky/clap
Use clap instead of structopt
2 years ago
Michal Rostecki f940467c4a Use clap instead of structopt
structopt was merged into clap (starting from clap 3.0), therefore
becoming a deprecated project.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina 947986160a
Merge pull request #42 from vadorovsky/update-deps
Update dependencies
2 years ago
Michal Rostecki f5181a822f Update dependencies
Update simplelog and tokio

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Alessandro Decina eda904b187
Merge pull request #40 from vadorovsky/profile-dev
ebpf: Make the dev target identical to release
2 years ago
Michal Rostecki 04584fe9c5 ebpf: Make the dev target identical to release
eBPF programs cannot be debugged and those ones built with the default
dev profile are often annoying the verifier. Therefore it doesn't make
sense to compile not optimized eBPF objects.

However, we still want to let people to use the dev profile, especially
in the future when we want to get rid of xtask by using cargo binary
dependencies[0]. The trick is to have no real difference between dev and
release profile in eBPF.

This change doesn't affect the userspace part which still is going to
contain debug symbols when built with dev profile.

[0] https://rust-lang.github.io/rfcs/3028-cargo-binary-dependencies.html

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
3 years ago
Michal Rostecki ec1910fffd Revert "Use release profile for eBPF programs by default"
This reverts commit ad9b8ee8dc.
3 years ago
Alessandro Decina b9abc9a11c
Merge pull request #36 from nak3/fix-regex
Use strict regex for additional args
3 years ago
Kenjiro Nakayama 640d0dcef5 Use strict regex for additional args.
Current `[a-z_]+` regex allows upper case such as `NET_dev`, `netDev`
or even `NET_DEV` when one of `a-z` or `_` contains in the string. It
should be disallowed.

This patch fixes it.
3 years ago
Dave Tucker 8cde8c2232
Merge pull request #35 from mraerino/patch-1
Use HTTPS url for git dependency
3 years ago
Marcus Weiner 220aa73093
Use HTTPS url for git dependency 3 years ago
Dave Tucker bdcf172ec4
Merge pull request #34 from dmitris/edition-2021
use edition 2021
3 years ago
Dmitry Savintsev aa3b2a4407 use edition 2021 3 years ago
Kenjiro Nakayama 11798df0ab Fix sock_filter to socket_filter 3 years ago
Kenjiro Nakayama 8dcda393c4 Add template for socket_filter program type
This patch adds template for socket_filter.
e.g.

```sh
cargo generate --path ~/dev/aya-template \
         --name my-test \
	 -d program_type=socket_filter
```
3 years ago
Dave Tucker c41fb5ef0d
Merge pull request #31 from vadorovsky/profile-release
Use release profile for eBPF programs by default
3 years ago
Michal Rostecki ad9b8ee8dc Use release profile for eBPF programs by default
This change removes the differentiation between release and dev profiles
for eBPF programs. There is no way eBPF programs can be debugged and
building them with dev profile just makes them slower and often unable
to be verified. They should be always built with the release profile.

After this change, `cargo xtask build-ebpf` is going to build eBPF
programs with release profile. And the userspace program is going to
include eBPF program bytes from target/release/. Regardless of which
profile is being used in the userspace program.

`cargo xtask build-ebpf` has the --profile argument which can be
optionally used (i.e. for user-defined profiles), but by default the
value of that option is `release`.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
Alessandro Decina 33a385c8ab
Merge pull request #30 from dmitris/patch-1
fix typo
3 years ago
Dmitry Savintsev 4a9e5843a7
fix typo 3 years ago
Alessandro Decina 524e3fdd5e
Merge pull request #29 from dmitris/fmt
avoid 'cargo fmt' diffs in generated code
3 years ago
Dmitry Savintsev c35eadc34b avoid 'cargo fmt' diffs in generated code 3 years ago
Alessandro Decina 1a24fea5fe
Merge pull request #28 from dmitris/patch-1
classifier: don't bail on qdisc_add_clsact error
3 years ago
Dmitry Savintsev 4d22913931
classifier: don't bail on qdisc_add_clsact error 3 years ago
Alessandro Decina 581dc3908a
Merge pull request #27 from vadorovsky/tokio
Use Tokio and simplelog by default
3 years ago
Michal Rostecki de709c52d0 Use Tokio and simplelog by default
Replace ctrlc usage with Tokio and simplelog.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
Dave Tucker 31a7d0edb4
Merge pull request #26 from dmitris/skb-mode
for xdp, retry load with SKB_MODE flags
3 years ago
Dmitry S 21803634d7 xdp - suggest SKB_MODE on attach failure 3 years ago
Dave Tucker 870853ed30
Merge pull request #8 from dmitris/patch-1
remove unused import std::convert::TryFrom
3 years ago
Dmitry Savintsev c7dfae4933 import TryFrom only for sk_msg programs
Avoid unused_imports warning for std::convert::TryFrom.
Conditionally import it only when it is needed -
in sk_msg programs.

remove unused `std::convert::TryFrom` import to avoid the warning in the generated projects:
```
warning: unused import: `TryFrom`
 --> myapp/src/main.rs:4:15
  |
4 |     convert::{TryFrom,TryInto},
  |               ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: `myapp` (bin "myapp") generated 1 warning
```
3 years ago
Dave Tucker bc7cd9ad46
Merge pull request #25 from vadorovsky/fentry
fentry/fexit: Add template for fentry/fexit programs
3 years ago
Michal Rostecki e1fb8024a6 fentry/fexit: Add template for fentry/fexit programs
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
Dave Tucker b0577674b2
Merge pull request #23 from willfindlay/main
xtask/run: fix clippy lint
3 years ago
Dave Tucker 75625e4a86
Merge pull request #24 from willfindlay/fix-ci
ebpf: use new SkBuffContext instead of SkSkbContext
3 years ago
William Findlay d4a4f33902
ebpf: use new SkBuffContext instead of SkSkbContext 3 years ago
William Findlay dc7eb0410f
xtask/run: fix clippy lint 3 years ago
Dave Tucker 292ae61bee update to new api in aya main
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker e18bfe3e0d rename userspace feature to user
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 8be4317287
Merge pull request #21 from willfindlay/include_bytes_aligned
userspace: use include_bytes_aligned! instead of --path flag
3 years ago
William Findlay 89fb552f98
ci: fix ci to work with include_bytes_aligned!
This change requires the eBPF program to be built _before_ userspace.
Update CI to do this.
3 years ago