Skip to content

Commit

Permalink
Add epf2go example inspecting L3 IP header to acquire the protocol type.
Browse files Browse the repository at this point in the history
Signed-off-by: David-VTUK <[email protected]>

revert README.org to README.md to retain formatting

Signed-off-by: David-VTUK <[email protected]>

Resize diagram image

Signed-off-by: David-VTUK <[email protected]>
  • Loading branch information
David-VTUK committed Feb 12, 2025
1 parent ed35685 commit 09ecce3
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
3 changes: 3 additions & 0 deletions devcontainer-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Devcontainer Examples

The following directory includes examples of [Visual Studio Code Devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) configurations for developing ebpf applications.
33 changes: 33 additions & 0 deletions devcontainer-example/ebpf-and-go/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM mcr.microsoft.com/devcontainers/go:1.23-bookworm

RUN apt update

RUN apt install -y build-essential
RUN apt install -y pkg-config
RUN apt install -y clang
RUN apt install -y llvm
RUN apt install -y git
RUN apt install -y libelf-dev
RUN apt install -y libpcap-dev
RUN apt install -y iproute2
RUN apt install -y iputils-ping
RUN apt install -y linux-headers-generic
RUN apt install -y libbpf-dev
RUN apt install -y linux-libc-dev
RUN apt install -y cmake
RUN apt install -y libpcap-dev
RUN apt install -y libcap-ng-dev
RUN apt install -y libbfd-dev
RUN apt install -y gcc-multilib
RUN apt install -y m4
RUN ln -sf /usr/include/asm-generic/ /usr/include/asm
RUN apt install -y libcap-dev
RUN ln -sf /usr/local/go/bin/go /bin/go
RUN ln -sf /usr/include/asm-generic/ /usr/include/asm

RUN mkdir /sources/
WORKDIR /sources/
RUN git clone --recurse-submodules https://github.com/libbpf/bpftool.git
RUN make -C bpftool/src/ install
RUN git clone --recurse-submodules https://github.com/xdp-project/xdp-tools.git
RUN make -C xdp-tools/ install
22 changes: 22 additions & 0 deletions devcontainer-example/ebpf-and-go/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Go-ebpf-env",
"build": {"dockerfile": "Dockerfile"},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {},
"extensions": [
"streetsidesoftware.code-spell-checker",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools",
"nicknickolaev.ebpf-assembly",
"golang.Go"
]
}
},

"runArgs": ["--network=host"],
"privileged": true
}

0 comments on commit 09ecce3

Please sign in to comment.