void ProcessPacket(PacketDotNet.Packet packet) { try { var tcpPacket = packet.Extract <PacketDotNet.TcpPacket>(); var udpPacket = packet.Extract <PacketDotNet.UdpPacket>(); if (udpPacket != null) { var ipPacket = (PacketDotNet.IPPacket)udpPacket.ParentPacket; UdpPacketArived?.Invoke(this, new UdpPacketArivedEventArgs { Packet = new UdpPacket { SourcePort = udpPacket.SourcePort, DestinationPort = udpPacket.DestinationPort, SourceIp = ipPacket.SourceAddress.ToString(), DestinationIp = ipPacket.DestinationAddress.ToString(), Data = udpPacket.PayloadData ?? new byte[] { } } }); if (this.BuildUdpSessions) { this._udpStreamBuilder.HandlePacket(udpPacket); } _processingPrecentsPredicator.NotifyAboutProcessedData(packet.Bytes.Length); } else if (tcpPacket != null) { var ipPacket = (PacketDotNet.IPPacket)tcpPacket.ParentPacket; // Raise event Tcp packet arived event. TcpPacketArived?.Invoke(this, new TcpPacketArivedEventArgs { Packet = new TcpPacket { SourcePort = tcpPacket.SourcePort, DestinationPort = tcpPacket.DestinationPort, SourceIp = ipPacket.SourceAddress.ToString(), DestinationIp = ipPacket.DestinationAddress.ToString(), Data = tcpPacket.PayloadData ?? new byte[] { } } }); if (this.BuildTcpSessions) { this._tcpSessionsBuilder.HandlePacket(tcpPacket); } _processingPrecentsPredicator.NotifyAboutProcessedData(packet.Bytes.Length); } } catch (Exception ex) { // TODO: handle or throw this //Console.WriteLine(ex); } }
public PacketAnalyzeParam(ICaptureDevice dev, RawCapture packet) { Device = dev; IsSend = false; CurrentPacket = PacketDotNet.Packet.ParsePacket(packet.LinkLayerType, packet.Data); DataLinkFrame = PayloadFrame = packet.Data; }
private void AirservClient_onPacketArrival(PacketDotNet.Packet packet, DateTime ArrivalTime, int WiFi_Channel) { this.LiveCaptureFile.ProcessPacket(packet, ArrivalTime, WiFi_Channel); captureInfo.AddCapturefile(this.LiveCaptureFile); this.LiveCaptureFile.Clear(); if (sw.ElapsedMilliseconds >= 1000) { this.Invoke(new Invoky(() => RefreshAll())); sw.Restart(); } }
public void CreateAltertMessage_HasTodaysDate() { //arrange PacketDotNet.Packet packet = null; //act Ids.Common.Idmef.IDMEFMessage message = Ids.Common.Utilities.IdmefMessageMapper.CreateAltertMessageFromRawPacket(packet); Ids.Common.Idmef.Alert alert = message.Items[0] as Ids.Common.Idmef.Alert; //assert Assert.IsTrue(message.Items.Length == 1); Assert.IsNotNull(alert); Assert.AreEqual(alert.CreateTime.ntpstamp, DateTime.Now.ToShortDateString()); }
public packet(SharpPcap.RawCapture pPacket) { var timestamp = pPacket.Timeval.Date; this.layer = pPacket.LinkLayerType; this.time = timestamp.Hour.ToString() + ":" + timestamp.Minute.ToString() + ":" + timestamp.Second.ToString() + "," + timestamp.Millisecond.ToString(); this.srcIp = ""; this.destIp = ""; this.protocol = ""; this.info = ""; this.color = "White"; this.pPacket = pPacket; this.rPacket = PacketDotNet.Packet.ParsePacket(pPacket.LinkLayerType, pPacket.Data); this.frame_info = new Dictionary <string, string>(); this.ethernet_info = new Dictionary <string, string>(); this.ip_info = new Dictionary <string, string>(); this.arp_info = new Dictionary <string, string>(); this.icmp_info = new Dictionary <string, string>(); this.igmp_info = new Dictionary <string, string>(); this.tcp_info = new Dictionary <string, string>(); this.udp_info = new Dictionary <string, string>(); this.application_info = new Dictionary <string, string>(); this.application_byte = null; this.mf = false; this.df = true; this.offset = 0; analysis_packet(); // 计算校验和 if (this.tcp_info.Count > 0 && this.tcp_info["Checksum(校验和)"] != this.tcp_info["tcpPacket计算校验和函数计算结果"]) { this.color = "Red"; } }
private void PcapPorcessContext(SharpPcap.RawCapture pPacket) { //把包存起来(不论是否过滤) packet temp = new packet(pPacket); temp.index = packets.Count; PacketDotNet.Packet rPacket = PacketDotNet.Packet.ParsePacket(pPacket.LinkLayerType, pPacket.Data); bytes_persec += rPacket.Bytes.Length; packets.Add(temp); //判断是否过滤,若过滤,则调用过滤函数,否则直接显示 bool flag = true; if (applyfilter) { flag = apply_filter(temp); } if (!flag) { return; } show_pac(temp); }
private void ProccessPcapNgPacket(PacketDotNet.Packet packet) { ProcessPacket(packet); }
/// <summary> /// Sends a raw packet throgh this device /// </summary> /// <param name="p">The packet to send</param> /// <param name="size">The number of bytes to send</param> public virtual void SendPacket(PacketDotNet.Packet p, int size) { SendPacket(p.Bytes, size); }
/// <summary> /// Sends a raw packet throgh this device /// </summary> /// <param name="p">The packet to send</param> public virtual void SendPacket(PacketDotNet.Packet p) { SendPacket(p.Bytes); }
private void ProcessPacket(PacketDotNet.Packet packet) { try { var tcpPacket = packet.Extract <PacketDotNet.TcpPacket>(); var udpPacket = packet.Extract <PacketDotNet.UdpPacket>(); if (udpPacket != null) { var ipPacket = (PacketDotNet.IPPacket)udpPacket.ParentPacket; UdpPacketArived?.Invoke(this, new UdpPacketArivedEventArgs { Packet = new UdpPacket { SourcePort = udpPacket.SourcePort, DestinationPort = udpPacket.DestinationPort, SourceIp = ipPacket.SourceAddress.ToString(), DestinationIp = ipPacket.DestinationAddress.ToString(), Data = udpPacket.PayloadData ?? new byte[] { } } }); if (this.BuildUdpSessions) { this._udpStreamBuilder.HandlePacket(udpPacket); } } else if (tcpPacket != null) { var ipPacket = (PacketDotNet.IPPacket)tcpPacket.ParentPacket; // Raise event Tcp packet arived event. TcpPacketArived?.Invoke(this, new TcpPacketArivedEventArgs { Packet = new TcpPacket { SourcePort = tcpPacket.SourcePort, DestinationPort = tcpPacket.DestinationPort, SourceIp = ipPacket.SourceAddress.ToString(), DestinationIp = ipPacket.DestinationAddress.ToString(), Data = tcpPacket.PayloadData ?? new byte[] { } } }); if (this.BuildTcpSessions) { this._tcpSessionsBuilder.HandlePacket(tcpPacket); _tcpSessionsBuilder.completedSessions.AsParallel().ForAll((session) => { TcpSessionArrived?.Invoke(this, new TcpSessionArivedEventArgs() { TcpSession = session }); _tcpSessionsBuilder.completedSessions.Remove(session); }); } } } catch (Exception ex) { // TODO: handle or throw this //Console.WriteLine(ex); } }
private string GetProtocolName(PacketDotNet.Packet packet_pdn) { return(packet_pdn.ToString()); }
public FrameStructProtocolConfig(PacketDotNet.Packet packet_pdn) { ProtocolName = GetProtocolName(packet_pdn); ProtocolData = packet_pdn; }
public packet(SharpPcap.RawCapture pPacket) { var timestamp = pPacket.Timeval.Date; this.layer = pPacket.LinkLayerType; this.time = timestamp.Hour.ToString() + ":" + timestamp.Minute.ToString() + ":" + timestamp.Second.ToString() + "," + timestamp.Millisecond.ToString(); this.srcIp = ""; this.destIp = ""; this.protocol = ""; this.info = ""; this.color = "White"; this.pPacket = pPacket; this.rPacket = PacketDotNet.Packet.ParsePacket(pPacket.LinkLayerType, pPacket.Data); this.frame_info = new Dictionary<string, string>(); this.ethernet_info = new Dictionary<string, string>(); this.ip_info = new Dictionary<string, string>(); this.arp_info = new Dictionary<string, string>(); this.icmp_info = new Dictionary<string, string>(); this.igmp_info = new Dictionary<string, string>(); this.tcp_info = new Dictionary<string, string>(); this.udp_info = new Dictionary<string, string>(); this.application_info = new Dictionary<string, string>(); this.application_byte = null; analysis_packet(); // 计算校验和 if (this.tcp_info.Count > 0 && this.tcp_info["Checksum(校验和)"] != this.tcp_info["tcpPacket计算校验和函数计算结果"]) { this.color = "Red"; } }
private void AnalysisPacket(PacketDotNet.Packet tempPacket) { if (tempPacket is PacketDotNet.EthernetPacket) { var ethernetPacket = tempPacket as PacketDotNet.EthernetPacket; Info tempRoot = new Info(); tempRoot.Detail = "Ethernet, Src: "; tempRoot.Detail += ethernetPacket.SourceHwAddress.ToString(); tempRoot.Detail += ", Dst: "; tempRoot.Detail += ethernetPacket.DestinationHwAddress.ToString(); tempRoot.Children.Add(new Info { Detail = ethernetPacket.SourceHwAddress.ToString(), Children = { new Info { Detail = ethernetPacket.SourceHwAddress.ToString(), }, } }); tempRoot.Children.Add(new Info { Detail = ethernetPacket.DestinationHwAddress.ToString(), Children = { new Info { Detail = ethernetPacket.DestinationHwAddress.ToString(), }, } }); tempRoot.Children.Add(new Info { Detail = ethernetPacket.Type.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.IpPacket) { Info tempRoot = new Info(); if (tempPacket is PacketDotNet.IPv4Packet) { tempRoot.Detail = "Internet Protocol Version 4, Src: "; } else { tempRoot.Detail = "Internet Protocol Version 6, Src: "; } var ipPacket = tempPacket as PacketDotNet.IpPacket; tempRoot.Detail += ipPacket.SourceAddress.ToString(); tempRoot.Detail += ", Dst: "; tempRoot.Detail += ipPacket.DestinationAddress.ToString(); tempRoot.Children.Add(new Info { Detail = "Version: " + ipPacket.Version.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Header Length: " + ipPacket.HeaderLength.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Total Length: " + ipPacket.TotalLength.ToString(), }); if (ipPacket.Protocol.ToString().CompareTo("TCP") == 0) { string flags = ipPacket.Header[6].ToString(); int flagvalue = 0; for (int index = 0; index < flags.Length; ++index) { flagvalue *= 10; flagvalue += (flags[index] - '0'); } string flagString; int reserverdbit = 1; string rdetail = ""; int dofragmentbit; string dofragmentDetail = ""; int morefragmentbit; string morefragmentDetail = ""; if ((flagvalue & 128) != 0) { reserverdbit = 0; rdetail = "Not set"; } else { reserverdbit = 1; rdetail = "Set"; } if ((flagvalue & 64) == 0) { dofragmentbit = 0; dofragmentDetail = "Not set"; flagString = "Don't frament"; } else { dofragmentbit = 1; dofragmentDetail = "Set"; flagString = "Frament"; } if ((flagvalue & 32) == 0) { morefragmentbit = 0; morefragmentDetail = "Not set"; } else { morefragmentbit = 1; morefragmentDetail = "Set"; } tempRoot.Children.Add(new Info { Detail = "Flags: 0x02 (" + flagString + ")", Children = { new Info { Detail = reserverdbit + "... .... = Reserved bit: " + rdetail, }, new Info { Detail = "." + dofragmentbit + ".. .... = Don't fragment: " + dofragmentDetail, }, new Info { Detail = ".." + morefragmentbit + ". .... = More fragment: " + morefragmentDetail, }, } }); } else if (ipPacket.Protocol.ToString().CompareTo("UDP") == 0) { string flags = ipPacket.Header[6].ToString(); int flagvalue = 0; for (int index = 0; index < flags.Length; ++index) { flagvalue *= 10; flagvalue += (flags[index] - '0'); } int reserverdbit = 1; string rdetail = ""; int dofragmentbit; string dofragmentDetail = ""; int morefragmentbit; string morefragmentDetail = ""; if ((flagvalue & 128) != 0) { reserverdbit = 0; rdetail = "Not set"; } else { reserverdbit = 1; rdetail = "Set"; } if ((flagvalue & 64) == 0) { dofragmentbit = 0; dofragmentDetail = "Not set"; } else { dofragmentbit = 1; dofragmentDetail = "Set"; } if ((flagvalue & 32) == 0) { morefragmentbit = 0; morefragmentDetail = "Not set"; } else { morefragmentbit = 1; morefragmentDetail = "Set"; } tempRoot.Children.Add(new Info { Detail = "Flags: 0x00 ", Children = { new Info { Detail = reserverdbit + "... .... = Reserved bit: " + rdetail, }, new Info { Detail = "." + dofragmentbit + ".. .... = Don't fragment: " + dofragmentDetail, }, new Info { Detail = ".." + morefragmentbit + ". .... = More fragment: " + morefragmentDetail, }, } }); } tempRoot.Children.Add(new Info { Detail = "Time To Live: " + ipPacket.TimeToLive.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Protocol: " + ipPacket.Protocol.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Source: " + ipPacket.SourceAddress.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Destination: " + ipPacket.DestinationAddress.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.ARPPacket) { var arpPacket = tempPacket as PacketDotNet.ARPPacket; Info tempRoot = new Info(); tempRoot.Detail = "Address Resolution Protocol (" + arpPacket.Operation.ToString() + ")"; tempRoot.Children.Add(new Info { Detail = "Hardware type: " + arpPacket.HardwareAddressType.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Protocol type: " + arpPacket.ProtocolAddressType.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Hardware Size: " + arpPacket.HardwareAddressLength.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Protocol size: " + arpPacket.ProtocolAddressLength.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Opcode: " + arpPacket.Operation.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Sender Mac address: " + arpPacket.SenderHardwareAddress.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Sender Ip address: " + arpPacket.SenderProtocolAddress.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Target Mac address: " + arpPacket.TargetHardwareAddress.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Target Ip address: " + arpPacket.TargetProtocolAddress.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.UdpPacket) { var udpPacket = tempPacket as PacketDotNet.UdpPacket; Info tempRoot = new Info(); tempRoot.Detail = "User Datagram Protocol, Src Port: " + udpPacket.SourcePort.ToString() + ", Dst Port: " + udpPacket.DestinationPort.ToString(); tempRoot.Children.Add(new Info { Detail = "Source Port: " + udpPacket.SourcePort.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Destination Port: " + udpPacket.DestinationPort.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Checksum: " + udpPacket.Checksum.ToString(), Children = { new Info { Detail = udpPacket.Checksum.ToString(), }, } }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); if ((udpPacket.DestinationPort.ToString().CompareTo("80") == 0) || (udpPacket.DestinationPort.ToString().CompareTo("8080") == 0) || (udpPacket.DestinationPort.ToString().CompareTo("1900") == 0)) { Info temp = new Info(); temp.Detail = "Hypertext Transfer Protocol"; try { string str = System.Text.ASCIIEncoding.ASCII.GetString(tempPacket.Bytes); temp.Children.Add(new Info { Detail = str, }); } catch { } InfoTreeViewControl ifvc1 = new InfoTreeViewControl(temp); this.TreeViewStack.Children.Add(ifvc1); } } else if (tempPacket is PacketDotNet.TcpPacket) { var tcpPacket = tempPacket as PacketDotNet.TcpPacket; Info tempRoot = new Info(); tempRoot.Detail = "Transmission Control Protocol, Src Port: " + tcpPacket.SourcePort.ToString() + ", Dst Port: " + tcpPacket.DestinationPort.ToString() + ", Seq: " + tcpPacket.SequenceNumber.ToString() + ", Ack: " + tcpPacket.Ack.ToString(); tempRoot.Children.Add(new Info { Detail = "Source Port: " + tcpPacket.SourcePort.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Destination Port: " + tcpPacket.DestinationPort.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Sequence number: " + tcpPacket.SequenceNumber.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Acknowledgement number: " + tcpPacket.AcknowledgmentNumber.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Header length: " + tcpPacket.Header.Length.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Flags: ", Children = { new Info { Detail = tcpPacket.AllFlags.ToString(), }, } }); tempRoot.Children.Add(new Info { Detail = "Window zise value: " + tcpPacket.WindowSize.ToString(), }); tempRoot.Children.Add(new Info { Detail = "Checksum: " + tcpPacket.Checksum.ToString(), Children = { new Info { Detail = tcpPacket.Checksum.ToString(), }, } }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); if ((tcpPacket.DestinationPort.ToString().CompareTo("80") == 0) || (tcpPacket.DestinationPort.ToString().CompareTo("8080") == 0) || (tcpPacket.DestinationPort.ToString().CompareTo("1900") == 0)) { Info temp = new Info(); temp.Detail = "Hypertext Transfer Protocol"; try { string str = System.Text.ASCIIEncoding.ASCII.GetString(tempPacket.Bytes); temp.Children.Add(new Info { Detail = str, }); } catch { } InfoTreeViewControl ifvc1 = new InfoTreeViewControl(temp); this.TreeViewStack.Children.Add(ifvc1); } } else if (tempPacket is PacketDotNet.ApplicationPacket) { var applicationPacket = tempPacket as PacketDotNet.ApplicationPacket; Info tempRoot = new Info(); tempRoot.Detail = "Data"; tempRoot.Children.Add(new Info { Detail = applicationPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.ICMPv4Packet) { var iCMPv4Packet = tempPacket as PacketDotNet.ICMPv4Packet; Info tempRoot = new Info(); tempRoot.Detail = "Internet Control Message Protocol v4"; tempRoot.Children.Add(new Info { Detail = "Checksum: " + iCMPv4Packet.Checksum.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.ICMPv6Packet) { var iCMPv6Packet = tempPacket as PacketDotNet.ICMPv6Packet; Info tempRoot = new Info(); tempRoot.Detail = "Internet Control Message Protocol v6"; tempRoot.Children.Add(new Info { Detail = "Checksum: " + iCMPv6Packet.Checksum.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.Ieee80211RadioPacket) { var ieee80211RadioPacket = tempPacket as PacketDotNet.Ieee80211RadioPacket; Info tempRoot = new Info(); tempRoot.Detail = "Ieee80211RadioPacket"; tempRoot.Children.Add(new Info { //Detail = ieee80211RadioPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.DataLinkPacket) { var dataLinkPacket = tempPacket as PacketDotNet.DataLinkPacket; Info tempRoot = new Info(); tempRoot.Detail = "DataLinkPacket"; tempRoot.Children.Add(new Info { // Detail = dataLinkPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.Ieee80211MacFrame) { var ieee80211MacFrame = tempPacket as PacketDotNet.Ieee80211MacFrame; Info tempRoot = new Info(); tempRoot.Detail = "Ieee80211MacFrame"; tempRoot.Children.Add(new Info { // Detail = ieee80211MacFrame.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.IGMPv2Packet) { var iGMPv2Packet = tempPacket as PacketDotNet.IGMPv2Packet; Info tempRoot = new Info(); tempRoot.Detail = "IGMPv2Packet"; tempRoot.Children.Add(new Info { //Detail = iGMPv2Packet.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.InternetPacket) { var internetPacket = tempPacket as PacketDotNet.InternetPacket; Info tempRoot = new Info(); tempRoot.Detail = "InternetPacket"; tempRoot.Children.Add(new Info { //Detail = internetPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.LLDPPacket) { var lLDPPacket = tempPacket as PacketDotNet.LLDPPacket; Info tempRoot = new Info(); tempRoot.Detail = "LLDPPacket"; tempRoot.Children.Add(new Info { //Detail = lLDPPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.PPPPacket) { var pPPPacket = tempPacket as PacketDotNet.PPPPacket; Info tempRoot = new Info(); tempRoot.Detail = "PPPPacket"; tempRoot.Children.Add(new Info { // Detail = pPPPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.SessionPacket) { var sessionPacket = tempPacket as PacketDotNet.SessionPacket; Info tempRoot = new Info(); tempRoot.Detail = "SessionPacket"; tempRoot.Children.Add(new Info { //Detail = sessionPacket.ToString(), }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.TransportPacket) { var transportPacket = tempPacket as PacketDotNet.TransportPacket; Info tempRoot = new Info(); tempRoot.Detail = "TransportPacket"; tempRoot.Children.Add(new Info { Detail = "TransportPacket", }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else if (tempPacket is PacketDotNet.WakeOnLanPacket) { var wakeOnLanPacket = tempPacket as PacketDotNet.WakeOnLanPacket; Info tempRoot = new Info(); tempRoot.Detail = "WakeOnLanPacket"; tempRoot.Children.Add(new Info { //Detail = "TransportPacket", }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } else { Info tempRoot = new Info(); tempRoot.Detail = "UnknowPacketType"; tempRoot.Children.Add(new Info { //Detail = "TransportPacket", }); InfoTreeViewControl ifvc = new InfoTreeViewControl(tempRoot); this.TreeViewStack.Children.Add(ifvc); } }
public Entry(SharpPcap.PosixTimeval timeval, PacketDotNet.Packet packet) { this.Timeval = timeval; this.Packet = packet; }
public sPacket(ref PacketDotNet.Packet p) { timestamp = DateTime.Now; PacketDotNet.Packet c; for (c = p; c.PayloadPacket != null; c = c.PayloadPacket) ; finalType = c.GetType(); packet = p; }