just needs reserved prefix warnings implemented
This commit is contained in:
@@ -67,7 +67,36 @@ func main() {
|
||||
}
|
||||
|
||||
switch parser.Active.Name {
|
||||
case "net":
|
||||
if origPfx, err = netip.ParsePrefix(args.ExplicitNetwork.Network.Network); err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
pfx = netipx.PrefixIPNet(origPfx.Masked())
|
||||
cmnArgs = common{
|
||||
outputOpts: outputOpts{
|
||||
SuppressRemaining: true,
|
||||
Plain: args.ExplicitNetwork.Plain,
|
||||
Verbose: args.ExplicitNetwork.Verbose,
|
||||
Seperator: args.ExplicitNetwork.Seperator,
|
||||
Fmt: args.ExplicitNetwork.Fmt,
|
||||
},
|
||||
AllowReserved: true,
|
||||
AllowHostNet: true,
|
||||
Network: args.ExplicitNetwork.Network,
|
||||
}
|
||||
nets = make([]*netip.Prefix, 1)
|
||||
nets[0] = new(netip.Prefix)
|
||||
*nets[0] = origPfx.Masked()
|
||||
if err = printNets(&origPfx, pfx, nets, nil, &cmnArgs, nil); err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
return
|
||||
case "table":
|
||||
// Account for a weird redundant CLI condition.
|
||||
if args.Table.tableOpts.NoIpv4 && args.Table.tableOpts.NoIpv6 {
|
||||
args.Table.tableOpts.NoIpv6 = false
|
||||
args.Table.tableOpts.NoIpv4 = false
|
||||
}
|
||||
buf = new(bytes.Buffer)
|
||||
if err = tblTpl.ExecuteTemplate(buf, "table.tpl", args.Table.tableOpts); err != nil {
|
||||
log.Panicln(err)
|
||||
|
||||
Reference in New Issue
Block a user