code: def _which_ip_protocol(element):
      
      try:
          if element.typeof in ('host', 'router'):
              return getattr(element, 'address', False), getattr(element, 'ipv6_address', False)
          elif element.typeof == 'netlink':
              gateway = element.gateway
              if gateway.typeof == 'router':
                  return getattr(gateway, 'address', False), getattr(gateway, 'ipv6_address', False)
              # It's an engine, return true
          elif element.typeof == 'network':
              return getattr(element, 'ipv4_network', False), getattr(element, 'ipv6_network', False)
      except AttributeError:
          pass
      # Always return true so that the calling function assumes the element
      # is valid for the routing node. This could fail when submitting but
      # we don't want to prevent adding elements yet since this could change
      return True, True
docs: Validate the protocol addresses for the element. Most elements can
      have an IPv4 or IPv6 address assigned on the same element. This
      allows elements to be validated and placed on the right network.
      
      :return: boolean tuple
      :rtype: tuple(ipv4, ipv6)