-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 1.16 KB
/
Copy pathMakefile
File metadata and controls
36 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.PHONY: build test lint vet smoke clean manuf-refresh
# Windows users: run `go build ./cmd/lan-inventory` directly — the setcap
# step does not apply. Npcap install handles capture privilege at install
# time.
build:
go build -o bin/lan-inventory ./cmd/lan-inventory
test:
go test ./...
vet:
go vet ./...
lint:
go run honnef.co/go/tools/cmd/staticcheck@latest ./...
smoke: build
sudo setcap cap_net_raw,cap_net_admin=eip ./bin/lan-inventory
./bin/lan-inventory --once --table
clean:
rm -rf bin/
manuf-refresh:
@echo "Fetching Wireshark manuf database..."
@curl -sSfL https://www.wireshark.org/download/automated/data/manuf -o /tmp/manuf.raw
@echo "Stripping comments and blank lines..."
@# Keep every allocation: MA-L (/24), MA-M (/28) and MA-S (/36). The parser
@# does longest-prefix matching across all three widths, so we no longer
@# filter slash-masked rows. (We must not grep out '/' wholesale anyway:
@# ~289 /24 vendor names legitimately contain a slash, e.g. "... A/S".)
@grep -v '^#' /tmp/manuf.raw | grep -v '^$$' > internal/oui/manuf.txt
@rm -f /tmp/manuf.raw
@wc -l internal/oui/manuf.txt
@echo "Done. Review the diff and commit if it looks right."