- is_*() returns True if the interface name is of a certain type
is_bondethernet() is_loopback() is_bvi() is_bridgedomain()
is_vxlan_tunnel() is_phy()
- get_phys() by process of elimination, returns all interface names
that are supposed to be physical network interfaces.
Add unit tests for validator/vxlan_tunnel.py
=> Notable: while here, fix a bug in get_by_name()
Add unit tests for all the is_*() and get_phys() functions.
This is more strict than VPP itself, which does allow a destination to
be L3 while the source is L2:
DBGvpp# show mode
l3 local0
l3 GigabitEthernet3/0/0
l3 GigabitEthernet3/0/1
l3 HundredGigabitEthernet12/0/0
l3 HundredGigabitEthernet12/0/1
DBGvpp# set interface l2 xconnect GigabitEthernet3/0/0 GigabitEthernet3/0/1
DBGvpp# show mode
l3 local0
l2 xconnect GigabitEthernet3/0/0 GigabitEthernet3/0/1
l3 GigabitEthernet3/0/1
l3 HundredGigabitEthernet12/0/0
l3 HundredGigabitEthernet12/0/1
But it seems undesirable to have Gi3/0/1 be in l3 mode even though it's
the target of a cross connect, so I'm going to leave the behavior
stricter than VPP.
They now all return a list [ifname, iface]. If no interface was found
they return None,None. If one was found, they return the (string) name
and the dictionary with interface contents.
Returns True if there is at most one occurence of the ip_interface (an IPv4/IPv6 prefix+len)
in the entire config. That said, we need the 'iface_addresses' because VPP is a bit fickle in
this regard.
IP addresses from the same prefix/len can be added to a given interface (ie 192.0.2.1/24 and
192.0.2.2/24), but other than that, any prefix can not occur as a more-specific or less-specific
of any other interface.
So, we will allow:
- any ip_interface that is of equal network/len of existing one(s) _on the same interface_
And, we will reject
- any ip_interface that is a more specific of any existing one
- any ip_interface that is a less specific of any existing one
Update unit tests to ensure ip_interfaces are allowed in all cases.
if any sub-int exists with a certain [dot1q,dot1ad,inner-dot1q], no
other sub-int in the same parent may exist with the same encapsulation.
- refactor sub-int mtu check to use get_mtu()
- if a sub-int has no config, raise a validation error
Refactor validator main function to avoid 'interface' symbol clash.
Add get_mtu() for interfaces, returns the sub-int's MTU or its parent's MTU, defaulting to 1500.
Ensure MTU for all bridge-domain members is set to the same value.
Ensure all bridge-domain members are L2 (have no LCP, have no address)