Add 'state' field to interfaces and sub-interfaces

Assert that children cannot be 'up' of their parent is 'down'. Add tests. Update user-guide.
This commit is contained in:
Pim van Pelt
2022-04-05 11:06:33 +00:00
parent 65de792e35
commit b461ef49bb
10 changed files with 59 additions and 2 deletions

View File

@ -316,6 +316,9 @@ class VPPApiDumper(VPPApi):
if iface.sw_if_index in self.cache['l2xcs']:
l2xc = self.cache['l2xcs'][iface.sw_if_index]
i['l2xc'] = self.cache['interfaces'][l2xc.tx_sw_if_index].interface_name
if not self.cache['interfaces'][idx].flags & 1: # IF_STATUS_API_FLAG_ADMIN_UP
i['state'] = 'down'
i['mtu'] = iface.mtu[0]
if iface.sub_number_of_tags == 0:
config['interfaces'][iface.interface_name] = i