Example #1
0
        protected void ExtractBuffer()
        {
            IPPacket IP = new IPPacket(ref PacketBuffer);

            string SourceAddress      = IP.SourceAddress.ToString();
            string DestinationAddress = IP.DestinationAddress.ToString();

            if (IP.TCP != null)
            {
                string Data = Regex.Replace(Encoding.ASCII.GetString(IP.TCP.PacketData), @"[^a-zA-Z_0-9\.\@\- ]", "");
                callData = Encoding.ASCII.GetString(IP.TCP.PacketData);
                if (IP.TCP.DestinationPort == portNum)
                {
                    if (Data.StartsWith("W1"))
                    {
                        parseCallData();
                    }
                }
            }
            if (IP.UDP != null)
            {
                rCastData = Encoding.ASCII.GetString(IP.UDP.PacketData);
                if (IP.UDP.DestinationPort == portNum)
                {
                    if (rCastData.StartsWith("RipCast|"))
                    {
                        parseRCastData();
                    }
                    else if (rCastData.StartsWith("CheckIn|"))
                    {
                        parseRDSCheckIn();
                    }
                }
            }
        }
Example #2
0
        protected void ExtractBuffer()
        {
            IPPacket IP = new IPPacket(ref PacketBuffer);

            string SourceAddress = IP.SourceAddress.ToString();
            string DestinationAddress = IP.DestinationAddress.ToString();

            if (IP.TCP != null)
            {
                string Data = Regex.Replace(Encoding.ASCII.GetString(IP.TCP.PacketData), @"[^a-zA-Z_0-9\.\@\- ]", "");
                callData = Encoding.ASCII.GetString(IP.TCP.PacketData);
                if (IP.TCP.DestinationPort == portNum)
                {
                    if (Data.StartsWith("W1"))
                    {
                        parseCallData();
                    }
                }
            }
            if (IP.UDP != null)
            {
                rCastData = Encoding.ASCII.GetString(IP.UDP.PacketData);
                if (IP.UDP.DestinationPort == portNum)
                {
                    if (rCastData.StartsWith("RipCast|"))
                    {
                        parseRCastData();
                    }
                    else if (rCastData.StartsWith("CheckIn|"))
                    {
                        parseRDSCheckIn();
                    }
                }
            }
        }