hpimdm/Main.py
def list_neighbors_state(ipv4=False, ipv6=False):
    """
    List all stored state regarding each tree of each neighbor (Upstream and Interest state)
    """
    if ipv4 and interfaces is not None:
        hpim_interfaces = list(interfaces.values())
    elif ipv6 and interfaces_v6 is not None:
        hpim_interfaces = list(interfaces_v6.values())
    else:
        raise Exception("Unknown IP family")

    t = PrettyTable(['Interface', 'Neighbor', 'Tree', 'RPC Upstream State'])
    for interface in hpim_interfaces:
        for neighbor in interface.get_neighbors():
            for (tree_id, tree_state) in neighbor.tree_metric_state.copy().items():
                t.add_row([interface.interface_name, neighbor.ip, tree_id, tree_state])
    table_txt = "Upstream state:\n" + str(t)

    t = PrettyTable(['Interface', 'Neighbor', 'Tree', 'Interest State'])
    for interface in hpim_interfaces:
        for neighbor in interface.get_neighbors():
            for (tree_id, tree_state) in neighbor.tree_interest_state.copy().items():
                t.add_row([interface.interface_name, neighbor.ip, tree_id, tree_state])
    table_txt += "\n\n\nInterest state:\n" + str(t)
    return str(table_txt)

    List all stored state regarding each tree of each neighbor (Upstream and Interest state)
    
List all stored state regarding each tree of each neighbor (Upstream and Interest state)
List all stored state regarding each tree of each neighbor ( Upstream and Interest state )
def list_neighbors_state(ipv4=False, ipv6=False):
    if ipv4 and interfaces is not None:
        hpim_interfaces = list(interfaces.values())
    elif ipv6 and interfaces_v6 is not None:
        hpim_interfaces = list(interfaces_v6.values())
    else:
        raise Exception("Unknown IP family")
    t = PrettyTable(['Interface', 'Neighbor', 'Tree', 'RPC Upstream State'])
    for interface in hpim_interfaces:
        for neighbor in interface.get_neighbors():
            for (tree_id, tree_state) in neighbor.tree_metric_state.copy().items():
                t.add_row([interface.interface_name, neighbor.ip, tree_id, tree_state])
    table_txt = "Upstream state:\n" + str(t)
    t = PrettyTable(['Interface', 'Neighbor', 'Tree', 'Interest State'])
    for interface in hpim_interfaces:
        for neighbor in interface.get_neighbors():
            for (tree_id, tree_state) in neighbor.tree_interest_state.copy().items():
                t.add_row([interface.interface_name, neighbor.ip, tree_id, tree_state])
    table_txt += "\n\n\nInterest state:\n" + str(t)
    return str(table_txt)
def list_neighbors_state ( ipv4 = False , ipv6 = False ) : if ipv4 and interfaces is not None : hpim_interfaces = list ( interfaces . values ( ) ) elif ipv6 and interfaces_v6 is not None : hpim_interfaces = list ( interfaces_v6 . values ( ) ) else : raise Exception ( "Unknown IP family" ) t = PrettyTable ( [ 'Interface' , 'Neighbor' , 'Tree' , 'RPC Upstream State' ] ) for interface in hpim_interfaces : for neighbor in interface . get_neighbors ( ) : for ( tree_id , tree_state ) in neighbor . tree_metric_state . copy ( ) . items ( ) : t . add_row ( [ interface . interface_name , neighbor . ip , tree_id , tree_state ] ) table_txt = "Upstream state:\n" + str ( t ) t = PrettyTable ( [ 'Interface' , 'Neighbor' , 'Tree' , 'Interest State' ] ) for interface in hpim_interfaces : for neighbor in interface . get_neighbors ( ) : for ( tree_id , tree_state ) in neighbor . tree_interest_state . copy ( ) . items ( ) : t . add_row ( [ interface . interface_name , neighbor . ip , tree_id , tree_state ] ) table_txt += "\n\n\nInterest state:\n" + str ( t ) return str ( table_txt )
List all stored state regarding each tree of each neighbor (Upstream and Interest state)
List all stored state regarding each tree of each neighbor ( Upstream and Interest state )
"""
    List all stored state regarding each tree of each neighbor (Upstream and Interest state)
    """
ipv4
ipv6