48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
// /**
|
|
// * File: CrawlPool.cs
|
|
// * Author: haraldwolff
|
|
// *
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
// *
|
|
// *
|
|
// **/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using ln.types;
|
|
namespace ln.skyscanner.entities
|
|
{
|
|
public class CrawlPool
|
|
{
|
|
public Dictionary<CIDR, Subnet> Subnets = new Dictionary<CIDR, Subnet>();
|
|
public Dictionary<CIDR, Node> Nodes = new Dictionary<CIDR, Node>();
|
|
|
|
public Dictionary<string, Check> Checks = new Dictionary<String, Check>();
|
|
|
|
public CrawlPool()
|
|
{
|
|
}
|
|
|
|
public Subnet GetSubnet(CIDR network)
|
|
{
|
|
if (Subnets.ContainsKey(network))
|
|
return Subnets[network];
|
|
|
|
Subnet subnet = new Subnet(network);
|
|
Subnets.Add(network,subnet);
|
|
return subnet;
|
|
}
|
|
|
|
public Node GetNode(CIDR ip)
|
|
{
|
|
if (Nodes.ContainsKey(ip))
|
|
return Nodes[ip];
|
|
Node node = new Node(ip);
|
|
Nodes[ip] = node;
|
|
return node;
|
|
}
|
|
|
|
|
|
}
|
|
}
|