From 0ea8d80990856001e4cddbb235339ee19eeb7c3f Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 9 Jun 2019 20:52:04 +0530 Subject: [PATCH] minor changes --- DnsServerCore/Dhcp/DhcpMessage.cs | 13 +++++++++++++ DnsServerCore/Dhcp/DhcpOption.cs | 4 ++-- .../Dhcp/Options/ClasslessStaticRouteOption.cs | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/DnsServerCore/Dhcp/DhcpMessage.cs b/DnsServerCore/Dhcp/DhcpMessage.cs index 18cf8ead..55d33c13 100644 --- a/DnsServerCore/Dhcp/DhcpMessage.cs +++ b/DnsServerCore/Dhcp/DhcpMessage.cs @@ -328,6 +328,19 @@ namespace DnsServerCore.Dhcp option.WriteTo(s); } + public string GetClientFullIdentifier() + { + string hardwareAddress = BitConverter.ToString(_clientHardwareAddress); + + if (_clientFullyQualifiedDomainName != null) + return _clientFullyQualifiedDomainName.DomainName + " [" + hardwareAddress + "]"; + + if (_hostName != null) + return _hostName.HostName + " [" + hardwareAddress + "]"; + + return "[" + hardwareAddress + "]"; + } + #endregion #region properties diff --git a/DnsServerCore/Dhcp/DhcpOption.cs b/DnsServerCore/Dhcp/DhcpOption.cs index 3b3840e6..0a6b567d 100644 --- a/DnsServerCore/Dhcp/DhcpOption.cs +++ b/DnsServerCore/Dhcp/DhcpOption.cs @@ -24,7 +24,7 @@ using TechnitiumLibrary.IO; namespace DnsServerCore.Dhcp { - enum DhcpOptionCode : byte + public enum DhcpOptionCode : byte { Pad = 0, SubnetMask = 1, @@ -106,7 +106,7 @@ namespace DnsServerCore.Dhcp End = 255 } - class DhcpOption + public class DhcpOption { #region variables diff --git a/DnsServerCore/Dhcp/Options/ClasslessStaticRouteOption.cs b/DnsServerCore/Dhcp/Options/ClasslessStaticRouteOption.cs index 021e952a..196c4d28 100644 --- a/DnsServerCore/Dhcp/Options/ClasslessStaticRouteOption.cs +++ b/DnsServerCore/Dhcp/Options/ClasslessStaticRouteOption.cs @@ -25,7 +25,7 @@ using TechnitiumLibrary.IO; namespace DnsServerCore.Dhcp.Options { - class ClasslessStaticRouteOption : DhcpOption + public class ClasslessStaticRouteOption : DhcpOption { #region variables