Skip to content

Commit

Permalink
add flags and restructure the contents
Browse files Browse the repository at this point in the history
  • Loading branch information
pouriyajamshidi committed Nov 8, 2024
1 parent 60b644a commit 83f9894
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ This repo is the companion to my blog posts about eBPF at <https://thegraynode.i

## Running The Program

Clone the repository.
You can install **flat** in two ways.

1. Download the [pre-compiled binary](#download-the-pre-compiled-binary)
2. Compile from [source](#compile-from-source)

### Download The Pre-compiled Binary

```bash
wget https://github.com/pouriyajamshidi/flat/releases/latest/download/flat
```

Then check out the [examples](#examples).

### Compile From Source

Clone the repository:

```bash
git clone https://github.com/pouriyajamshidi/flat .
Expand All @@ -32,13 +47,34 @@ Compile the **Go** program:
go build -ldflags "-s -w" -o flat cmd/flat.go
```

### Examples

Run it with elevated privileges:

```bash
# Replace eth0 with your desired interface name
sudo ./flat -i eth0
# Or
sudo ./flat -i eth0 -ip 1.1.1.1
# Or
sudo ./flat -i eth0 -port 53
# Or
sudo ./flat -i eth0 -ip 1.1.1.1 -port 53
```

## Flags

**flat** supports four flags at the moment:

| flag | Description |
| ----- | ----------------------------------- |
| -i | interface to attach the probe to |
| -ip | IP address to filter on (optional) |
| -port | Port number to filter on (optional) |
| -h | Show help message |

---

## Acknolegments

Heavily inspired by [flowlat](https://github.com/markpash/flowlat).

0 comments on commit 83f9894

Please sign in to comment.