Beispiel #1
0
 //USEDの設定
 public void SetUsed(uint id, Mac mac, DateTime dt)
 {
     DbStatus = DhcpDbStatus.Used;
     Id       = id;
     Mac      = mac;
     Dt       = dt;
 }
Beispiel #2
0
 //RESERVEの設定
 public void SetReserve(uint id, Mac mac)
 {
     DbStatus = DhcpDbStatus.Reserve;
     Id       = id;
     Dt       = DateTime.Now.AddSeconds(5);//5秒間有効
     Mac      = mac;
 }
Beispiel #3
0
 void Init()
 {
     DbStatus = DhcpDbStatus.Unused;
     Id       = 0;
     Dt       = new DateTime(0);
     if (!MacAppointment)//MAC指定無しの場合、MACも初期化する
     {
         Mac = new Mac("ff-ff-ff-ff-ff-ff");
     }
 }
Beispiel #4
0
        //ToString()を戻すためのコンストラクタ
        public OneLease(string str)
        {
            string[] tmp = str.Split('\t');
            if (tmp.Length != 5)
            {
                Init();
                return;
            }
            Ip       = new Ip(tmp[0]);
            DbStatus = (DhcpDbStatus)(Convert.ToInt32(tmp[1]));
            long ticks = (Convert.ToInt64(tmp[2]));

            Dt             = new DateTime(ticks);
            Mac            = new Mac(tmp[3]);
            MacAppointment = Convert.ToBoolean(tmp[4]);
        }