hpimdm/Main.py
def list_membership_state(ipv4=True, ipv6=False):
    """
    List IGMP/MLD state (state of each group regarding each interface)
    """
    t = PrettyTable(['Interface', 'RouterState', 'Group Adress', 'GroupState'])
    if ipv4 and igmp_interfaces is not None:
        membership_interfaces = igmp_interfaces
    elif ipv6 and mld_interfaces is not None:
        membership_interfaces = mld_interfaces
    else:
        membership_interfaces = {}

    for (interface_name, interface_obj) in list(membership_interfaces.items()):
        interface_state = interface_obj.interface_state
        state_txt = interface_state.print_state()
        print(interface_state.group_state.items())

        for (group_addr, group_state) in list(interface_state.group_state.items()):
            print(group_addr)
            group_state_txt = group_state.print_state()
            t.add_row([interface_name, state_txt, group_addr, group_state_txt])
    return str(t)

    List IGMP/MLD state (state of each group regarding each interface)
    
List IGMP/MLD state (state of each group regarding each interface)
List IGMP / MLD state ( state of each group regarding each interface )
def list_membership_state(ipv4=True, ipv6=False):
    t = PrettyTable(['Interface', 'RouterState', 'Group Adress', 'GroupState'])
    if ipv4 and igmp_interfaces is not None:
        membership_interfaces = igmp_interfaces
    elif ipv6 and mld_interfaces is not None:
        membership_interfaces = mld_interfaces
    else:
        membership_interfaces = {}
    for (interface_name, interface_obj) in list(membership_interfaces.items()):
        interface_state = interface_obj.interface_state
        state_txt = interface_state.print_state()
        print(interface_state.group_state.items())
        for (group_addr, group_state) in list(interface_state.group_state.items()):
            print(group_addr)
            group_state_txt = group_state.print_state()
            t.add_row([interface_name, state_txt, group_addr, group_state_txt])
    return str(t)
def list_membership_state ( ipv4 = True , ipv6 = False ) : t = PrettyTable ( [ 'Interface' , 'RouterState' , 'Group Adress' , 'GroupState' ] ) if ipv4 and igmp_interfaces is not None : membership_interfaces = igmp_interfaces elif ipv6 and mld_interfaces is not None : membership_interfaces = mld_interfaces else : membership_interfaces = { } for ( interface_name , interface_obj ) in list ( membership_interfaces . items ( ) ) : interface_state = interface_obj . interface_state state_txt = interface_state . print_state ( ) print ( interface_state . group_state . items ( ) ) for ( group_addr , group_state ) in list ( interface_state . group_state . items ( ) ) : print ( group_addr ) group_state_txt = group_state . print_state ( ) t . add_row ( [ interface_name , state_txt , group_addr , group_state_txt ] ) return str ( t )
List IGMP/MLD state (state of each group regarding each interface)
List IGMP / MLD state ( state of each group regarding each interface )
"""
    List IGMP/MLD state (state of each group regarding each interface)
    """
ipv4
ipv6