1234567891011121314151617181920 |
- using System.Linq;
- using System.Net;
- namespace DhcpServer
- {
- public partial class DhcpPacket
- {
- public string ClientMacAddressHex => string.Join("-", ClientMacAddress.Select(p => p.ToString("X2")));
- internal void LoadClientEntry(ClientEntry entry)
- {
- if (entry.IpAddress != null) YourIpAddress = IPAddress.Parse(entry.IpAddress);
- if (entry.SubNetMask != null) SubNetMask = IPAddress.Parse(entry.SubNetMask);
- if (entry.GateWay != null) Router = IPAddress.Parse(entry.GateWay);
- if (entry.DnsServer != null) DnsServer = IPAddress.Parse(entry.DnsServer);
- if (entry.TftpServer != null) TftpServer = entry.TftpServer;
- if (entry.BootFileName != null) BootFileName = entry.BootFileName;
- }
- }
- }
|