Package streamer

Examples of streamer.Element


                (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00, // Code:  HYBRID_REQUIRED_BY_SERVER

        };

        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet));
        Element cc = new ServerX224ConnectionConfirmPDU("cc");
        Element tpkt = new ServerTpkt("tpkt");
        Element sink = new MockSink("sink", new ByteBuffer[] {});
        Element mainSink = new MockSink("mainSink", new ByteBuffer[] {});

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, tpkt, cc, sink, mainSink);
        pipeline.link("source", "tpkt", "cc", "mainSink");
        pipeline.link("cc >" + OTOUT, "sink");
View Full Code Here


        (byte) 0x00, (byte) 0x00,
    };
    /* @formatter:on */

        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));
        Element client_info = new ClientInfoPDU("client_info", "vlisivka");
        Element x224 = new ClientX224DataPDU("x224");
        Element tpkt = new ClientTpkt("tpkt");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet));
        Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, client_info, x224, tpkt, sink, mainSink);
        pipeline.link("source", "client_info", "mainSink");
        pipeline.link("client_info >" + OTOUT, "x224", "tpkt", "sink");
View Full Code Here

    };
    /* @formatter:on */

        NtlmState ntlmState = new NtlmState();
        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(serverChallengePacket, new byte[] {1, 2, 3}));
        Element ntlmssp_negotiate = new ClientNtlmsspNegotiate("ntlmssp_negotiate", ntlmState);
        Element ntlmssp_challenge = new ServerNtlmsspChallenge("ntlmssp_challenge", ntlmState);
        Element ntlmssp_auth = new ClientNtlmsspPubKeyAuth("ntlmssp_auth", ntlmState, sslState, "192.168.0.101", "workgroup", "apollo3", "Administrator",
                "R2Preview!");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(clientNegotiatePacket, clientAuthPacket), (Dumper)ntlmssp_auth);
        Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, ntlmssp_negotiate, ntlmssp_challenge, ntlmssp_auth, sink, mainSink);
        pipeline.link("source", "ntlmssp_negotiate", "ntlmssp_challenge", "ntlmssp_auth", "mainSink");
        pipeline.link("ntlmssp_negotiate >" + OTOUT, "ntlmssp_negotiate< sink");
View Full Code Here

        RdpState rdpState = new RdpState() {
            {
                serverShareId = 66538;
            }
        };
        Element channel1003 = new ServerIOChannelRouter("channel_1003", rdpState);
        Element mcs = new ServerMCSPDU("mcs");
        Element tpkt = new ServerTpkt("tpkt");
        Element x224 = new ServerX224DataPdu("x224");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {
                // Deactivate all PDU
                (byte)0x0D, (byte)0x00, // Length: 13 bytes (LE)

                // - PDUType: 22 (0x16, LE)
                // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU
View Full Code Here

    };
    /* @formatter:on */

        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));
        Element todo = new ClientMCSAttachUserRequest("TODO");
        Element x224 = new ClientX224DataPDU("x224");
        Element tpkt = new ClientTpkt("tpkt");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet));
        Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, todo, x224, tpkt, sink, mainSink);
        pipeline.link("source", "TODO", "mainSink");
        pipeline.link("TODO >" + OTOUT, "x224", "tpkt", "sink");
View Full Code Here

     */
    public static void main(String args[]) {
        ByteBuffer packet = new ByteBuffer(new byte[] {0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x00,
                0x01, 0x04, 0x0a, 0x00, 0x0c, (byte)0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00});

        Element bitmap = new ServerBitmapUpdate("bitmap") {
            {
                verbose = true;
            }
        };
        FakeSink fakeSink = new FakeSink("sink") {
            {
                verbose = true;
            }
        };
        Pipeline pipeline = new PipelineImpl("test");

        // BufferedImageCanvas canvas = new BufferedImageCanvas(1024, 768);
        // Element adapter = new AwtRdpAdapter("test",canvas );
        // pipeline.addAndLink(bitmap, adapter);
        pipeline.addAndLink(bitmap, fakeSink);

        bitmap.handleData(packet, null);

    }
View Full Code Here

                0x01, 0x00, 0x00, 0x00 // RDP_NEG_REQ: Requested protocols
                                       // (PROTOCOL_SSL in little endian format)
        };

        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));
        Element cr = new ClientX224ConnectionRequestPDU("cr", cookie, RdpConstants.RDP_NEG_REQ_PROTOCOL_SSL);
        Element tpkt = new ClientTpkt("tpkt");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet));
        Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, cr, tpkt, sink, mainSink);
        pipeline.link("source", "cr", "mainSink");
        pipeline.link("cr >" + OTOUT, "tpkt", "sink");
View Full Code Here

        // System.setProperty("streamer.Link.debug", "true");
        System.setProperty("streamer.Element.debug", "true");
        // System.setProperty("streamer.Pipeline.debug", "true");

        Element source = new MockSource("source") {
            {
                // Split messages at random boundaries to check "pushback" logic
                bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {
                        // Message type: server bell
                        RfbConstants.SERVER_BELL,

                        // Message type: clipboard text
                        RfbConstants.SERVER_CUT_TEXT,
                        // Padding
                        0, 0, 0,
                        // Length (test)
                        0, 0, 0, 4,

                }, new byte[] {
                        // Clipboard text
                        't', 'e', 's', 't',

                        // Message type: frame buffer update
                        RfbConstants.SERVER_FRAMEBUFFER_UPDATE,
                        // Padding
                        0,
                        // Number of rectangles
                        0, 3,},

                        new byte[] {

                                // x, y, width, height: 0x0@4x4
                                0, 0, 0, 0, 0, 4, 0, 4,
                                // Encoding: desktop size
                                (byte)((RfbConstants.ENCODING_DESKTOP_SIZE >> 24) & 0xff), (byte)((RfbConstants.ENCODING_DESKTOP_SIZE >> 16) & 0xff),
                                (byte)((RfbConstants.ENCODING_DESKTOP_SIZE >> 8) & 0xff), (byte)((RfbConstants.ENCODING_DESKTOP_SIZE >> 0) & 0xff),},

                        new byte[] {

                                // x, y, width, height: 0x0@4x4
                                0, 0, 0, 0, 0, 4, 0, 4,
                                // Encoding: raw rect
                                (byte)((RfbConstants.ENCODING_RAW >> 24) & 0xff), (byte)((RfbConstants.ENCODING_RAW >> 16) & 0xff),
                                (byte)((RfbConstants.ENCODING_RAW >> 8) & 0xff), (byte)((RfbConstants.ENCODING_RAW >> 0) & 0xff),
                                // Raw pixel data 4x4x1 bpp
                                1, 2, 3, 4, 5, 6, 7, 8, 9, 10,}, new byte[] {11, 12, 13, 14, 15, 16,

                                // x, y, width, height: 0x0@2x2
                                0, 0, 0, 0, 0, 2, 0, 2,
                                // Encoding: copy rect
                                (byte)((RfbConstants.ENCODING_COPY_RECT >> 24) & 0xff), (byte)((RfbConstants.ENCODING_COPY_RECT >> 16) & 0xff),
                                (byte)((RfbConstants.ENCODING_COPY_RECT >> 8) & 0xff), (byte)((RfbConstants.ENCODING_COPY_RECT >> 0) & 0xff),
                                // srcX, srcY: 2x2
                                0, 2, 0, 2,});
            }
        };

        ScreenDescription screen = new ScreenDescription() {
            {
                this.bytesPerPixel = 1;
            }
        };

        final Element handler = new VncMessageHandler("handler", screen);

        ByteBuffer[] emptyBuf = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {});
        Element fburSink = new MockSink("fbur", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {}, new byte[] {}));
        Element bellSink = new MockSink("bell", emptyBuf);
        Element clipboardSink = new MockSink("clipboard", emptyBuf);
        Element desktopSizeChangeSink = new MockSink("desktop_size", emptyBuf);
        Element pixelsSink = new MockSink("pixels",
                ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,}));
        Element copyRectSink = new MockSink("copy_rect", emptyBuf);

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.addAndLink(source, handler);
        pipeline.add(fburSink, bellSink, clipboardSink, desktopSizeChangeSink, pixelsSink, copyRectSink);
View Full Code Here

        System.setProperty("streamer.Element.debug", "true");
        // System.setProperty("streamer.Pipeline.debug", "true");

        final String desktopName = "test";

        Element source = new MockSource("source") {
            {
                bufs = ByteBuffer.convertByteArraysToByteBuffers(
                        // Send screen description
                        new byte[] {
                                // Framebuffer width (short)
                                0, (byte)200,
                                // Framebuffer height (short)
                                0, 100,
                                // Bits per pixel
                                32,
                                // Depth,
                                24,
                                // Endianness flag
                                RfbConstants.LITTLE_ENDIAN,
                                // Truecolor flag
                                RfbConstants.TRUE_COLOR,
                                // Red max (short)
                                0, (byte)255,
                                // Green max (short)
                                0, (byte)255,
                                // Blue max (short)
                                0, (byte)255,
                                // Red shift
                                16,
                                // Green shift
                                8,
                                // Blue shift
                                0,
                                // Padding
                                0, 0, 0,
                                // Desktop name length (int)
                                0, 0, 0, 4,
                                // Desktop name ("test", 4 bytes)
                                't', 'e', 's', 't',

                                // Tail
                                1, 2, 3

                        },
                        // Tail packet
                        new byte[] {4, 5, 6});
            }
        };

        ScreenDescription screen = new ScreenDescription();
        final VncInitializer init = new VncInitializer("init", true, screen);
        Element initSink = new MockSink("initSink") {
            {
                // Expect shared flag
                bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {RfbConstants.SHARED_ACCESS});
            }
        };
        Element mainSink = new MockSink("mainSink") {
            {
                // Expect two tail packets
                bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}, new byte[] {4, 5, 6});
            }
        };
        ByteBuffer[] emptyBuf = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {});
        Element encodingsSink = new MockSink("encodings", emptyBuf);
        Element pixelFormatSink = new MockSink("pixel_format", emptyBuf);

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.addAndLink(source, init, mainSink);
        pipeline.add(encodingsSink, pixelFormatSink, initSink);
        pipeline.link("init >otout", "initSink");
View Full Code Here

TOP

Related Classes of streamer.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.