diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/vpp/utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/vyos/vpp/utils.py b/python/vyos/vpp/utils.py index 963423e2b..0c247e48a 100644 --- a/python/vyos/vpp/utils.py +++ b/python/vyos/vpp/utils.py @@ -48,6 +48,22 @@ def iftunnel_transform(iface: str) -> str: return f'{iface_type}_tunnel{iface_num}' +def vpp_iface_name_transform(iface: str) -> str: + """Convert a CLI interface name to its corresponding VPP interface name format + + Args: + iface (str): Interface name as used in VyOS configuration (e.g., "bond0"). + + Returns: + str: Interface name formatted as recognized by VPP (e.g., "BondEthernet0"). + """ + vpp_iface_name = iface + if vpp_iface_name.startswith('bond'): + # interface name in VPP is BondEthernetX + vpp_iface_name = vpp_iface_name.replace('bond', 'BondEthernet') + return vpp_iface_name + + def cli_ifaces_list(config_instance, mode: str = 'candidate') -> list[str]: """List of all VPP interfaces (CLI names) |
