Ejemplo n.º 1
0
             "name": interface.name(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":
Ejemplo n.º 2
0
         'generic info', {
             'name': interface.name(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
Ejemplo n.º 3
0
rsp = {}

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)
Ejemplo n.º 4
0
                if_info['humanName'] = interface.humanName(i)
                if_info['virtual'] = interface.virtual(i)
                if_info['speed'] = interface.speed(i)
                if_info['mtu'] = interface.mtu(i)
                if_info['bpf'] = interface.bpf(i)

                # Add interface info to interface data.
                info['generic info'] = if_info

                # add time info to interface data
                # this is a dictionary
                info['interface time'] = interface.time(i)

                # Interface address info
                if_addr = {}
                if_addr['ipv4 address'] = interface.ipv4(i)
                if_addr['ipv6 address'] = interface.ipv6(i)
                if_addr['network'] = interface.network(i)
                if_addr['n.hosts'] = interface.numHosts(i)

                # Add address info to interface data
                info['interface address'] = if_addr

                ifdata = [{"data": info, "metadata": info_metadata}]

                rsp[interface.uniqueName(i)]['interface'] = ifdata

            if (len(topic) == 0 or topic.lower() == "protocols"):

                # Statistics of the interface traffic
                rs = interface.pktsStats(i)
Ejemplo n.º 5
0
rsp = {}

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)
Ejemplo n.º 6
0
				if_info['humanName'] = interface.humanName(i)
				if_info['virtual'] = interface.virtual(i)
				if_info['speed'] = interface.speed(i)
				if_info['mtu'] = interface.mtu(i)
				if_info['bpf'] = interface.bpf(i)

				# Add interface info to interface data.
				info['generic info'] = if_info

				# add time info to interface data
				# this is a dictionary
				info['interface time'] = interface.time(i)

				# Interface address info
				if_addr = {}
				if_addr['ipv4 address'] = interface.ipv4(i)
				if_addr['ipv6 address'] = interface.ipv6(i)
				if_addr['network'] = interface.network(i)
				if_addr['n.hosts'] = interface.numHosts(i)
				
				# Add address info to interface data
				info['interface address'] = if_addr
			
				ifdata = [{"data" : info, "metadata" : info_metadata}]
				
				rsp[interface.uniqueName(i)]['interface'] = ifdata
			
			if (len(topic) == 0 or topic.lower() == "protocols"):
				
				# Statistics of the interface traffic
				rs = interface.pktsStats(i)