Cookies Psst! Do you accept cookies?

We use cookies to enhance and personalise your experience.
Please accept our cookies. Checkout our Cookie Policy for more information.

Aya Rust tutorial Part Two - Setting up

© steve latif

Part Two: Setting up the Prerequisites

Assumptions

All the examples will be run on Ubuntu Linux. On other distributions your mileage may vary

First step: setup dependencies

Install packages

$ sudo apt install clang llvm libelf-dev libpcap-dev build-essential libc6-dev-i386  \
graphviz  make gcc libssl-dev bc libelf-dev libcap-dev clang gcc-multilib  \
libncurses5-dev git pkg-config libmnl-dev bison flex linux-tools-$(uname -r)

Verify that you have bpftool installed on your system

$ sudo bpftool prog 

If there are problems installing it from a package, you can install it from source:

$ git clone --recurse-submodules https://github.com/libbpf/bpftool.git
$ cd bpftool/src
$ make -j$(nproc)
$ sudo https://raw.githubusercontent.com/stevelatif/articles/main/blogs/bpftool prog

Install rust, following the instructions at https://rustup.rs/

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Once you have rust and cargo installed and in your path, install the following rust related tools:

$ rustup udpate
$ cargo install cargo-generate
$ cargo install bpf-linker
$ cargo install cargo-generate
$ cargo install rustfmt
$ cargo install bpf-linker

Last Stories

What's your thoughts?

Please Register or Login to your account to be able to submit your comment.