| 01-capture-and-classification |
01 |
classification |
| go |
| gopacket |
| protocol-classification |
| tdd |
| packet-capture |
|
|
| Go 1.24.1 module initialized (github.com/netsynth/netsynth) |
| classify/types.go: TrafficClass (11 constants), ClassifiedPacket, WindowSnapshot shared types |
| classify/rules.go: Rule struct and DefaultRules slice with 12 ordered protocol rules |
| classify/classifier.go: Classifier with NewClassifier and Classify(gopacket.Packet) methods |
| Unit tests for all 11 traffic classes, 14 test cases, all passing |
|
| 01-capture-and-classification |
| 02-audio-synthesis |
| 03-clustering |
|
| added |
patterns |
| github.com/gopacket/gopacket v1.5.0 — packet decode and layer type assertions |
| github.com/packetcap/go-pcap v0.0.0-20251215 — in go.sum for Phase 1 capture plan |
| github.com/spf13/cobra v1.10.2 — in go.sum for Phase 1 CLI plan |
|
| Config-driven rule slice (not switch) for classification — per D-02 |
| First-match-wins rule evaluation over ordered []Rule slice |
| Classifier struct accepting rules at construction for testability |
| test package (classify_test) using gopacket SerializeLayers for synthetic packet construction |
|
|
| created |
modified |
| classify/types.go — TrafficClass, ClassifiedPacket, WindowSnapshot shared contracts |
| classify/rules.go — Rule struct, DefaultRules with 12 ordered protocol rules |
| classify/classifier.go — Classifier, NewClassifier, Classify method |
| classify/classifier_test.go — 14 test cases covering all 11 traffic classes |
| go.mod — module github.com/netsynth/netsynth, go 1.24.1 |
| go.sum — all dependency checksums |
|
|
|
| Go installed at /home/dev/tools/go-install/go (no sudo available) — export PATH=$PATH:/home/dev/tools/go-install/go/bin required |
| DefaultRules uses ordered slice with DstPort=0 as catch-all — enables first-match-wins without switch |
| ICMP checked before TCP/UDP in Classify to handle ICMP packets that decode no port |
| go mod tidy removes go-pcap and cobra from go.mod until they are imported in later plans |
|
| Classifier struct pattern: NewClassifier(rules []Rule) accepts rules at construction, enabling custom rules in tests |
| Synthetic packet construction: gopacket SerializeLayers with Ethernet+IPv4+TCP/UDP/ICMP layers |
|
|
4min |
2026-03-25 |