Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add verbose flag and default to not showing packets #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func main() {
// Read config file and generate mDNS forwarding maps
configPath := flag.String("config", "", "Config file in TOML format")
debug := flag.Bool("debug", false, "Enable pprof server on /debug/pprof/")
verbose := flag.Bool("verbose", false, "Show bonjour packets")
flag.Parse()

// Start debug server
Expand Down Expand Up @@ -57,7 +58,9 @@ func main() {

// Process Bonjours packets
for bonjourPacket := range bonjourPackets {
fmt.Println(bonjourPacket.packet.String())
if *verbose {
fmt.Println(bonjourPacket.packet.String())
}

// Forward the mDNS query or response to appropriate VLANs
if bonjourPacket.isDNSQuery {
Expand Down