public TreeNode MakeICMPTreeNode(ICMPHeader icmpHeader) { TreeNode icmpNode = new TreeNode(); icmpNode.Text = "ICMP"; icmpNode.Nodes.Add("type: " + icmpHeader.type); icmpNode.Nodes.Add("code " + icmpHeader.code); icmpNode.Nodes.Add("Checksum: " + icmpHeader.checksum); return(icmpNode); }
public void ParseDataIcmp(byte[] byteData, int nReceived) { TreeNode rootNode = new TreeNode(); ICMPHeader icmpHeader = new ICMPHeader(byteData, nReceived); TreeNode icmpNode = MakeICMPTreeNode(icmpHeader); rootNode.Nodes.Add(icmpNode); AddTreeNode addTreeNode = new AddTreeNode(OnAddTreeNode); rootNode.Text = nReceived.ToString(); treeView.Invoke(addTreeNode, new object[] { rootNode }); HeaderCounter.icmp++; }