diff --git a/board/netconf/rootfs/lib/infix/cli-pretty b/board/netconf/rootfs/lib/infix/cli-pretty index 84b6f15c..5804b1c0 100755 --- a/board/netconf/rootfs/lib/infix/cli-pretty +++ b/board/netconf/rootfs/lib/infix/cli-pretty @@ -50,6 +50,7 @@ class Iface: self.oper_status = data.get('oper-status', '') self.autoneg = self.get_json_data('unknown', 'ieee802-ethernet-interface:ethernet', 'auto-negotiation', 'enable') + self.duplex = self.get_json_data('', 'ieee802-ethernet-interface:ethernet', 'duplex') self.phys_address = data.get('phys-address', '') if data.get('statistics'): @@ -189,6 +190,9 @@ class Iface: val = "on" if self.autoneg else "off" print(f"{'auto-negotiation':<{20}}: {val}") + if self.duplex: + print(f"{'duplex':<{20}}: {self.duplex}") + if self.phys_address: print(f"{'physical address':<{20}}: {self.phys_address}") diff --git a/board/netconf/rootfs/lib/infix/yanger b/board/netconf/rootfs/lib/infix/yanger index d80fc7b3..ac32547b 100755 --- a/board/netconf/rootfs/lib/infix/yanger +++ b/board/netconf/rootfs/lib/infix/yanger @@ -307,6 +307,14 @@ def add_ethtool_std(ifname, iface_out): else: insert(iface_out, "ieee802-ethernet-interface:ethernet", "auto-negotiation", "enable", False) + if "Duplex" in result: + if result['Duplex'] == "Half": + insert(iface_out, "ieee802-ethernet-interface:ethernet", "duplex", "half") + elif result['Duplex'] == "Full": + insert(iface_out, "ieee802-ethernet-interface:ethernet", "duplex", "full") + else: + insert(iface_out, "ieee802-ethernet-interface:ethernet", "duplex", "unknown") + if __name__ == "__main__": yang_data = { "ietf-interfaces:interfaces": {