private void IPHandler(IPData IP, ref byte[] PacketData)
 {
     IP.IP_Version        = (byte)(PacketData[0] >> 4);
     IP.IP_IHL            = (byte)((PacketData[0] & 0x0F) * 4);
     IP.IP_TOS            = PacketData[1];
     IP.IP_TotalLength    = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 2));
     IP.IP_Identification = (ushort)IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 4));
     IP.IP_Flags          = (byte)((PacketData[6] & 0xE0) >> 5);
     IP.IP_FragmentOffset = (ushort)(IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 6)) & 0x1FFF);
     IP.IP_TimeToLive     = PacketData[8];
     IP.IP_Protocol       = PacketData[9];
     IP.IP_HeaderChecksum = (ushort)(IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 10)));
     IP.SourceIP          = new IPAddress(BitConverter.ToInt32(PacketData, 12) & 0x00000000FFFFFFFF);
     IP.DestinationIP     = new IPAddress(BitConverter.ToInt32(PacketData, 16) & 0x00000000FFFFFFFF);
 }
 public void fire(IPData PD)
 {
     PacketRecievedEventArgs PRE = new PacketRecievedEventArgs(PD);
     PREvent(this, PRE);
 }
 public PacketRecievedEventArgs(IPData PD) 
 {
     p_PD = PD; 
 }
Beispiel #4
0
        public void fire(IPData PD)
        {
            PacketRecievedEventArgs PRE = new PacketRecievedEventArgs(PD);

            PREvent(this, PRE);
        }
Beispiel #5
0
 public PacketRecievedEventArgs(IPData PD)
 {
     p_PD = PD;
 }
 private void IPHandler(IPData IP, ref byte[] PacketData)
 {
     IP.IP_Version = (byte) (PacketData[0] >> 4);
     IP.IP_IHL = (byte) ((PacketData[0] & 0x0F)*4);
     IP.IP_TOS = PacketData[1];
     IP.IP_TotalLength = (ushort) IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 2));
     IP.IP_Identification = (ushort) IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 4));
     IP.IP_Flags = (byte) ((PacketData[6] & 0xE0) >> 5);
     IP.IP_FragmentOffset = (ushort)(IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 6)) & 0x1FFF);
     IP.IP_TimeToLive = PacketData[8];
     IP.IP_Protocol = PacketData[9];
     IP.IP_HeaderChecksum = (ushort)(IPAddress.NetworkToHostOrder(BitConverter.ToInt16(PacketData, 10)));
     IP.SourceIP = new IPAddress(BitConverter.ToInt32(PacketData, 12) & 0x00000000FFFFFFFF);
     IP.DestinationIP = new IPAddress(BitConverter.ToInt32(PacketData, 16) & 0x00000000FFFFFFFF);
 }