#@ load("@ytt:ip", "ip")

#@ addr, net = ip.parse_cidr("192.0.2.1/24")
ipv4:
  addr: #@ addr.string()
  addr_is_ipv4: #@ addr.is_ipv4()
  addr_is_ipv6: #@ addr.is_ipv6()
  net: #@ net.string()
  net_addr: #@ net.addr().string()
  net_addr_is_ipv4: #@ net.addr().is_ipv4()
  net_addr_is_ipv6: #@ net.addr().is_ipv6()

#@ addr, net = ip.parse_cidr("2001:db8::1/96")
ipv6:
  addr: #@ addr.string()
  addr_is_ipv4: #@ addr.is_ipv4()
  addr_is_ipv6: #@ addr.is_ipv6()
  net: #@ net.string()
  net_addr: #@ net.addr().string()
  net_addr_is_ipv4: #@ net.addr().is_ipv4()
  net_addr_is_ipv6: #@ net.addr().is_ipv6()

+++

ipv4:
  addr: 192.0.2.1
  addr_is_ipv4: true
  addr_is_ipv6: false
  net: 192.0.2.0/24
  net_addr: 192.0.2.0
  net_addr_is_ipv4: true
  net_addr_is_ipv6: false
ipv6:
  addr: 2001:db8::1
  addr_is_ipv4: false
  addr_is_ipv6: true
  net: 2001:db8::/96
  net_addr: '2001:db8::'
  net_addr_is_ipv4: false
  net_addr_is_ipv6: true
