Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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++;
        }