use of streamer.Pipeline in project cloudstack by apache.
the class Vnc33Hello method main.
/**
* Example.
*/
public static void main(String[] args) {
// System.setProperty("streamer.Link.debug", "true");
System.setProperty("streamer.Element.debug", "true");
// System.setProperty("streamer.Pipeline.debug", "true");
InputStream is = new ByteArrayInputStream("RFB 003.007\ntest".getBytes(RfbConstants.US_ASCII_CHARSET));
ByteArrayOutputStream initOS = new ByteArrayOutputStream();
ByteArrayOutputStream mainOS = new ByteArrayOutputStream();
InputStreamSource inputStreamSource = new InputStreamSource("source", is);
OutputStreamSink outputStreamSink = new OutputStreamSink("mainSink", mainOS);
Vnc33Hello hello = new Vnc33Hello("hello");
Pipeline pipeline = new PipelineImpl("test");
pipeline.addAndLink(inputStreamSource, hello, outputStreamSink);
pipeline.add(new OutputStreamSink("initSink", initOS));
pipeline.link("hello >" + OneTimeSwitch.OTOUT, "initSink");
pipeline.runMainLoop("source", STDOUT, false, false);
String initOut = new String(initOS.toByteArray(), RfbConstants.US_ASCII_CHARSET);
String mainOut = new String(mainOS.toByteArray(), RfbConstants.US_ASCII_CHARSET);
if (!"RFB 003.003\n".equals(initOut))
System.err.println("Unexpected value for hello response: \"" + initOut + "\".");
if (!"test".equals(mainOut))
System.err.println("Unexpected value for main data: \"" + mainOut + "\".");
}
use of streamer.Pipeline in project cloudstack by apache.
the class AwtBellAdapter method main.
/**
* Example.
*/
public static void main(String[] args) {
System.setProperty("streamer.Element.debug", "true");
Element source = new FakeSource("source") {
{
incommingBufLength = 0;
delay = 1000;
numBuffers = 3;
}
};
Element sink = new AwtBellAdapter("sink");
Pipeline pipeline = new PipelineImpl("test");
pipeline.addAndLink(source, sink);
pipeline.runMainLoop("source", STDOUT, false, false);
}
use of streamer.Pipeline in project cloudstack by apache.
the class ConsoleProxyRdpClient method initClient.
@Override
public void initClient(final ConsoleProxyClientParam param) {
if ((System.currentTimeMillis() - _threadStopTime) < 1000) {
return;
}
try {
int canvasWidth = 1024;
int canvasHeight = 768;
setClientParam(param);
final String host = param.getHypervHost();
final String password = param.getPassword();
final String instanceId = param.getClientHostAddress();
final int port = param.getClientHostPort();
final SSLState sslState = new SSLState();
final String username = param.getUsername();
String name = null;
String domain = null;
if (username.contains("\\")) {
String[] tokens = username.split("\\\\");
name = tokens[1];
domain = tokens[0];
} else {
name = username;
domain = "Workgroup";
}
_screen = new ScreenDescription();
_canvas = new RdpBufferedImageCanvas(this, canvasWidth, canvasHeight);
onFramebufferSizeChange(canvasWidth, canvasHeight);
_screen.addSizeChangeListener(new SizeChangeListener() {
@Override
public void sizeChanged(int width, int height) {
if (_canvas != null) {
_canvas.setCanvasSize(width, height);
}
}
});
s_logger.info("connecting to instance " + instanceId + " on host " + host);
_client = new RdpClient("client", host, domain, name, password, instanceId, _screen, _canvas, sslState);
_mouseEventSource = _client.getMouseEventSource();
_keyEventSource = _client.getKeyEventSource();
_worker = new Thread(new Runnable() {
@Override
public void run() {
_socket = new AprSocketWrapperImpl("socket", sslState);
Pipeline pipeline = new PipelineImpl("Client");
pipeline.add(_socket, _client);
pipeline.link("socket", _client.getId(), "socket");
pipeline.validate();
InetSocketAddress address = new InetSocketAddress(host, port);
ConsoleProxy.ensureRoute(host);
try {
_workerDone = false;
s_logger.info("Connecting socket to remote server and run main loop(s)");
_socket.connect(address);
} catch (Exception e) {
s_logger.info(" error occurred in connecting to socket " + e.getMessage());
} finally {
shutdown();
}
_threadStopTime = System.currentTimeMillis();
s_logger.info("Receiver thread stopped.");
_workerDone = true;
}
});
_worker.setDaemon(true);
_worker.start();
} catch (Exception e) {
_workerDone = true;
s_logger.info("error occurred in initializing rdp client " + e.getMessage());
}
}
use of streamer.Pipeline in project cloudstack by apache.
the class ClientConfirmActivePDU method main.
/**
* Example.
*/
public static void main(String[] args) {
// System.setProperty("streamer.Link.debug", "true");
System.setProperty("streamer.Element.debug", "true");
// System.setProperty("streamer.Pipeline.debug", "true");
/* @formatter:off */
byte[] packet = new byte[] { // MCS Send Data Request
(byte) 0x64, // Initiator: 1004 (1001+3)
(byte) 0x00, (byte) 0x03, // Channel ID: 1003 (I/O channel)
(byte) 0x03, (byte) 0xeb, // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10)
(byte) 0x70, // User data length: 432 bytes (0x1b0, variable length field)
(byte) 0x81, (byte) 0xb0, // Total length: 432 bytes (0x1b0, LE)
(byte) 0xb0, (byte) 0x01, // PDU type: Confirm Active PDU (0x3), TS_PROTOCOL_VERSION (0x10) (LE)
(byte) 0x13, (byte) 0x00, // PDU source: 1004 (LE)
(byte) 0xec, (byte) 0x03, // Share ID: 0x000103ea (LE)
(byte) 0xea, (byte) 0x03, (byte) 0x01, (byte) 0x00, // Originator ID: 1002 (LE)
(byte) 0xea, (byte) 0x03, // Length of source descriptor: 6 bytes (including NULL character) (LE)
(byte) 0x06, (byte) 0x00, // Length of combined capabilities: 410 bytes (LE)
(byte) 0x9a, (byte) 0x01, // Source descriptor: "MSTSC" ???
(byte) 0x4d, (byte) 0x53, (byte) 0x54, (byte) 0x53, (byte) 0x43, (byte) 0x00, // Number of capabilities: 15 (LE)
(byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00, // capability set type: CAPSTYPE_GENERAL (1) (LE)
(byte) 0x01, // capability set type: CAPSTYPE_GENERAL (1) (LE)
(byte) 0x00, // length of capability set: 24 bytes (LE)
(byte) 0x18, // length of capability set: 24 bytes (LE)
(byte) 0x00, // TS_OSMAJORTYPE_WINDOWS (1) (LE)
(byte) 0x01, // TS_OSMAJORTYPE_WINDOWS (1) (LE)
(byte) 0x00, // TS_OSMINORTYPE_WINDOWS_NT (3) (LE)
(byte) 0x03, // TS_OSMINORTYPE_WINDOWS_NT (3) (LE)
(byte) 0x00, // TS_CAPS_PROTOCOLVERSION (0x0200) (LE)
(byte) 0x00, // TS_CAPS_PROTOCOLVERSION (0x0200) (LE)
(byte) 0x02, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // generalCompressionTypes: 0 (LE)
(byte) 0x00, // generalCompressionTypes: 0 (LE)
(byte) 0x00, // Reserved2: (00000...........)
(byte) 0x0d, (byte) 0x04, // updateCapabilityFlag: 0 (LE)
(byte) 0x00, // updateCapabilityFlag: 0 (LE)
(byte) 0x00, // remoteUnshareFlag: 0 (LE)
(byte) 0x00, // remoteUnshareFlag: 0 (LE)
(byte) 0x00, // generalCompressionLevel: 0 (LE)
(byte) 0x00, // generalCompressionLevel: 0 (LE)
(byte) 0x00, // refreshRectSupport: FALSE (0)
(byte) 0x00, // suppressOutputSupport: FALSE (0)
(byte) 0x00, // capability set type: CAPSTYPE_BITMAP (2) (LE)
(byte) 0x02, // capability set type: CAPSTYPE_BITMAP (2) (LE)
(byte) 0x00, // length of capability set: 28 bytes (LE)
(byte) 0x1c, // length of capability set: 28 bytes (LE)
(byte) 0x00, // preferredBitsPerPixel: 16 bpp (LE)
(byte) 0x10, // preferredBitsPerPixel: 16 bpp (LE)
(byte) 0x00, // receive1BitPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x01, // receive1BitPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x00, // receive4BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x01, // receive4BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x00, // receive8BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x01, // receive8BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x00, // desktopWidth = 1024 pixels (LE)
(byte) 0x00, // desktopWidth = 1024 pixels (LE)
(byte) 0x04, // desktopHeight = 768 pixels (LE)
(byte) 0x00, // desktopHeight = 768 pixels (LE)
(byte) 0x03, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // desktopResizeFlag: FALSE (0x0) (LE)
(byte) 0x00, // desktopResizeFlag: FALSE (0x0) (LE)
(byte) 0x00, // bitmapCompressionFlag (must be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x01, // bitmapCompressionFlag (must be set to TRUE (0x1)): TRUE (0x1) (LE)
(byte) 0x00, // highColorFlags (field is ignored and SHOULD be set to zero): 0
(byte) 0x00, // drawingFlags: 0x1 TODO: padding, why 0x1 ???
(byte) 0x01, // multipleRectangleSupport: TRUE (LE)
(byte) 0x01, // multipleRectangleSupport: TRUE (LE)
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // capability set type: CAPSTYPE_ORDER (3) (LE)
(byte) 0x03, // capability set type: CAPSTYPE_ORDER (3) (LE)
(byte) 0x00, // length of capability set: 88 bytes (LE)
(byte) 0x58, // length of capability set: 88 bytes (LE)
(byte) 0x00, // terminalDescriptor = "" (16 bytes, UCS2)
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // pad4octetsA
(byte) 0x00, // pad4octetsA
(byte) 0x00, // pad4octetsA
(byte) 0x00, // pad4octetsA
(byte) 0x00, // desktopSaveXGranularity (ignored): 1 (LE)
(byte) 0x01, // desktopSaveXGranularity (ignored): 1 (LE)
(byte) 0x00, // desktopSaveYGranularity (ignored): 20 (LE)
(byte) 0x14, // desktopSaveYGranularity (ignored): 20 (LE)
(byte) 0x00, // pad2octetsA (ignored)
(byte) 0x00, // pad2octetsA (ignored)
(byte) 0x00, // maximumOrderLevel: ORD_LEVEL_1_ORDERS (1)
(byte) 0x01, // maximumOrderLevel: ORD_LEVEL_1_ORDERS (1)
(byte) 0x00, // number of fonts (ignored): 0
(byte) 0x00, // number of fonts (ignored): 0
(byte) 0x00, // orderFlags = 0x004a (LE), SOLIDPATTERNBRUSHONLY (0x40), ZEROBOUNDSDELTASSUPPORT (0x8, MUST), NEGOTIATEORDERSUPPORT (0x2, MUST)
(byte) 0x4a, // orderFlags = 0x004a (LE), SOLIDPATTERNBRUSHONLY (0x40), ZEROBOUNDSDELTASSUPPORT (0x8, MUST), NEGOTIATEORDERSUPPORT (0x2, MUST)
(byte) 0x00, // TS_NEG_DSTBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_PATBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_SCRBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_MEMBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_MEM3BLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_ATEXTOUT_INDEX: FALSE
(byte) 0x00, // TS_NEG_AEXTTEXTOUT_INDEX: FALSE
(byte) 0x00, // TS_NEG_DRAWNINEGRID_INDEX: FALSE
(byte) 0x00, // TS_NEG_LINETO_INDEX: FALSE
(byte) 0x00, // TS_NEG_MULTI_DRAWNINEGRID_INDEX: FALSE
(byte) 0x00, // TS_NEG_OPAQUERECT_INDEX: FALSE
(byte) 0x00, // TS_NEG_SAVEBITMAP_INDEX: FALSE
(byte) 0x00, // TS_NEG_WTEXTOUT_INDEX: FALSE
(byte) 0x00, // TS_NEG_MEMBLT_R2_INDEX: FALSE
(byte) 0x00, // TS_NEG_MEM3BLT_R2_INDEX: FALSE
(byte) 0x00, // TS_NEG_MULTIDSTBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_MULTIPATBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_MULTISCRBLT_INDEX: FALSE
(byte) 0x00, // TS_NEG_MULTIOPAQUERECT_INDEX: FALSE
(byte) 0x00, // TS_NEG_FAST_INDEX_INDEX: FALSE
(byte) 0x00, // TS_NEG_POLYGON_SC_INDEX: FALSE
(byte) 0x00, // TS_NEG_POLYGON_CB_INDEX: FALSE
(byte) 0x00, // TS_NEG_POLYLINE_INDEX: TRUE
(byte) 0x00, // Unused: 0
(byte) 0x00, // TS_NEG_FAST_GLYPH_INDEX: FALSE
(byte) 0x00, // TS_NEG_ELLIPSE_SC_INDEX: FALSE
(byte) 0x00, // TS_NEG_ELLIPSE_CB_INDEX: FALSE
(byte) 0x00, // TS_NEG_INDEX_INDEX: FALSE
(byte) 0x00, // TS_NEG_WEXTTEXTOUT_INDEX: FALSE
(byte) 0x00, // TS_NEG_WLONGTEXTOUT_INDEX: FALSE
(byte) 0x00, // TS_NEG_WLONGEXTTEXTOUT_INDEX: FALSE
(byte) 0x00, // Unused: 0
(byte) 0x00, // Text flags (ignored): 0 (LE)
(byte) 0x00, // Text flags (ignored): 0 (LE)
(byte) 0x00, // Order support extra flags: 0 (LE)
(byte) 0x00, // Order support extra flags: 0 (LE)
(byte) 0x00, // Padding 4 bytes
(byte) 0x00, // Padding 4 bytes
(byte) 0x00, // Padding 4 bytes
(byte) 0x00, // Padding 4 bytes
(byte) 0x00, // Desktop save size (ignored): 0 (assumed to be 230400 bytes (480*480, 0x38400, LE))
(byte) 0x00, // Desktop save size (ignored): 0 (assumed to be 230400 bytes (480*480, 0x38400, LE))
(byte) 0x00, // Desktop save size (ignored): 0 (assumed to be 230400 bytes (480*480, 0x38400, LE))
(byte) 0x00, // Desktop save size (ignored): 0 (assumed to be 230400 bytes (480*480, 0x38400, LE))
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Text ANSI Code Page: 1252, ANSI - Latin I (0x04e4, LE)
(byte) 0xe4, // Text ANSI Code Page: 1252, ANSI - Latin I (0x04e4, LE)
(byte) 0x04, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // capability set type: CAPSTYPE_BITMAPCACHE_REV2 (19) (LE)
(byte) 0x13, // capability set type: CAPSTYPE_BITMAPCACHE_REV2 (19) (LE)
(byte) 0x00, // length of capability set: 40 bytes (LE)
(byte) 0x28, // length of capability set: 40 bytes (LE)
(byte) 0x00, // Cache flags: 0 (LE)
(byte) 0x00, // Cache flags: 0 (LE)
(byte) 0x00, // Padding 1 byte
(byte) 0x00, // Number of cell caches: 0
(byte) 0x00, // Bitmap cache0 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache0 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache0 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache0 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache1 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache1 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache1 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache1 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache2 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache2 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache2 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache2 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache3 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache3 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache3 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache3 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache4 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache4 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache4 cell info: 0 (LE)
(byte) 0x00, // Bitmap cache4 cell info: 0 (LE)
(byte) 0x00, // Padding 12 bytes
(byte) 0x00, // Padding 12 bytes
(byte) 0x00, // Padding 12 bytes
(byte) 0x00, // Padding 12 bytes
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // Padding
(byte) 0x00, // capability set type: CAPSTYPE_COLORCACHE (10) (LE)
(byte) 0x0a, // capability set type: CAPSTYPE_COLORCACHE (10) (LE)
(byte) 0x00, // length of capability set: 8 bytes (LE)
(byte) 0x08, // length of capability set: 8 bytes (LE)
(byte) 0x00, // Color table cache size (must be ignored during capability exchange and is assumed to be 0x0006): 6 (LE)
(byte) 0x06, // Color table cache size (must be ignored during capability exchange and is assumed to be 0x0006): 6 (LE)
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // capability set type: CAPSTYPE_ACTIVATION (7) (LE)
(byte) 0x07, // capability set type: CAPSTYPE_ACTIVATION (7) (LE)
(byte) 0x00, // length of capability set: 12 bytes (LE)
(byte) 0x0c, // length of capability set: 12 bytes (LE)
(byte) 0x00, // helpKeyFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // helpKeyFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // helpKeyIndexFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // helpKeyIndexFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // helpExtendedKeyFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // helpExtendedKeyFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // windowManagerKeyFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // windowManagerKeyFlag (should be set to FALSE (0)): FALSE (0, LE)
(byte) 0x00, // capability set type: CAPSTYPE_ACTIVATION (7)
(byte) 0x05, // capability set type: CAPSTYPE_ACTIVATION (7)
(byte) 0x00, // length of capability set: 12 bytes (LE)
(byte) 0x0c, // length of capability set: 12 bytes (LE)
(byte) 0x00, // controlFlags (should be set to 0): 0 (LE)
(byte) 0x00, // controlFlags (should be set to 0): 0 (LE)
(byte) 0x00, // remoteDetachFlag (should be set to 0): 0 (LE)
(byte) 0x00, // remoteDetachFlag (should be set to 0): 0 (LE)
(byte) 0x00, // controlInterest (should be set to CONTROLPRIORITY_NEVER): CONTROLPRIORITY_NEVER (2) (LE)
(byte) 0x02, // controlInterest (should be set to CONTROLPRIORITY_NEVER): CONTROLPRIORITY_NEVER (2) (LE)
(byte) 0x00, // detachInterest (should be set to CONTROLPRIORITY_NEVER): CONTROLPRIORITY_NEVER (2) (LE)
(byte) 0x02, // detachInterest (should be set to CONTROLPRIORITY_NEVER): CONTROLPRIORITY_NEVER (2) (LE)
(byte) 0x00, // capability set type: CAPSTYPE_POINTER (8, LE)
(byte) 0x08, // capability set type: CAPSTYPE_POINTER (8, LE)
(byte) 0x00, // length of capability set: 10 bytes (LE)
(byte) 0x0a, // length of capability set: 10 bytes (LE)
(byte) 0x00, // colorPointerFlag: FALSE (LE)
(byte) 0x00, // colorPointerFlag: FALSE (LE)
(byte) 0x00, // colorPointerCacheSize: 0 (LE)
(byte) 0x00, // colorPointerCacheSize: 0 (LE)
(byte) 0x00, // pointerCacheSize: 20 (LE)
(byte) 0x14, // pointerCacheSize: 20 (LE)
(byte) 0x00, // capability set type: CAPSTYPE_SHARE (9, LE)
(byte) 0x09, // capability set type: CAPSTYPE_SHARE (9, LE)
(byte) 0x00, // length of capability set: 8 bytes (LE)
(byte) 0x08, // length of capability set: 8 bytes (LE)
(byte) 0x00, // nodeID (must be set to 0 by client): 0 (LE)
(byte) 0x00, // nodeID (must be set to 0 by client): 0 (LE)
(byte) 0x00, // Padding 2 bytes (LE)
(byte) 0x00, // Padding 2 bytes (LE)
(byte) 0x00, // capability set type: CAPSTYPE_INPUT (13, LE)
(byte) 0x0d, // capability set type: CAPSTYPE_INPUT (13, LE)
(byte) 0x00, // length of capability set: 88 bytes (LE)
(byte) 0x58, // length of capability set: 88 bytes (LE)
(byte) 0x00, // inputFlags: 0x0035 (LE), INPUT_FLAG_FASTPATH_INPUT2 (0x20), INPUT_FLAG_VKPACKET (0x10), INPUT_FLAG_MOUSEX (0x4), INPUT_FLAG_SCANCODES (0x1)
(byte) 0x35, // inputFlags: 0x0035 (LE), INPUT_FLAG_FASTPATH_INPUT2 (0x20), INPUT_FLAG_VKPACKET (0x10), INPUT_FLAG_MOUSEX (0x4), INPUT_FLAG_SCANCODES (0x1)
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // keyboardLayout: "US" keyboard layout (0x000409, LE)
(byte) 0x09, // keyboardLayout: "US" keyboard layout (0x000409, LE)
(byte) 0x04, // keyboardLayout: "US" keyboard layout (0x000409, LE)
(byte) 0x00, // keyboardLayout: "US" keyboard layout (0x000409, LE)
(byte) 0x00, // keyboardType: unknown (LE)
(byte) 0x00, // keyboardType: unknown (LE)
(byte) 0x00, // keyboardType: unknown (LE)
(byte) 0x00, // keyboardType: unknown (LE)
(byte) 0x00, // keyboardSubType: unknown (LE)
(byte) 0x00, // keyboardSubType: unknown (LE)
(byte) 0x00, // keyboardSubType: unknown (LE)
(byte) 0x00, // keyboardSubType: unknown (LE)
(byte) 0x00, // keyboardFunctionKey: unknown (LE)
(byte) 0x00, // keyboardFunctionKey: unknown (LE)
(byte) 0x00, // keyboardFunctionKey: unknown (LE)
(byte) 0x00, // keyboardFunctionKey: unknown (LE)
(byte) 0x00, // imeFileName: "", (64 bytes, including trailing NULL characters, UCS2)
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // capability set type: CAPSTYPE_BRUSH (15, LE)
(byte) 0x0f, // capability set type: CAPSTYPE_BRUSH (15, LE)
(byte) 0x00, // length of capability set: 8 bytes (LE)
(byte) 0x08, // length of capability set: 8 bytes (LE)
(byte) 0x00, // brushSupportLevel: BRUSH_DEFAULT (0x0, LE)
(byte) 0x00, // brushSupportLevel: BRUSH_DEFAULT (0x0, LE)
(byte) 0x00, // brushSupportLevel: BRUSH_DEFAULT (0x0, LE)
(byte) 0x00, // brushSupportLevel: BRUSH_DEFAULT (0x0, LE)
(byte) 0x00, // capability set type: CAPSTYPE_SOUND (12, LE)
(byte) 0x0c, // capability set type: CAPSTYPE_SOUND (12, LE)
(byte) 0x00, // length of capability set: 8 bytes (LE)
(byte) 0x08, // length of capability set: 8 bytes (LE)
(byte) 0x00, // soundFlags: 0x0000 (LE) // SOUND_FLAG_BEEPS (0x1)
(byte) 0x00, // soundFlags: 0x0000 (LE) // SOUND_FLAG_BEEPS (0x1)
(byte) 0x00, // soundFlags: 0x0000 (LE) // SOUND_FLAG_BEEPS (0x1)
(byte) 0x00, // soundFlags: 0x0000 (LE) // SOUND_FLAG_BEEPS (0x1)
(byte) 0x00, // Font Capability Set (8 bytes), see http://msdn.microsoft.com/en-us/library/cc240571.aspx
(byte) 0x0e, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, // capability set type: CAPSTYPE_OFFSCREENCACHE (17, LE)
(byte) 0x11, // capability set type: CAPSTYPE_OFFSCREENCACHE (17, LE)
(byte) 0x00, // length of capability set: 12 bytes (LE)
(byte) 0x0c, // length of capability set: 12 bytes (LE)
(byte) 0x00, // offscreenSupportLevel: FALSE (LE)
(byte) 0x00, // offscreenSupportLevel: FALSE (LE)
(byte) 0x00, // offscreenSupportLevel: FALSE (LE)
(byte) 0x00, // offscreenSupportLevel: FALSE (LE)
(byte) 0x00, // offscreenCacheSize: 0 (LE)
(byte) 0x00, // offscreenCacheSize: 0 (LE)
(byte) 0x00, // offscreenCacheEntries: 0 (LE)
(byte) 0x00, // offscreenCacheEntries: 0 (LE)
(byte) 0x00, // capability set type: CAPSTYPE_OFFSCREENCACHE (16, LE)
(byte) 0x10, // capability set type: CAPSTYPE_OFFSCREENCACHE (16, LE)
(byte) 0x00, // length of capability set: 52 bytes (LE)
(byte) 0x34, // length of capability set: 52 bytes (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x04, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x04, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x08, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x08, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x10, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x20, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x40, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x80, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheEntries: 254 (LE)
(byte) 0xfe, // CacheEntries: 254 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x00, // CacheMaximumCellSize: 4 (LE)
(byte) 0x01, // CacheEntries: 64 (LE)
(byte) 0x40, // CacheEntries: 64 (LE)
(byte) 0x00, // CacheMaximumCellSize: 2048 (LE)
(byte) 0x00, // CacheMaximumCellSize: 2048 (LE)
(byte) 0x08, // CacheEntries: 256 (LE)
(byte) 0x00, // CacheEntries: 256 (LE)
(byte) 0x01, // CacheMaximumCellSize: 256 (LE)
(byte) 0x00, // CacheMaximumCellSize: 256 (LE)
(byte) 0x01, // GlyphSupportLevel: GLYPH_SUPPORT_NONE (0x0, LE)
(byte) 0x00, // GlyphSupportLevel: GLYPH_SUPPORT_NONE (0x0, LE)
(byte) 0x00, // Padding 2 bytes
(byte) 0x00, // Padding 2 bytes
(byte) 0x00 };
/* @formatter:on */
RdpState rdpState = new RdpState();
ScreenDescription screenDescription = new ScreenDescription();
screenDescription.setFramebufferSize(1024, 768);
rdpState.serverShareId = 0x000103ea;
MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {}));
Element confirm_active = new ClientConfirmActivePDU("confirm_active", screenDescription, rdpState);
Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet));
Pipeline pipeline = new PipelineImpl("test");
pipeline.add(source, confirm_active, sink);
pipeline.link("source", "confirm_active", "sink");
pipeline.runMainLoop("source", STDOUT, false, false);
}
use of streamer.Pipeline in project cloudstack by apache.
the class ClientMCSConnectInitial method main.
/**
* Example.
*
* @see http://msdn.microsoft.com/en-us/library/cc240836.aspx
*/
public static void main(String[] args) {
// System.setProperty("streamer.Link.debug", "true");
System.setProperty("streamer.Element.debug", "true");
// System.setProperty("streamer.Pipeline.debug", "true");
/* @formatter:off */
byte[] packet = new byte[] { // TPKT: TPKT version = 3
(byte) 0x03, (byte) 0x00, // TPKT: Packet length: 378 bytes
(byte) 0x01, (byte) 0x78, // X.224: Length indicator = 2
(byte) 0x02, // X.224: Type: Data TPDU
(byte) 0xf0, // X.224: EOT
(byte) 0x80, // Captured packet
(byte) 0x7f, (byte) 0x65, (byte) 0x82, (byte) 0x01, (byte) 0x6c, (byte) 0x04, (byte) 0x01, (byte) 0x01, (byte) 0x04, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0xff, (byte) 0x30, (byte) 0x1a, (byte) 0x02, (byte) 0x01, (byte) 0x22, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x30, (byte) 0x19, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x02, (byte) 0x04, (byte) 0x20, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x30, (byte) 0x1f, (byte) 0x02, (byte) 0x03, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x02, (byte) 0x02, (byte) 0xfc, (byte) 0x17, (byte) 0x02, (byte) 0x03, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x01, (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x00, (byte) 0xff, (byte) 0xff, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x04, (byte) 0x82, (byte) 0x01, (byte) 0x07, (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x14, (byte) 0x7c, (byte) 0x00, (byte) 0x01, (byte) 0x80, (byte) 0xfe, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x01, (byte) 0xc0, (byte) 0x00, (byte) 0x44, (byte) 0x75, (byte) 0x63, (byte) 0x61, (byte) 0x80, (byte) 0xf0, (byte) 0x01, (byte) 0xc0, (byte) 0xd8, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0x03, (byte) 0x01, (byte) 0xca, (byte) 0x03, (byte) 0xaa, (byte) 0x09, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x28, (byte) 0x0a, (byte) 0x00, (byte) 0x00, (byte) 0x61, (byte) 0x00, (byte) 0x70, (byte) 0x00, (byte) 0x6f, (byte) 0x00, (byte) 0x6c, (byte) 0x00, (byte) 0x6c, (byte) 0x00, (byte) 0x6f, (byte) 0x00, (byte) 0x33, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0xca, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x07, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0xc0, (byte) 0x0c, (byte) 0x00, (byte) 0x0d, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0xc0, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 };
/* @formatter:on */
MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 }));
Element todo = new ClientMCSConnectInitial("ClientMCSConnectInitial");
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", "ClientMCSConnectInitial", "mainSink");
pipeline.link("ClientMCSConnectInitial >" + OTOUT, "x224", "tpkt", "sink");
pipeline.runMainLoop("source", STDOUT, false, false);
}
Aggregations