"virtual": "Yes" if interface.virtual(i) else "No", "speed": interface.speed(i) if interface.speed(i) else "Unknown", "mtu": interface.mtu(i), "bpf filter": interface.bpf(i) or "none", }, ) # interface time group # suspended at the moment # widget.setKeyAndValue('interface time', interface.time(i)) # interface address info widget.setKeyAndValue( "interface address", { "IPv4 address": interface.ipv4(i), "IPv6 address": interface.ipv6(i), "network": interface.network(i), "active host number": interface.numHosts(i), }, ) # =============================== # IP Statistics Widget Data # =============================== if widgetId.lower() == "ipstats": # pie chart is a serie of key-value pairs widget.setProperties(interface.ipStats(i)) # =============================== # TCP Statistics Widget Data # =============================== if widgetId.lower() == "tcpstats": # pie chart is a serie of key-value pairs widget.setProperties(interface.tcpStats(i))
try: for i in range(interface.numInterfaces()): if ((len(name) == 0) or (name == interface.name(i))): info = {} info['name'] = interface.name(i) info['humanName'] = interface.humanName(i) info['time'] = interface.time(i) info['virtual'] = interface.virtual(i) info['speed'] = interface.speed(i) info['mtu'] = interface.mtu(i) info['bpf'] = interface.bpf(i) addr = {} addr['ipv4'] = interface.ipv4(i) addr['network'] = interface.network(i) addr['numHosts'] = interface.numHosts(i) addr['ipv6'] = interface.ipv6(i) info['address'] = addr if ((len(mode) == 0) or not (mode == "list")): stats = {} stats['pktsStats'] = interface.pktsStats(i) stats['bytesStats'] = interface.bytesStats(i) stats['throughputStats'] = interface.throughputStats(i) ip = {} ip['tcp'] = interface.tcpStats(i) ip['udp'] = interface.udpStats(i) ip['icmp'] = interface.icmpStats(i) ip['ip'] = interface.ipStats(i)
'human name': interface.humanName(i), 'virtual': 'Yes' if interface.virtual(i) else 'No', 'speed': interface.speed(i) if interface.speed(i) else 'Unknown', 'mtu': interface.mtu(i), 'bpf filter': interface.bpf(i) or 'none' }) # interface time group # suspended at the moment # widget.setKeyAndValue('interface time', interface.time(i)) # interface address info widget.setKeyAndValue( 'interface address', { 'IPv4 address': interface.ipv4(i), 'IPv6 address': interface.ipv6(i), 'network': interface.network(i), 'active host number': interface.numHosts(i) }) # =============================== # IP Statistics Widget Data # =============================== if (widgetId.lower() == "ipstats"): # pie chart is a serie of key-value pairs widget.setProperties(interface.ipStats(i)) # =============================== # TCP Statistics Widget Data # =============================== if (widgetId.lower() == "tcpstats"): # pie chart is a serie of key-value pairs widget.setProperties(interface.tcpStats(i)) # ===============================
try: for i in range(interface.numInterfaces()): if((len(name) == 0) or (name == interface.name(i))): info = {} info['name'] = interface.name(i) info['humanName'] = interface.humanName(i) info['time'] = interface.time(i) info['virtual'] = interface.virtual(i) info['speed'] = interface.speed(i) info['mtu'] = interface.mtu(i) info['bpf'] = interface.bpf(i) addr = {} addr['ipv4'] = interface.ipv4(i) addr['network'] = interface.network(i) addr['numHosts'] = interface.numHosts(i) addr['ipv6'] = interface.ipv6(i) info['address'] = addr if((len(mode) == 0) or not(mode == "list")): stats = {} stats['pktsStats'] = interface.pktsStats(i) stats['bytesStats'] = interface.bytesStats(i) stats['throughputStats'] = interface.throughputStats(i) ip = {} ip['tcp'] = interface.tcpStats(i) ip['udp'] = interface.udpStats(i) ip['icmp'] = interface.icmpStats(i) ip['ip'] = interface.ipStats(i)