Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void processMessageDatagram(pspsharp.network.protocols.NetPacket packet, pspsharp.network.protocols.EtherFrame frame) throws java.io.EOFException
        private void processMessageDatagram(NetPacket packet, EtherFrame frame)
        {
            IPv4 ipv4 = new IPv4();

            ipv4.read(packet);

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("processMessageDatagram IPv4 {0}", ipv4));
            }

            switch (ipv4.protocol)
            {
            case IPv4_PROTOCOL_ICMP:
                processMessageDatagramICMP(packet, frame, ipv4);
                break;

            case IPv4_PROTOCOL_TCP:
                processMessageTCP(packet, frame, ipv4);
                break;

            case IPv4_PROTOCOL_UDP:
                processMessageUDP(packet, frame, ipv4);
                break;

            default:
                Console.WriteLine(string.Format("processMessageDatagram unknown protocol {0:D}", ipv4.protocol));
                break;
            }
        }