Commit 28b51ae5 authored by Pedro Oliveira's avatar Pedro Oliveira

Use -li to check if StateRefresh is enabled

parent 1e75e8f6
...@@ -79,7 +79,7 @@ def list_neighbors(): ...@@ -79,7 +79,7 @@ def list_neighbors():
def list_enabled_interfaces(): def list_enabled_interfaces():
global interfaces global interfaces
t = PrettyTable(['Interface', 'IP', 'PIM/IGMP Enabled', 'IGMP State']) t = PrettyTable(['Interface', 'IP', 'PIM/IGMP Enabled', 'State Refresh Enabled', 'IGMP State'])
for interface in netifaces.interfaces(): for interface in netifaces.interfaces():
try: try:
# TODO: fix same interface with multiple ips # TODO: fix same interface with multiple ips
...@@ -87,11 +87,13 @@ def list_enabled_interfaces(): ...@@ -87,11 +87,13 @@ def list_enabled_interfaces():
pim_enabled = interface in interfaces pim_enabled = interface in interfaces
igmp_enabled = interface in igmp_interfaces igmp_enabled = interface in igmp_interfaces
enabled = str(pim_enabled) + "/" + str(igmp_enabled) enabled = str(pim_enabled) + "/" + str(igmp_enabled)
state_refresh_enabled = "-"
if pim_enabled:
state_refresh_enabled = interfaces[interface].is_state_refresh_enabled()
igmp_state = "-"
if igmp_enabled: if igmp_enabled:
state = igmp_interfaces[interface].interface_state.print_state() igmp_state = igmp_interfaces[interface].interface_state.print_state()
else: t.add_row([interface, ip, enabled, state_refresh_enabled, igmp_state])
state = "-"
t.add_row([interface, ip, enabled, state])
except Exception: except Exception:
continue continue
print(t) print(t)
......
...@@ -9,7 +9,7 @@ import os ...@@ -9,7 +9,7 @@ import os
import argparse import argparse
import traceback import traceback
VERSION = "1.0.4" VERSION = "1.0.4.1"
def client_socket(data_to_send): def client_socket(data_to_send):
# Create a UDS socket # Create a UDS socket
......
...@@ -13,7 +13,7 @@ setup( ...@@ -13,7 +13,7 @@ setup(
long_description=open("README.md", "r").read(), long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
keywords="PIM-DM Multicast Routing Protocol Dense-Mode Router RFC3973", keywords="PIM-DM Multicast Routing Protocol Dense-Mode Router RFC3973",
version="1.0.4", version="1.0.4.1",
url="http://github.com/pedrofran12/pim_dm", url="http://github.com/pedrofran12/pim_dm",
author="Pedro Oliveira", author="Pedro Oliveira",
author_email="pedro.francisco.oliveira@tecnico.ulisboa.pt", author_email="pedro.francisco.oliveira@tecnico.ulisboa.pt",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment