Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 2.67 KB

README.md

File metadata and controls

51 lines (42 loc) · 2.67 KB

Prism

Refract your network traffic like a prism🌈

Getting Started

sudo prism [-i interval] interface
 2024-08-01T14:38:39+08:00 2m8s
 ┌───────┬───────┬───────┬─────────┬───────────┬────────────┐
 │ L2    │ L3    │ L4    │ PACKETS │ BYTES     │ PERCENTAGE │
 ├───────┼───────┼───────┼─────────┼───────────┼────────────┤
 │ Eth   │ ARP   │ Other │     267 │ 15.64KiB  │ 8.67%      │
 │       ├───────┼───────┼─────────┼───────────┼────────────┤
 │       │ IPv4  │ ICMP  │       4 │ 392B      │ 0.13%      │
 │       │       ├───────┼─────────┼───────────┼────────────┤
 │       │       │ IGMP  │      70 │ 4.13KiB   │ 2.27%      │
 │       │       ├───────┼─────────┼───────────┼────────────┤
 │       │       │ TCP   │    1780 │ 1.21MiB   │ 57.81%     │
 │       │       ├───────┼─────────┼───────────┼────────────┤
 │       │       │ UDP   │     948 │ 246.94KiB │ 30.79%     │
 │       ├───────┼───────┼─────────┼───────────┼────────────┤
 │       │ IPv6  │ Other │       6 │ 436B      │ 0.19%      │
 │       │       ├───────┼─────────┼───────────┼────────────┤
 │       │       │ UDP   │       4 │ 1.65KiB   │ 0.13%      │
 ├───────┴───────┴───────┼─────────┼───────────┼────────────┤
 │         TOTAL         │    3079 │ 1.47MIB   │ 100%       │
 └───────────────────────┴─────────┴───────────┴────────────┘

Build From Source

Prerequisites

  • make
  • libbpf
  • bpftool
  • llvm
  • clang
  • go
# Compile XDP program
go generate ./...

# Build prism
CGO_ENABLED=0 go build . -o prism