53 lines
1.3 KiB
Smarty

{{- /*gotype: subnetter/cmd/subnetter.tableOpts*/ -}}
{{- $opts := . -}}
{{- $numRows := 0 -}}
{{- if not $opts.NoIpv4 }}
IPv4:
{{- if $opts.Legacy -}}
{{- $legacyspec := legacy4 }}
{{- $numRows = len $legacyspec.Rows }}
LEGACY:
{{ $legacyspec.Sizer.Hdr "" $opts.Plain }}
{{- range $idx, $row := $legacyspec.Rows }}
{{- $row.Row $legacyspec.Sizer "\t" $opts.Plain -}}
{{- $legacyspec.Sizer.Line "\t" $opts.Plain $idx $numRows }}
{{- end }}
{{- end }}
{{- if not $opts.NoV4Mask }}
{{- $masks := mask4 }}
NETMASKS:
{{ $masks.Sizer.Hdr "\t" $opts.Plain }}
{{- range $idx, $row := $masks.Rows }}
{{- $row.Row $masks.Sizer "\t" $opts.Plain }}
{{- $masks.Sizer.Line "\t" $opts.Plain $idx $numRows }}
{{- end }}
{{- end }}
CIDR:
{{- $pfxs := addrs 4 }}
{{- $numRows = len $pfxs.Rows }}
{{ $pfxs.Sizer.Hdr "" $opts.Plain }}
{{- range $idx, $row := $pfxs.Rows }}
{{- $row.Row $pfxs.Sizer "\t" $opts.Plain }}
{{- $pfxs.Sizer.Line "\t" $opts.Plain $idx $numRows }}
{{- end }}
{{- end }}
{{- if not $opts.NoIpv6 }}
IPv6:
CIDR:
{{- $pfxs := addrs 6 }}
{{- $numRows = len $pfxs.Rows }}
{{- $pfxs.Sizer.Hdr "\t" $opts.Plain }}
{{- range $idx, $row := $pfxs.Rows }}
{{- $row.Row $pfxs.Sizer "\t" $opts.Plain }}
{{- $pfxs.Sizer.Line "\t" $opts.Plain $idx $numRows }}
{{- end }}
{{- end }}