ln.skyscanner/entities/NetworkInterface.cs

55 lines
1.3 KiB
C#

// /**
// * File: Router.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;
using ln.skyscanner.crawl;
namespace ln.skyscanner.entities
{
public class NetworkInterface
{
public Node Node { get; private set; } = null;
public string Name { get; private set; } = "";
public CIDR[] IPs { get; set; } = new CIDR[0];
private NetworkInterface()
{ }
public NetworkInterface(Node node)
{
Node = node;
}
public NetworkInterface(Node node,String name)
{
Node = node;
Name = name;
}
public override int GetHashCode()
{
return Node.GetHashCode() ^ Name.GetHashCode();
}
public override bool Equals(object obj)
{
if (obj is NetworkInterface)
{
NetworkInterface networkInterface = obj as NetworkInterface;
return Node.Equals(networkInterface.Node) && Name.Equals(networkInterface.Name);
}
return false;
}
}
}