Commit Graph

14 Commits

Author SHA1 Message Date
5ecd1ef22c Add unit tests for loopbacks; While here, fix a bug in get_by_name(), yaay 2022-03-22 18:03:38 +00:00
ba22b1aad8 Refactor for *_get_by_name()
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.
2022-03-21 08:47:05 +00:00
5876465327 A few cosmetic changes in logging 2022-03-15 20:57:11 +00:00
13f211f27a Make clearer that 'is not allowed' actually means that the address conflicts with another 2022-03-14 00:18:46 +00:00
bb57ed8e52 IP Address validator
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.
2022-03-13 23:50:10 +00:00
5c61259edd Add copyright and license 2022-03-13 21:08:32 +00:00
763c1ca74c Ensure that LCP names are globally unique (between interface/sub-interface/loopback/bridgedomain) 2022-03-13 19:53:13 +00:00
8825984d49 Force loopbacks with an address to have an LCP 2022-03-13 19:27:27 +00:00
881c0faaab Only pass 'schema' to the validator creation. 2022-03-13 16:48:52 +00:00
6b8735bb18 Add bridge-domain support.
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)
2022-03-13 11:20:40 +00:00
3d6903bfdc Rewrite 'exists' to 'get_by_name' 2022-03-13 10:44:59 +00:00
61b6c01e73 Only loop over loopbacks if they are present in the config 2022-03-13 10:30:06 +00:00
edb8e301ff Add loopbacks 2022-03-13 10:18:27 +00:00
9862129ab0 Initial commit 2022-03-13 09:54:50 +00:00