Skip to content

show state xpath /ietf-interfaces:interfaces: Configured IP but No IP Address in Output #99

@Shbinging

Description

@Shbinging

Problem Description

When running the show state xpath /ietf-interfaces:interfaces command, interfaces have configured IP addresses, but the output does not include any related IP address information.

Steps to Reproduce

  1. Configure an IPv4 or IPv6 address on an interface.
  2. Run show state xpath /ietf-interfaces:interfaces to check the state.
  3. The output shows only the basic interface fields (like name), but no IP address fields.

Expected Behavior

The state output should contain all configured IPv4/IPv6 addresses for each interface.

Preliminary Analysis

  • The code (holo-interface/src/northbound/state.rs) only implements state callbacks for basic fields (interface name). State callbacks for IP addresses are not registered or implemented, so IP addresses are missing from the state output.
  • The holo-interface/src/interface.rs struct includes an addresses field; so the data does exist.
  • It's recommended to refer to the northbound state implementations in OSPF/ISIS modules, and add state callbacks for /ietf-interfaces:interfaces/interface/ietf-ip:ipv4/address and /ietf-interfaces:interfaces/interface/ietf-ip:ipv6/address.

Relevant Code Snippet

// Only returns name
.get_object(|_master, args| {
    use interfaces::interface:: Interface;
    let iface = args.list_entry.as_interface().unwrap();
    Box::new(Interface {
        name: Cow::Borrowed(&iface.name),
        // No ip-related data returned
    })
})

Suggested Fix

  • Add state callback iterators and getters for interface IP addresses to the northbound state code.
  • Support both IPv4 and IPv6.
  • Ensure the show state command shows the correct interface IP addresses.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions