This commit is contained in:
crusader 2018-04-28 01:46:07 +09:00
parent d8ffaa8d84
commit ba355a5665
6 changed files with 28 additions and 22 deletions

View File

@ -292,12 +292,13 @@ export class SettingComponent implements OnInit, AfterContentInit {
}
const discoverZone: DiscoverZone = {
discoverHost: {
firstScanRange: this.startIP,
lastScanRange: this.endIP,
firstScanRangev4: this.startIP,
lastScanRangev4: this.endIP,
discoverPort: discoverPort,
},
};
console.log(discoverZone);
// console.log('start discovery - ' + this.probe.probeKey);

View File

@ -1,10 +1,15 @@
import { DiscoverPort } from './DiscoverPort';
export interface DiscoverHost {
firstScanRange?: string;
lastScanRange?: string;
excludeHosts?: string[];
includeHosts?: string[];
firstScanRangev4?: string;
lastScanRangev4?: string;
excludeHostsv4?: string[];
includeHostsv4?: string[];
firstScanRangev6?: string;
lastScanRangev6?: string;
excludeHostsv6?: string[];
includeHostsv6?: string[];
discoverPort?: DiscoverPort;
}

View File

@ -3,8 +3,8 @@ import { Port } from './Port';
export interface Host {
id?: number;
ip4?: string;
ip6?: string;
ipv4?: string;
ipv6?: string;
mac: number;
os: string;
discoveredDate?: Date;

View File

@ -3,8 +3,8 @@ import { Host } from './Host';
export interface Zone {
id?: number;
network?: string;
ip4?: string;
ip6?: string;
ipv4?: string;
ipv6?: string;
iface?: string;
mac?: string;
discoveredDate?: Date;

View File

@ -70,10 +70,10 @@ export function reducer(state = initialState, action: Actions): State {
}
if (null === zone.hosts || undefined === zone.hosts) {
zone.hosts = new Map();
zone.hosts.set(host.ip4, host);
zone.hosts.set(host.ipv4, host);
} else {
if (zone.hosts.has(host.ip4) === false) {
zone.hosts.set(host.ip4, host);
if (zone.hosts.has(host.ipv4) === false) {
zone.hosts.set(host.ipv4, host);
}
}
@ -118,7 +118,7 @@ export function reducer(state = initialState, action: Actions): State {
zone.hosts = new Map();
}
let host: Host = null;
host = zone.hosts.get(port.host.ip4);
host = zone.hosts.get(port.host.ipv4);
if (host === undefined || host === null) {
host = port.host;
@ -133,7 +133,7 @@ export function reducer(state = initialState, action: Actions): State {
}
}
zone.hosts.set(host.ip4, host);
zone.hosts.set(host.ipv4, host);
zones.set(zone.network, zone);
const newZones: Map<string, Zone> = new Map();
@ -174,10 +174,10 @@ export function reducer(state = initialState, action: Actions): State {
// console.error(`Discovery.DiscoveredPort: Host[${service.port.host.ip}] is not exist`);
// }
let host: Host = null;
host = zone.hosts.get(service.port.host.ip4);
host = zone.hosts.get(service.port.host.ipv4);
if (host === undefined || host === null) {
zone.hosts.set(service.port.host.ip4, service.port.host);
zone.hosts.set(service.port.host.ipv4, service.port.host);
host = service.port.host;
}
@ -199,7 +199,7 @@ export function reducer(state = initialState, action: Actions): State {
port.services.set(service.serviceName, service);
host.ports.set(service.port.portNumber, port);
zone.hosts.set(host.ip4, host);
zone.hosts.set(host.ipv4, host);
zones.set(zone.network, zone);
const newZones: Map<string, Zone> = new Map();

View File

@ -7,10 +7,10 @@ import {
Host,
Port,
Service,
DiscoveryZone,
DiscoveryHost,
DiscoveryPort,
DiscoveryService as MDiscoveryService,
DiscoverZone as MDDiscoverZone,
DiscoverHost as MDDiscoverHost,
DiscoverPort as MDDiscoverPort,
DiscoverService as MDiscoverService,
} from '../../model';
import { Probe } from 'packages/probe/model';