public BindingLease(string clientId, PhysicalAddress owner, InternetAddress address, byte[] hostName, DateTime expiration, UInt32 sessionId, LeaseState state)
 {
     this._clientId = clientId;
     this._owner = owner;
     this._address = address;
     this._hostName = hostName;
     this._expiration = expiration;
     this._sessionId = sessionId;
     this._state = state;
 }
 public void Remove(PhysicalAddress macAddress)
 {
     this._hashTable.Remove(macAddress);
 }
 public bool Contains(PhysicalAddress macAddress)
 {
     return this._hashTable.Contains(macAddress);
 }
 public void Add(InternetAddress ipAddress, PhysicalAddress macAddress)
 {
     this._hashTable[ipAddress] = macAddress;
 }
 public InternetAddress this[PhysicalAddress macAddress]
 {
     get { return (InternetAddress)this._hashTable[macAddress]; }
     set { this._hashTable[macAddress] = value; }
 }
        public void Reservation(InternetAddress address, PhysicalAddress macAddress)
        {
            lock (_bindingSync)
            {
                if (_reservationTable.Contains(address))
                {
                    _reservationTable[address] = new BindingLease(RANDOM.Next(int.MaxValue).ToString(), macAddress, address, new byte[0], DateTime.MaxValue, 0, LeaseState.Static);
                }
                else
                {
                    _reservationTable.Add(address, new BindingLease(RANDOM.Next(int.MaxValue).ToString(), macAddress, address, new byte[0], DateTime.MaxValue, 0, LeaseState.Static));

                }
            }
        }
 public BindingLease(PhysicalAddress owner, InternetAddress address)
     : this(RANDOM.Next(int.MaxValue).ToString(), owner, address, new byte[0], DateTime.Now.AddDays(7), 0, LeaseState.Unassigned)
 {
 }
        public static PhysicalAddress Parse(String address)
        {
            PhysicalAddress physical = new PhysicalAddress(0, 0, 0, 0, 0, 0);

            Int32 index = 0;
            Byte currentValue = 0;
            Boolean first = true;

            foreach (Char c in address)
            {
                Byte digitValue;

                switch (c)
                {
                    case '0':
                        digitValue = 0;
                        break;
                    case '1':
                        digitValue = 1;
                        break;
                    case '2':
                        digitValue = 2;
                        break;
                    case '3':
                        digitValue = 3;
                        break;
                    case '4':
                        digitValue = 4;
                        break;
                    case '5':
                        digitValue = 5;
                        break;
                    case '6':
                        digitValue = 6;
                        break;
                    case '7':
                        digitValue = 7;
                        break;
                    case '8':
                        digitValue = 8;
                        break;
                    case '9':
                        digitValue = 9;
                        break;
                    case 'A':
                    case 'a':
                        digitValue = 10;
                        break;
                    case 'B':
                    case 'b':
                        digitValue = 11;
                        break;
                    case 'C':
                    case 'c':
                        digitValue = 12;
                        break;
                    case 'D':
                    case 'd':
                        digitValue = 13;
                        break;
                    case 'E':
                    case 'e':
                        digitValue = 14;
                        break;
                    case 'F':
                    case 'f':
                        digitValue = 15;
                        break;
                    default:
                        continue;
                }

                if (first)
                {
                    currentValue = (Byte)(digitValue << 4);
                    first = false;
                }
                else
                {
                    currentValue |= digitValue;
                    physical._address[index++] = currentValue;
                    first = true;
                }
            }

            return physical;
        }
 public bool Equals(PhysicalAddress other)
 {
     return other != null &&
         this._address[0] == other._address[0] &&
         this._address[1] == other._address[1] &&
         this._address[2] == other._address[2] &&
         this._address[3] == other._address[3] &&
         this._address[4] == other._address[4] &&
         this._address[5] == other._address[5];
 }
        public static PhysicalAddress Parse(String address)
        {
            PhysicalAddress physical = new PhysicalAddress(0, 0, 0, 0, 0, 0);

            Int32   index        = 0;
            Byte    currentValue = 0;
            Boolean first        = true;

            foreach (Char c in address)
            {
                Byte digitValue;

                switch (c)
                {
                case '0':
                    digitValue = 0;
                    break;

                case '1':
                    digitValue = 1;
                    break;

                case '2':
                    digitValue = 2;
                    break;

                case '3':
                    digitValue = 3;
                    break;

                case '4':
                    digitValue = 4;
                    break;

                case '5':
                    digitValue = 5;
                    break;

                case '6':
                    digitValue = 6;
                    break;

                case '7':
                    digitValue = 7;
                    break;

                case '8':
                    digitValue = 8;
                    break;

                case '9':
                    digitValue = 9;
                    break;

                case 'A':
                case 'a':
                    digitValue = 10;
                    break;

                case 'B':
                case 'b':
                    digitValue = 11;
                    break;

                case 'C':
                case 'c':
                    digitValue = 12;
                    break;

                case 'D':
                case 'd':
                    digitValue = 13;
                    break;

                case 'E':
                case 'e':
                    digitValue = 14;
                    break;

                case 'F':
                case 'f':
                    digitValue = 15;
                    break;

                default:
                    continue;
                }

                if (first)
                {
                    currentValue = (Byte)(digitValue << 4);
                    first        = false;
                }
                else
                {
                    currentValue |= digitValue;
                    physical._address[index++] = currentValue;
                    first = true;
                }
            }

            return(physical);
        }