ln.skyscanner/crawl/tests/RFC1213.cs

40 lines
1.2 KiB
C#

// /**
// * File: RFC1213.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 ln.snmp.endpoint;
using ln.snmp;
using System.Linq;
using ln.types;
namespace ln.skyscanner.crawl.tests
{
public static class RFC1213
{
public static void Check(CrawledHost crawledHost)
{
String[] orIDS = crawledHost.GetHint<String[]>("snmp.orids", new string[0]);
String prID = crawledHost.GetHint<string>("snmp.sysObjectID", "");
if (orIDS.Contains("1.3.6.1.2.1.31") || prID.Equals("1.3.6.1.4.1.14988.1"))
{
using (SnmpInterface snmp = SNMP.GetSnmpInterface(crawledHost))
{
ln.snmp.rfc1213.RFC1213.Interface[] interfaces = ln.snmp.rfc1213.RFC1213.GetInterfaces(snmp);
if (interfaces.Length > 0)
{
crawledHost.Interfaces = interfaces;
crawledHost.SetHint("rfc1213", true);
}
}
}
}
}
}