public void AddressOffer(IDhcpServerPacket Packet, OfferAddressControlCodes ControlCode, DhcpServerIpAddress ServerAddress, DhcpServerIpAddress LeaseAddress, OfferAddressTypes AddressType, TimeSpan LeaseTime, ref bool StopPropagation)
        {
            try
            {
                var sb = new StringBuilder();
                sb.AppendLine("ADDRESS OFFER:");
                sb.AppendLine($" Transaction Id: {Packet.TransactionId}");
                sb.AppendLine($" Parameters:");
                sb.AppendLine($"  Dhcp Message Type: {Packet.DhcpMessageType}");
                sb.AppendLine($"  Control Code: {ControlCode}");
                sb.AppendLine($"  Offering: {LeaseAddress}");
                sb.AppendLine($"  Type: {AddressType}");
                sb.AppendLine($"  Time: {LeaseTime}");
                sb.AppendLine("---------------------");

                WriteLog(sb.ToString());
            }
            catch (Exception ex)
            {
                WriteLog($"ADDRESS OFFER ERROR: {ex.Message} [{ex.GetType().Name}]");
                WriteLog(ex.StackTrace);

                throw;
            }
        }
        public void HandleOptions(IDhcpServerPacket Packet, DhcpServerPacketOptions ServerOptions, ref bool StopPropagation)
        {
            try
            {
                var sb = new StringBuilder();
                sb.AppendLine("HANDLE OPTIONS:");
                sb.AppendLine($" Transaction Id: {Packet.TransactionId}");
                sb.AppendLine($" Server Options:");
                sb.AppendLine($"  Message Type: {ServerOptions.MessageType}");
                sb.AppendLine($"  Subnet Mask: {ServerOptions.SubnetMask}");
                sb.AppendLine($"  Requested Address: {ServerOptions.RequestedAddress}");
                sb.AppendLine($"  Requested Lease Time: {ServerOptions.RequestedLeaseTime}");
                sb.AppendLine($"  Router Address: {ServerOptions.RouterAddress}");
                sb.AppendLine($"  Server: {ServerOptions.Server}");
                sb.AppendLine($"  Parameter Request List: {string.Join(", ", ServerOptions.ParameterRequestList)}");
                sb.AppendLine($"  Machine Name: {ServerOptions.MachineName}");
                sb.AppendLine($"  Client Hardware Address Type: {ServerOptions.ClientHardwareAddressType}");
                sb.AppendLine($"  Client Hardware Address: {ServerOptions.ClientHardwareAddress}");
                sb.AppendLine($"  Class Identifier: {ServerOptions.ClassIdentifier}");

                sb.Append($"  Vendor Class: ");
                foreach (var b in ServerOptions.VendorClass)
                {
                    sb.Append(b.ToString("X2"));
                }

                sb.AppendLine();
                sb.AppendLine($"  Dns Name: {ServerOptions.DnsName}");
                sb.AppendLine($"  Ds Domain Name Requested: {ServerOptions.DsDomainNameRequested}");
                sb.AppendLine($"  Ds Domain Name: {ServerOptions.DsDomainName}");
                sb.AppendLine($"  Scope Id: {ServerOptions.ScopeId}");
                sb.AppendLine("---------------------");

                WriteLog(sb.ToString());
            }
            catch (Exception ex)
            {
                WriteLog($"HANDLE OPTIONS ERROR: {ex.Message} [{ex.GetType().Name}]");
                WriteLog(ex.StackTrace);

                throw;
            }
        }
        public void PacketDrop(IDhcpServerPacket Packet, PacketDropControlCodes ControlCode, DhcpServerIpAddress ServerAddress, ref bool StopPropagation)
        {
            try
            {
                var sb = new StringBuilder();
                sb.AppendLine("PACKET DROP:");
                sb.AppendLine($" Transaction Id: {Packet.TransactionId}");
                sb.AppendLine($" Parameters:");
                sb.AppendLine($"  Control Code: {ControlCode}");
                sb.AppendLine("---------------------");

                WriteLog(sb.ToString());
            }
            catch (Exception ex)
            {
                WriteLog($"PACKET DROP ERROR: {ex.Message} [{ex.GetType().Name}]");
                WriteLog(ex.StackTrace);

                throw;
            }
        }
        public void AddressDelete(IDhcpServerPacket Packet, AddressDeleteControlCodes ControlCode, DhcpServerIpAddress ServerAddress, DhcpServerIpAddress LeaseAddress, ref bool StopPropagation)
        {
            try
            {
                var sb = new StringBuilder();
                sb.AppendLine("ADDRESS DELETE:");
                sb.AppendLine($" Transaction Id: {Packet.TransactionId}");
                sb.AppendLine($" Parameters:");
                sb.AppendLine($"  Control Code: {ControlCode}");
                sb.AppendLine($"  Lease Address: {LeaseAddress}");
                sb.AppendLine("---------------------");

                WriteLog(sb.ToString());
            }
            catch (Exception ex)
            {
                WriteLog($"ADDRESS DELETE ERROR: {ex.Message} [{ex.GetType().Name}]");
                WriteLog(ex.StackTrace);

                throw;
            }
        }
 public void HandleOptions(IDhcpServerPacket Packet, DhcpServerPacketOptions ServerOptions, ref bool StopPropagation)
 {
     handleOptionsHandler.HandleOptions(Packet, ServerOptions, ref StopPropagation);
 }
 public void AddressOffer(IDhcpServerPacket Packet, OfferAddressControlCodes ControlCode, DhcpServerIpAddress ServerAddress, DhcpServerIpAddress LeaseAddress, OfferAddressTypes AddressType, TimeSpan LeaseTime, ref bool StopPropagation)
 {
     addressOfferHandler.AddressOffer(Packet, ControlCode, ServerAddress, LeaseAddress, AddressType, LeaseTime, ref StopPropagation);
 }
 public void AddressDelete(IDhcpServerPacket Packet, AddressDeleteControlCodes ControlCode, DhcpServerIpAddress ServerAddress, DhcpServerIpAddress LeaseAddress, ref bool StopPropagation)
 {
     addressDeleteHandler.AddressDelete(Packet, ControlCode, ServerAddress, LeaseAddress, ref StopPropagation);
 }
 public void PacketDrop(IDhcpServerPacket Packet, PacketDropControlCodes ControlCode, DhcpServerIpAddress ServerAddress, ref bool StopPropagation)
 {
     packetDropHandler.PacketDrop(Packet, ControlCode, ServerAddress, ref StopPropagation);
 }