/// <summary> /// 添加应用层协议 /// </summary> /// <param name="payloadData">载荷数据</param> /// <param name="SourcePort">源端口</param> /// <param name="DestinationPort">目的端口</param> private void AppNode(byte[] payloadData, ushort SourcePort, ushort DestinationPort) { if (payloadData.Length == 0) { return; } AppsrcPort = SourcePort; AppdstPort = DestinationPort; //HTTP 80 if (isAnalysProtocol(80)) { HttpPacket http = new HttpPacket(payloadData); Http(http); } //smtp 25 else if (isAnalysProtocol(25)) { SmtpPacket smtp = new SmtpPacket(payloadData); SMTP(smtp); } //pop3 110 else if (isAnalysProtocol(110)) { Pop3Packet pop3 = new Pop3Packet(payloadData); POP3(pop3); } //DNS 53 else if (isAnalysProtocol(53)) { DnsPacket dns = new DnsPacket(payloadData); DNS(dns); } //ftp 21 else if (isAnalysProtocol(21)) { FtpPacket ftp = new FtpPacket(payloadData); FTP(ftp); } //DHCP 67 68 else if (isAnalysProtocol(67) || isAnalysProtocol(68)) { DhcpPackets dp = new DhcpPackets(payloadData); DHCP(dp); } else if (isAnalysProtocol(520)) { RipPacket rp = new RipPacket(payloadData); RIP(rp); } //ssdp 1900 else if (isAnalysProtocol(1900)) { SSDPPacket ssdp = new SSDPPacket(payloadData); SSDP(ssdp); } }
private void SSDP(SSDPPacket ssdpPacket) { if (ssdpPacket == null) { return; } if (SSDPNode == null) { SSDPNode = CreatNode("SSDP", 7); } SSDPNode.Nodes.Clear(); List <CommandTypeHead> ssdpList = ssdpPacket.CreatHeadList(); if (ssdpList.Count == 0) { return; } //显示数据; setAppTreeNode(ssdpList, SSDPNode); //加入选定模式 }