Exemplo n.º 1
0
        public RWhoisCrawler(string hostname, int port, int?ipv4Increment = null, BigInteger?ipv6Increment = null, int crawlIterationDelayMilli = 100, IWhoisParser rwhoisParser = null, IWhoisParser xferParser = null, bool attemptCrawlOrganizations = false)
        {
            this.client       = new RWhoisClient(hostname, port);
            this.rwhoisParser = rwhoisParser;
            this.xferParser   = xferParser;

            if (this.rwhoisParser == null)
            {
                this.rwhoisParser = new WhoisParser(new SectionTokenizer(), new RWhoisSectionParser());
            }

            if (this.xferParser == null)
            {
                this.xferParser = new WhoisParser(new RWhoisXferSectionTokenizer(), new RWhoisSectionParser());
            }

            this.observers = new List <IObserver <RawWhoisSection> >();
            this.rangesPreviouslySeenByObservers = new HashSet <IPAddressRange>(new IPAddressRangeEqualityComparer());

            if (ipv4Increment == null)
            {
                this.ipv4Increment = 16;
            }
            else
            {
                this.ipv4Increment = ipv4Increment.Value;
            }

            if (ipv6Increment == null)
            {
                // http://www.potato-people.com/blog/2009/02/ipv6-subnet-size-reference-table/
                // Business users can get a /48 IPv6 subnet, which is 2^80 IP addresses
                this.ipv6Increment = BigInteger.Pow(2, 80);
            }
            else
            {
                this.ipv6Increment = ipv6Increment.Value;
            }

            this.crawlIterationDelayMilli = crawlIterationDelayMilli;

            this.attemptCrawlOrganizations = attemptCrawlOrganizations;
        }
Exemplo n.º 2
0
 public LacnicTsvWriter(IWhoisParser parser) : base(parser)
 {
 }
Exemplo n.º 3
0
 public TsvWriter(IWhoisParser parser)
 {
     this.Parser = parser;
 }
Exemplo n.º 4
0
 public ArinTsvWriter(IWhoisParser parser) : base(parser)
 {
 }
 public NetworkLocationExtraction(IWhoisParser parser)
 {
     this.Parser = parser;
     this.OrganizationIdsToOrganizations   = new Dictionary <string, List <NormalizedOrganization> >();
     this.OrganizationNamesToOrganizations = new Dictionary <string, List <NormalizedOrganization> >();
 }
Exemplo n.º 6
0
 public AfrinicTsvWriter(IWhoisParser parser) : base(parser)
 {
 }
Exemplo n.º 7
0
        public async Task <IEnumerable <RawWhoisSection> > RetrieveSectionsForQueryAsync(IWhoisParser parser, string query)
        {
            if (parser == null)
            {
                throw new ArgumentNullException("parser");
            }

            var result = await this.RawClient.AnswerQueryAsync(query);

            if (result != null)
            {
                return(parser.RetrieveSectionsFromString(result));
            }

            return(Enumerable.Empty <RawWhoisSection>());
        }
Exemplo n.º 8
0
 public RipeTsvWriter(IWhoisParser parser) : base(parser)
 {
 }