package main import ( "fmt" "iptcp-jailpt2/pkg/lnxconfig" "net/netip" "os" ) func main() { if len(os.Args) != 2 { fmt.Printf("Usage: %s \n", os.Args[0]) os.Exit(1) } fileName := os.Args[1] // Parse the file lnxConfig, err := lnxconfig.ParseConfig(fileName) if err != nil { panic(err) } // Demo: print out the IP for each interface in this config for _, iface := range lnxConfig.Interfaces { prefixForm := netip.PrefixFrom(iface.AssignedIP, iface.AssignedPrefix.Bits()) fmt.Printf("%s has IP %s\n", iface.Name, prefixForm.String()) } }