private IPPacketIdentifier(ushort key, IPHeader ipHeader, SystemModule module)
 {
     Key = key;
     _ttl = ipHeader.TTL;
     Daddr = ipHeader.DestinationAddress;
     _module = module;
 }
 public static IPPacketIdentifier Create(ushort key, IPHeader ipHeader, SystemModule module)
 {
     var id = new IPPacketIdentifier(key, ipHeader, module);
     id._timer = new Timer
                 {
                     Interval = 1000
                 };
     id._timer.Elapsed += (s, e) =>
                          {
                              id._ttl--;
                              if (id._ttl == 0)
                              {
                                  Log.Write("IPPacketIdentifier", "Timeout", string.Format("addr={0}, id={1}", id.Daddr.StandardFormat, id.Key));
                                  id._timer.Stop();
                                  module.KillIPPacketIdentifier(id);
                              }
                          };
     return id;
 }
Example #3
0
 public static ArpData Create(string deviceID, IPAddress ipAddress, MacAddress macAddress, SystemModule module)
 {
     var arp = new ArpData(deviceID, ipAddress, macAddress, module);
     arp._timer = new Timer
                 {
                     Interval = 1000
                 };
     arp._timer.Elapsed += (s, e) =>
     {
         arp._ttl--;
         if (arp._ttl == 0)
         {
             Log.Write("ArpData", "Timeout", string.Format("ip={0}, mac={1}", arp.IP.StandardFormat, arp.Mac.StandardFormat));
             arp._timer.Stop();
             module.KillArpData(arp);
         }
     };
     return arp;
 }
Example #4
0
 public static ArpData Create(string deviceID, ArpHeader arpHeader, SystemModule module)
 {
     return Create(deviceID, arpHeader.SourceIPAddress, arpHeader.SourceMacAddress, module);
 }
Example #5
-1
 private ArpData(string deviceID, IPAddress ipAddress, MacAddress macAddress, SystemModule module)
 {
     _deviceID = deviceID;
     _ttl = 3000;
     IP = ipAddress;
     Mac = macAddress;
     _module = module;
 }