├── .gitignore
├── LICENSE.txt
├── Makefile
├── README.md
├── assets
├── Configurations
│ └── .gitkeep
├── Firmwares
│ └── .gitkeep
├── Images
│ └── happy.jpg
├── Keymaps
│ ├── ar
│ ├── da
│ ├── de
│ ├── en-gb
│ ├── en-us
│ ├── es
│ ├── fi
│ ├── fr
│ ├── fr-be
│ ├── hr
│ ├── it
│ ├── ja
│ ├── lt
│ ├── lv
│ ├── mk
│ ├── no
│ ├── pl
│ ├── pt
│ ├── pt-br
│ ├── ru
│ ├── sl
│ ├── sv
│ ├── tk
│ └── tr
├── LICENSE.txt
└── README.md
└── jopenray
├── build.xml
├── lib
├── jdom.jar
└── log4j-1.2.15.jar
└── src
├── com
└── jcraft
│ ├── jcterm
│ ├── Connection.java
│ ├── Emulator.java
│ ├── EmulatorVT100.java
│ ├── JSchSession.java
│ └── Term.java
│ └── jsch
│ ├── Buffer.java
│ ├── Channel.java
│ ├── ChannelAgentForwarding.java
│ ├── ChannelDirectTCPIP.java
│ ├── ChannelExec.java
│ ├── ChannelForwardedTCPIP.java
│ ├── ChannelSession.java
│ ├── ChannelSftp.java
│ ├── ChannelShell.java
│ ├── ChannelSubsystem.java
│ ├── ChannelX11.java
│ ├── Cipher.java
│ ├── CipherNone.java
│ ├── Compression.java
│ ├── DH.java
│ ├── DHG1.java
│ ├── DHGEX.java
│ ├── ForwardedTCPIPDaemon.java
│ ├── GSSContext.java
│ ├── HASH.java
│ ├── HostKey.java
│ ├── HostKeyRepository.java
│ ├── IO.java
│ ├── Identity.java
│ ├── IdentityFile.java
│ ├── JSch.java
│ ├── JSchAuthCancelException.java
│ ├── JSchException.java
│ ├── JSchPartialAuthException.java
│ ├── KeyExchange.java
│ ├── KeyPair.java
│ ├── KeyPairDSA.java
│ ├── KeyPairGenDSA.java
│ ├── KeyPairGenRSA.java
│ ├── KeyPairRSA.java
│ ├── KnownHosts.java
│ ├── Logger.java
│ ├── MAC.java
│ ├── Packet.java
│ ├── PortWatcher.java
│ ├── Proxy.java
│ ├── ProxyHTTP.java
│ ├── ProxySOCKS4.java
│ ├── ProxySOCKS5.java
│ ├── Random.java
│ ├── Request.java
│ ├── RequestAgentForwarding.java
│ ├── RequestEnv.java
│ ├── RequestExec.java
│ ├── RequestPtyReq.java
│ ├── RequestSftp.java
│ ├── RequestShell.java
│ ├── RequestSignal.java
│ ├── RequestSubsystem.java
│ ├── RequestWindowChange.java
│ ├── RequestX11.java
│ ├── ServerSocketFactory.java
│ ├── Session.java
│ ├── SftpATTRS.java
│ ├── SftpException.java
│ ├── SftpProgressMonitor.java
│ ├── SignatureDSA.java
│ ├── SignatureRSA.java
│ ├── SocketFactory.java
│ ├── UIKeyboardInteractive.java
│ ├── UserAuth.java
│ ├── UserAuthGSSAPIWithMIC.java
│ ├── UserAuthKeyboardInteractive.java
│ ├── UserAuthNone.java
│ ├── UserAuthPassword.java
│ ├── UserAuthPublicKey.java
│ ├── UserInfo.java
│ ├── Util.java
│ ├── jce
│ ├── AES128CBC.java
│ ├── AES128CTR.java
│ ├── AES192CBC.java
│ ├── AES192CTR.java
│ ├── AES256CBC.java
│ ├── AES256CTR.java
│ ├── ARCFOUR.java
│ ├── ARCFOUR128.java
│ ├── ARCFOUR256.java
│ ├── BlowfishCBC.java
│ ├── DH.java
│ ├── HMACMD5.java
│ ├── HMACMD596.java
│ ├── HMACSHA1.java
│ ├── HMACSHA196.java
│ ├── KeyPairGenDSA.java
│ ├── KeyPairGenRSA.java
│ ├── MD5.java
│ ├── Random.java
│ ├── SHA1.java
│ ├── SignatureDSA.java
│ ├── SignatureRSA.java
│ ├── TripleDESCBC.java
│ └── TripleDESCTR.java
│ ├── jcraft
│ ├── HMAC.java
│ ├── HMACMD5.java
│ ├── HMACMD596.java
│ ├── HMACSHA1.java
│ └── HMACSHA196.java
│ └── jgss
│ └── GSSContextKrb5.java
├── net
└── percederberg
│ └── tetris
│ ├── Configuration.java
│ ├── Figure.java
│ ├── Game.java
│ ├── Main.java
│ └── SquareBoard.java
└── org
└── jopenray
├── activity
├── ActivityManager.java
└── ActivityMonitorPanel.java
├── adapter
├── RDPAdapter.java
├── RFBAdapter.java
└── SshAdapter.java
├── authentication
├── AuthenticationMessage.java
└── AuthenticationThread.java
├── client
├── OpenRayClient.java
├── RendererListener.java
└── Stat.java
├── operation
├── BitmapOperation.java
├── BitmapRGBOperation.java
├── CopyOperation.java
├── FillOperation.java
├── FlushOperation.java
├── GetVersionOperation.java
├── InitOperation.java
├── Operation.java
├── PadOperation.java
├── RawAudioOperation.java
├── SetBoundsOperation.java
├── SetMouseCursorOperation.java
├── SleepOperation.java
├── TestOperation.java
└── UnknownACOperation.java
├── rdp
├── Bitmap.java
├── Cache.java
├── Common.java
├── CommunicationMonitor.java
├── ConnectionException.java
├── Constants.java
├── DataBlob.java
├── Glyph.java
├── HexDump.java
├── ISO.java
├── Input.java
├── Licence.java
├── LicenceStore.java
├── LicenceStore_Localised.java
├── MCS.java
├── Options.java
├── OrderException.java
├── OrderState.java
├── Orders.java
├── PstCache.java
├── RDPCanvas.java
├── RDPError.java
├── RDPKeymap.java
├── RasterOp.java
├── RdesktopException.java
├── Rdp.java
├── RdpPacket.java
├── RdpPacket_Localised.java
├── Secure.java
├── Utilities.java
├── Utilities_Localised.java
├── WrappedImage.java
├── crypto
│ ├── BlockMessageDigest.java
│ ├── CryptoException.java
│ ├── Key.java
│ ├── MD5.java
│ ├── RC4.java
│ └── SHA1.java
├── keymapping
│ ├── KeyCode.java
│ ├── KeyCodeFileBased.java
│ ├── KeyMapException.java
│ └── MapDef.java
├── orders
│ ├── BoundsOrder.java
│ ├── Brush.java
│ ├── DeskSaveOrder.java
│ ├── DestBltOrder.java
│ ├── LineOrder.java
│ ├── MemBltOrder.java
│ ├── Order.java
│ ├── PatBltOrder.java
│ ├── Pen.java
│ ├── PolyLineOrder.java
│ ├── RectangleOrder.java
│ ├── ScreenBltOrder.java
│ ├── Text2Order.java
│ └── TriBltOrder.java
└── rdp5
│ ├── Rdp5.java
│ ├── TestChannel.java
│ ├── VChannel.java
│ ├── VChannels.java
│ └── cliprdr
│ ├── BMPToImageThread.java
│ ├── ClipBMP.java
│ ├── ClipChannel.java
│ ├── ClipInterface.java
│ ├── DIBHandler.java
│ ├── ImageSelection.java
│ ├── MetafilepictHandler.java
│ ├── TextHandler.java
│ ├── TypeHandler.java
│ ├── TypeHandlerList.java
│ └── UnicodeHandler.java
├── rfb
├── AuthPanel.java
├── ButtonPanel.java
├── CapabilityInfo.java
├── CapsContainer.java
├── ClipboardFrame.java
├── DesCipher.java
├── HTTPConnectSocket.java
├── HTTPConnectSocketFactory.java
├── InStream.java
├── MemInStream.java
├── OptionsFrame.java
├── RecordingFrame.java
├── ReloginPanel.java
├── RfbProto.java
├── SessionRecorder.java
├── SocketFactory.java
├── VncCanvas.java
├── VncViewer.java
└── ZlibInStream.java
├── server
├── OpenRayServer.java
├── ServerFrame.java
├── card.png
├── card
│ ├── Card.java
│ ├── CardListPanel.java
│ ├── CardManager.java
│ ├── CardManagerListener.java
│ ├── CardPropertiesPanel.java
│ ├── CardPropertiesTableModel.java
│ └── CardTableModel.java
├── card_red.png
├── event
│ ├── Event.java
│ ├── EventListPanel.java
│ ├── EventManager.java
│ ├── EventManagerListener.java
│ └── EventTableModel.java
├── logo.png
├── session
│ ├── CardComboBoxModel.java
│ ├── CardListCellRenderer.java
│ ├── CardSessionListModel.java
│ ├── Session.java
│ ├── SessionListPanel.java
│ ├── SessionManager.java
│ ├── SessionManagerListener.java
│ ├── SessionPropertiesPanel.java
│ └── SessionTableModel.java
├── thinclient.png
├── thinclient
│ ├── BitmapEncoder.java
│ ├── BitmapLine.java
│ ├── ClientListPanel.java
│ ├── ClientPropertiesTableModel.java
│ ├── ClientTableModel.java
│ ├── DisplayMessage.java
│ ├── DisplayReaderThread.java
│ ├── DisplayWriterThread.java
│ ├── InputListener.java
│ ├── OperationHistory.java
│ ├── ThinClient.java
│ ├── ThinClientManager.java
│ ├── ThinClientManagerListener.java
│ └── ThinClientPropertiesPanel.java
└── user
│ ├── User.java
│ ├── UserListPanel.java
│ ├── UserManager.java
│ ├── UserManagerListener.java
│ ├── UserPropertiesPanel.java
│ └── UserTableModel.java
├── test
├── BenchmarkEncoder.java
├── BitmapTest.java
├── ByteArrayListWithHeaderTest.java
├── DebugClient.java
└── KeyTest.java
└── util
├── BitArray.java
├── ByteArrayList.java
├── ByteArrayListWithHeader.java
├── CustomGraphics.java
├── HID.java
├── Hex.java
├── JImage.java
├── MessageImage.java
├── PacketAnalyser.java
├── PcapFileReader.java
├── PcapPacket.java
├── TIntArrayList.java
├── Util.java
├── Vera.ttf
├── VeraFont.java
└── VeraMono.ttf
/.gitignore:
--------------------------------------------------------------------------------
1 | jopenray/build/
2 | jopenray/dist/
3 | dist/
4 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 |
2 | default: install
3 |
4 | java: jopenray/build.xml
5 | ( cd jopenray && ant )
6 |
7 | dist:
8 | mkdir -pv dist
9 |
10 | dist/kOpenRay/README.md: dist
11 | cp -R assets/ dist/kOpenRay
12 |
13 | install: dist/kOpenRay/README.md java
14 | cp jopenray/dist/kOpenRay.jar dist/kOpenRay
15 |
16 | clean:
17 | rm -rf dist jopenray/build jopenray/dist
18 |
--------------------------------------------------------------------------------
/assets/Configurations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Configurations/.gitkeep
--------------------------------------------------------------------------------
/assets/Firmwares/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Firmwares/.gitkeep
--------------------------------------------------------------------------------
/assets/Images/happy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Images/happy.jpg
--------------------------------------------------------------------------------
/assets/Keymaps/da:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/da
--------------------------------------------------------------------------------
/assets/Keymaps/de:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/de
--------------------------------------------------------------------------------
/assets/Keymaps/en-gb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/en-gb
--------------------------------------------------------------------------------
/assets/Keymaps/es:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/es
--------------------------------------------------------------------------------
/assets/Keymaps/fr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/fr
--------------------------------------------------------------------------------
/assets/Keymaps/fr-be:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/fr-be
--------------------------------------------------------------------------------
/assets/Keymaps/hr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/hr
--------------------------------------------------------------------------------
/assets/Keymaps/it:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/it
--------------------------------------------------------------------------------
/assets/Keymaps/lt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/lt
--------------------------------------------------------------------------------
/assets/Keymaps/no:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/no
--------------------------------------------------------------------------------
/assets/Keymaps/pl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/pl
--------------------------------------------------------------------------------
/assets/Keymaps/pt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/pt
--------------------------------------------------------------------------------
/assets/Keymaps/ru:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/ru
--------------------------------------------------------------------------------
/assets/Keymaps/sv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/sv
--------------------------------------------------------------------------------
/assets/Keymaps/tk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/assets/Keymaps/tk
--------------------------------------------------------------------------------
/jopenray/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/jopenray/lib/jdom.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/lib/jdom.jar
--------------------------------------------------------------------------------
/jopenray/lib/log4j-1.2.15.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/lib/log4j-1.2.15.jar
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jcterm/Connection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | * Copyright 2007 ymnk, JCraft,Inc.
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or (at
8 | * your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see
17 | */
18 | package com.jcraft.jcterm;
19 |
20 | import java.io.InputStream;
21 | import java.io.OutputStream;
22 |
23 | public interface Connection{
24 |
25 | InputStream getInputStream();
26 |
27 | OutputStream getOutputStream();
28 |
29 | void requestResize(Term term);
30 |
31 | void close();
32 | }
33 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jcterm/Term.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | * Copyright 2007 ymnk, JCraft,Inc.
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or (at
8 | * your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see
17 | */
18 |
19 | package com.jcraft.jcterm;
20 |
21 | public interface Term {
22 |
23 | void start(Connection connection);
24 |
25 | int getRowCount();
26 |
27 | int getColumnCount();
28 |
29 | int getCharWidth();
30 |
31 | int getCharHeight();
32 |
33 | void setCursor(int x, int y);
34 |
35 | void clear();
36 |
37 | void drawCursor();
38 |
39 | void redraw(int x, int y, int width, int height);
40 |
41 | void clearArea(int x1, int y1, int x2, int y2);
42 |
43 | void scrollArea(int x, int y, int w, int h, int dx, int dy);
44 |
45 | void drawBytes(byte[] buf, int s, int len, int x, int y);
46 |
47 | void drawString(String str, int x, int y);
48 |
49 | void beep();
50 |
51 | void setDefaultForeGround(Object foreground);
52 |
53 | void setDefaultBackGround(Object background);
54 |
55 | void setForeGround(Object foreground);
56 |
57 | void setBackGround(Object background);
58 |
59 | void setBold();
60 |
61 | void setUnderline();
62 |
63 | void setReverse();
64 |
65 | void resetAllAttributes();
66 |
67 | int getTermWidth();
68 |
69 | int getTermHeight();
70 |
71 | Object getColor(int index);
72 | }
73 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/Cipher.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface Cipher{
33 | static int ENCRYPT_MODE=0;
34 | static int DECRYPT_MODE=1;
35 | int getIVSize();
36 | int getBlockSize();
37 | void init(int mode, byte[] key, byte[] iv) throws Exception;
38 | void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception;
39 | boolean isCBC();
40 | }
41 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/CipherNone.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public class CipherNone implements Cipher{
33 | private static final int ivsize=8;
34 | private static final int bsize=16;
35 | public int getIVSize(){return ivsize;}
36 | public int getBlockSize(){return bsize;}
37 | public void init(int mode, byte[] key, byte[] iv) throws Exception{
38 | }
39 | public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{
40 | }
41 | public boolean isCBC(){return false; }
42 | }
43 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/Compression.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface Compression{
33 | static public final int INFLATER=0;
34 | static public final int DEFLATER=1;
35 | void init(int type, int level);
36 | int compress(byte[] buf, int start, int len);
37 | byte[] uncompress(byte[] buf, int start, int[] len);
38 | }
39 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/DH.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface DH{
33 | void init() throws Exception;
34 | void setP(byte[] p);
35 | void setG(byte[] g);
36 | byte[] getE() throws Exception;
37 | void setF(byte[] f);
38 | byte[] getK() throws Exception;
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/ForwardedTCPIPDaemon.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 | import java.io.*;
32 |
33 | public interface ForwardedTCPIPDaemon extends Runnable{
34 | void setChannel(ChannelForwardedTCPIP channel, InputStream in, OutputStream out);
35 | void setArg(Object[] arg);
36 | }
37 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/GSSContext.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2004-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface GSSContext{
33 | public void create(String user, String host) throws JSchException;
34 | public boolean isEstablished();
35 | public byte[] init(byte[] token, int s, int l) throws JSchException;
36 | public byte[] getMIC(byte[] message, int s, int l);
37 | public void dispose();
38 | }
39 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/HASH.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface HASH{
33 | void init() throws Exception;
34 | int getBlockSize();
35 | void update(byte[] foo, int start, int len) throws Exception;
36 | byte[] digest() throws Exception;
37 | }
38 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/HostKeyRepository.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2004-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface HostKeyRepository{
33 | final int OK=0;
34 | final int NOT_INCLUDED=1;
35 | final int CHANGED=2;
36 |
37 | int check(String host, byte[] key);
38 | void add(HostKey hostkey, UserInfo ui);
39 | void remove(String host, String type);
40 | void remove(String host, String type, byte[] key);
41 | String getKnownHostsRepositoryID();
42 | HostKey[] getHostKey();
43 | HostKey[] getHostKey(String host, String type);
44 | }
45 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/Identity.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface Identity{
33 | public boolean setPassphrase(byte[] passphrase) throws JSchException;
34 | public byte[] getPublicKeyBlob();
35 | public byte[] getSignature(byte[] data);
36 | public boolean decrypt();
37 | public String getAlgName();
38 | public String getName();
39 | public boolean isEncrypted();
40 | public void clear();
41 | }
42 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/JSchAuthCancelException.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class JSchAuthCancelException extends JSchException{
33 | //private static final long serialVersionUID=3204965907117900987L;
34 | String method;
35 | JSchAuthCancelException () {
36 | super();
37 | }
38 | JSchAuthCancelException (String s) {
39 | super(s);
40 | this.method=s;
41 | }
42 | public String getMethod(){
43 | return method;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/JSchException.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public class JSchException extends Exception{
33 | //private static final long serialVersionUID=-1319309923966731989L;
34 | private Throwable cause=null;
35 | public JSchException () {
36 | super();
37 | }
38 | public JSchException (String s) {
39 | super(s);
40 | }
41 | public JSchException (String s, Throwable e) {
42 | super(s);
43 | this.cause=e;
44 | }
45 | public Throwable getCause(){
46 | return this.cause;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/JSchPartialAuthException.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class JSchPartialAuthException extends JSchException{
33 | //private static final long serialVersionUID=-378849862323360367L;
34 | String methods;
35 | public JSchPartialAuthException () {
36 | super();
37 | }
38 | public JSchPartialAuthException (String s) {
39 | super(s);
40 | this.methods=s;
41 | }
42 | public String getMethods(){
43 | return methods;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/KeyPairGenDSA.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface KeyPairGenDSA{
33 | void init(int key_size) throws Exception;
34 | byte[] getX();
35 | byte[] getY();
36 | byte[] getP();
37 | byte[] getQ();
38 | byte[] getG();
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/KeyPairGenRSA.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface KeyPairGenRSA{
33 | void init(int key_size) throws Exception;
34 | byte[] getD();
35 | byte[] getE();
36 | byte[] getN();
37 |
38 | byte[] getC();
39 | byte[] getEP();
40 | byte[] getEQ();
41 | byte[] getP();
42 | byte[] getQ();
43 | }
44 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/Logger.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2006-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface Logger{
33 |
34 | public final int DEBUG=0;
35 | public final int INFO=1;
36 | public final int WARN=2;
37 | public final int ERROR=3;
38 | public final int FATAL=4;
39 |
40 | public boolean isEnabled(int level);
41 |
42 | public void log(int level, String message);
43 |
44 | /*
45 | public final Logger SIMPLE_LOGGER=new Logger(){
46 | public boolean isEnabled(int level){return true;}
47 | public void log(int level, String message){System.err.println(message);}
48 | };
49 | final Logger DEVNULL=new Logger(){
50 | public boolean isEnabled(int level){return false;}
51 | public void log(int level, String message){}
52 | };
53 | */
54 | }
55 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/MAC.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface MAC{
33 | String getName();
34 | int getBlockSize();
35 | void init(byte[] key) throws Exception;
36 | void update(byte[] foo, int start, int len);
37 | void update(int foo);
38 | void doFinal(byte[] buf, int offset);
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/Proxy.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | import java.io.*;
33 | import java.net.Socket;
34 | public interface Proxy{
35 | void connect(SocketFactory socket_factory, String host, int port, int timeout) throws Exception;
36 | InputStream getInputStream();
37 | OutputStream getOutputStream();
38 | Socket getSocket();
39 | void close();
40 | }
41 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/Random.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface Random{
33 | void fill(byte[] foo, int start, int len);
34 | }
35 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestAgentForwarding.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2006-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class RequestAgentForwarding extends Request{
33 | public void request(Session session, Channel channel) throws Exception{
34 | super.request(session, channel);
35 |
36 | setReply(false);
37 |
38 | Buffer buf=new Buffer();
39 | Packet packet=new Packet(buf);
40 |
41 | // byte SSH_MSG_CHANNEL_REQUEST(98)
42 | // uint32 recipient channel
43 | // string request type // "auth-agent-req@openssh.com"
44 | // boolean want reply // 0
45 | packet.reset();
46 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
47 | buf.putInt(channel.getRecipient());
48 | buf.putString(Util.str2byte("auth-agent-req@openssh.com"));
49 | buf.putByte((byte)(waitForReply() ? 1 : 0));
50 | write(packet);
51 | session.agent_forwarding=true;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestEnv.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class RequestEnv extends Request{
33 | byte[] name=new byte[0];
34 | byte[] value=new byte[0];
35 | void setEnv(byte[] name, byte[] value){
36 | this.name=name;
37 | this.value=value;
38 | }
39 | public void request(Session session, Channel channel) throws Exception{
40 | super.request(session, channel);
41 |
42 | Buffer buf=new Buffer();
43 | Packet packet=new Packet(buf);
44 |
45 | packet.reset();
46 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
47 | buf.putInt(channel.getRecipient());
48 | buf.putString(Util.str2byte("env"));
49 | buf.putByte((byte)(waitForReply() ? 1 : 0));
50 | buf.putString(name);
51 | buf.putString(value);
52 | write(packet);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestExec.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class RequestExec extends Request{
33 | private byte[] command=new byte[0];
34 | RequestExec(byte[] command){
35 | this.command=command;
36 | }
37 | public void request(Session session, Channel channel) throws Exception{
38 | super.request(session, channel);
39 |
40 | Buffer buf=new Buffer();
41 | Packet packet=new Packet(buf);
42 |
43 | // send
44 | // byte SSH_MSG_CHANNEL_REQUEST(98)
45 | // uint32 recipient channel
46 | // string request type // "exec"
47 | // boolean want reply // 0
48 | // string command
49 | packet.reset();
50 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
51 | buf.putInt(channel.getRecipient());
52 | buf.putString(Util.str2byte("exec"));
53 | buf.putByte((byte)(waitForReply() ? 1 : 0));
54 | buf.putString(command);
55 | write(packet);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestSftp.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public class RequestSftp extends Request{
33 | RequestSftp(){
34 | setReply(true);
35 | }
36 | public void request(Session session, Channel channel) throws Exception{
37 | super.request(session, channel);
38 |
39 | Buffer buf=new Buffer();
40 | Packet packet=new Packet(buf);
41 | packet.reset();
42 | buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST);
43 | buf.putInt(channel.getRecipient());
44 | buf.putString(Util.str2byte("subsystem"));
45 | buf.putByte((byte)(waitForReply() ? 1 : 0));
46 | buf.putString(Util.str2byte("sftp"));
47 | write(packet);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestShell.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class RequestShell extends Request{
33 | public void request(Session session, Channel channel) throws Exception{
34 | super.request(session, channel);
35 |
36 | Buffer buf=new Buffer();
37 | Packet packet=new Packet(buf);
38 |
39 | // send
40 | // byte SSH_MSG_CHANNEL_REQUEST(98)
41 | // uint32 recipient channel
42 | // string request type // "shell"
43 | // boolean want reply // 0
44 | packet.reset();
45 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
46 | buf.putInt(channel.getRecipient());
47 | buf.putString(Util.str2byte("shell"));
48 | buf.putByte((byte)(waitForReply() ? 1 : 0));
49 | write(packet);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestSignal.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | class RequestSignal extends Request{
33 | private String signal="KILL";
34 | public void setSignal(String foo){ signal=foo; }
35 | public void request(Session session, Channel channel) throws Exception{
36 | super.request(session, channel);
37 |
38 | Buffer buf=new Buffer();
39 | Packet packet=new Packet(buf);
40 |
41 | packet.reset();
42 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
43 | buf.putInt(channel.getRecipient());
44 | buf.putString(Util.str2byte("signal"));
45 | buf.putByte((byte)(waitForReply() ? 1 : 0));
46 | buf.putString(Util.str2byte(signal));
47 | write(packet);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/RequestSubsystem.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2005-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public class RequestSubsystem extends Request{
33 | private String subsystem=null;
34 | public void request(Session session, Channel channel, String subsystem, boolean want_reply) throws Exception{
35 | setReply(want_reply);
36 | this.subsystem=subsystem;
37 | this.request(session, channel);
38 | }
39 | public void request(Session session, Channel channel) throws Exception{
40 | super.request(session, channel);
41 |
42 | Buffer buf=new Buffer();
43 | Packet packet=new Packet(buf);
44 |
45 | packet.reset();
46 | buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST);
47 | buf.putInt(channel.getRecipient());
48 | buf.putString(Util.str2byte("subsystem"));
49 | buf.putByte((byte)(waitForReply() ? 1 : 0));
50 | buf.putString(Util.str2byte(subsystem));
51 | write(packet);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/ServerSocketFactory.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | import java.net.*;
33 | import java.io.*;
34 |
35 | public interface ServerSocketFactory{
36 | public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException;
37 | }
38 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/SftpException.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public class SftpException extends Exception{
33 | //private static final long serialVersionUID=-5616888495583253811L;
34 | public int id;
35 | private Throwable cause=null;
36 | public SftpException (int id, String message) {
37 | super(message);
38 | this.id=id;
39 | }
40 | public SftpException (int id, String message, Throwable e) {
41 | super(message);
42 | this.id=id;
43 | this.cause=e;
44 | }
45 | public String toString(){
46 | return id+": "+getMessage();
47 | }
48 | public Throwable getCause(){
49 | return this.cause;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/SftpProgressMonitor.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface SftpProgressMonitor{
33 | public static final int PUT=0;
34 | public static final int GET=1;
35 | void init(int op, String src, String dest, long max);
36 | boolean count(long count);
37 | void end();
38 | }
39 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/SignatureDSA.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface SignatureDSA{
33 | void init() throws Exception;
34 | void setPubKey(byte[] y, byte[] p, byte[] q, byte[] g) throws Exception;
35 | void setPrvKey(byte[] x, byte[] p, byte[] q, byte[] g) throws Exception;
36 | void update(byte[] H) throws Exception;
37 | boolean verify(byte[] sig) throws Exception;
38 | byte[] sign() throws Exception;
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/SignatureRSA.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface SignatureRSA{
33 | void init() throws Exception;
34 | void setPubKey(byte[] e, byte[] n) throws Exception;
35 | void setPrvKey(byte[] d, byte[] n) throws Exception;
36 | void update(byte[] H) throws Exception;
37 | boolean verify(byte[] sig) throws Exception;
38 | byte[] sign() throws Exception;
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/SocketFactory.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | import java.net.*;
33 | import java.io.*;
34 |
35 | public interface SocketFactory{
36 | public Socket createSocket(String host, int port)throws IOException,
37 | UnknownHostException;
38 | public InputStream getInputStream(Socket socket)throws IOException;
39 | public OutputStream getOutputStream(Socket socket)throws IOException;
40 | }
41 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/UIKeyboardInteractive.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface UIKeyboardInteractive{
33 | String[] promptKeyboardInteractive(String destination,
34 | String name,
35 | String instruction,
36 | String[] prompt,
37 | boolean[] echo);
38 | }
39 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/UserInfo.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch;
31 |
32 | public interface UserInfo{
33 | String getPassphrase();
34 | String getPassword();
35 | boolean promptPassword(String message);
36 | boolean promptPassphrase(String message);
37 | boolean promptYesNo(String message);
38 | void showMessage(String message);
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/jce/MD5.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch.jce;
31 |
32 | import com.jcraft.jsch.HASH;
33 |
34 | import java.security.*;
35 |
36 | public class MD5 implements HASH{
37 | MessageDigest md;
38 | public int getBlockSize(){return 16;}
39 | public void init() throws Exception{
40 | try{ md=MessageDigest.getInstance("MD5"); }
41 | catch(Exception e){
42 | System.err.println(e);
43 | }
44 | }
45 | public void update(byte[] foo, int start, int len) throws Exception{
46 | md.update(foo, start, len);
47 | }
48 | public byte[] digest() throws Exception{
49 | return md.digest();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/jce/SHA1.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2002-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch.jce;
31 |
32 | import com.jcraft.jsch.HASH;
33 |
34 | import java.security.*;
35 |
36 | public class SHA1 implements HASH{
37 | MessageDigest md;
38 | public int getBlockSize(){return 20;}
39 | public void init() throws Exception{
40 | try{ md=MessageDigest.getInstance("SHA-1"); }
41 | catch(Exception e){
42 | System.err.println(e);
43 | }
44 | }
45 | public void update(byte[] foo, int start, int len) throws Exception{
46 | md.update(foo, start, len);
47 | }
48 | public byte[] digest() throws Exception{
49 | return md.digest();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/jcraft/HMACMD5.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2006-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch.jcraft;
31 |
32 | import com.jcraft.jsch.MAC;
33 | import java.security.*;
34 |
35 | public class HMACMD5 extends HMAC implements MAC{
36 | private static final String name="hmac-md5";
37 |
38 | public HMACMD5(){
39 | super();
40 | MessageDigest md=null;
41 | try{ md=MessageDigest.getInstance("MD5"); }
42 | catch(Exception e){
43 | System.err.println(e);
44 | }
45 | setH(md);
46 | }
47 |
48 | public String getName(){
49 | return name;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/jcraft/HMACMD596.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2006-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch.jcraft;
31 |
32 | import com.jcraft.jsch.MAC;
33 |
34 | public class HMACMD596 extends HMACMD5{
35 |
36 | private static final String name="hmac-md5-96";
37 | private static final int BSIZE=12;
38 |
39 | public int getBlockSize(){return BSIZE;};
40 |
41 | private final byte[] _buf16=new byte[16];
42 | public void doFinal(byte[] buf, int offset){
43 | super.doFinal(_buf16, 0);
44 | System.arraycopy(_buf16, 0, buf, offset, BSIZE);
45 | }
46 |
47 | public String getName(){
48 | return name;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/jcraft/HMACSHA1.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2006-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch.jcraft;
31 |
32 | import com.jcraft.jsch.MAC;
33 | import java.security.*;
34 |
35 | public class HMACSHA1 extends HMAC implements MAC{
36 | private static final String name="hmac-sha1";
37 |
38 | public HMACSHA1(){
39 | super();
40 | MessageDigest md=null;
41 | try{ md=MessageDigest.getInstance("SHA-1"); }
42 | catch(Exception e){
43 | System.err.println(e);
44 | }
45 | setH(md);
46 | }
47 |
48 | public String getName(){
49 | return name;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jopenray/src/com/jcraft/jsch/jcraft/HMACSHA196.java:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2006-2010 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | package com.jcraft.jsch.jcraft;
31 |
32 | import com.jcraft.jsch.MAC;
33 |
34 | public class HMACSHA196 extends HMACSHA1{
35 |
36 | private static final String name="hmac-sha1-96";
37 | private static final int BSIZE=12;
38 |
39 | public int getBlockSize(){return BSIZE;};
40 |
41 | private final byte[] _buf16=new byte[20];
42 | public void doFinal(byte[] buf, int offset){
43 | super.doFinal(_buf16, 0);
44 | System.arraycopy(_buf16, 0, buf, offset, BSIZE);
45 | }
46 |
47 | public String getName(){
48 | return name;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/activity/ActivityManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.activity;
19 |
20 | public class ActivityManager {
21 |
22 | private static ActivityManager instance;
23 |
24 | public static synchronized ActivityManager getInstance() {
25 | if (instance == null) {
26 | instance = new ActivityManager();
27 |
28 | }
29 | return instance;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/activity/ActivityMonitorPanel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | * Copyright 2005 Propero Limited
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or (at
8 | * your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see
17 | */
18 | package org.jopenray.activity;
19 |
20 | import javax.swing.JPanel;
21 |
22 | /**
23 | * Activity monitoring of the server
24 | * */
25 | public class ActivityMonitorPanel extends JPanel {
26 |
27 | private static final long serialVersionUID = 7778581193461345856L;
28 |
29 | // TODO : implement the activity monitor
30 | public ActivityMonitorPanel() {
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/adapter/RFBAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.adapter;
19 |
20 | import org.jopenray.rfb.VncViewer;
21 | import org.jopenray.server.session.Session;
22 | import org.jopenray.server.thinclient.InputListener;
23 | import org.jopenray.server.thinclient.ThinClient;
24 |
25 | public class RFBAdapter implements InputListener {
26 | VncViewer v;
27 |
28 | public void start(final ThinClient displayClient, Session session) {
29 | System.err.println("DisplayClient:" + displayClient);
30 |
31 | v = new VncViewer(displayClient, new String[] { "HOST",
32 | session.getServer(), "PASSWORD", session.getPassword() });
33 |
34 | v.init();
35 | v.start();
36 | }
37 |
38 | public void stop() {
39 | v.stop();
40 | }
41 |
42 | @Override
43 | public void keyPressed(int key, boolean shift, boolean ctrl, boolean alt,
44 | boolean meta, boolean altGr) {
45 | // TODO Auto-generated method stub
46 |
47 | }
48 |
49 | @Override
50 | public void keyReleased(int key) {
51 | // TODO Auto-generated method stub
52 |
53 | }
54 |
55 | @Override
56 | public void mouseMoved(int mouseX, int mouseY) {
57 | // TODO Auto-generated method stub
58 |
59 | }
60 |
61 | @Override
62 | public void mousePressed(int button, int mouseX, int mouseY) {
63 | // TODO Auto-generated method stub
64 |
65 | }
66 |
67 | @Override
68 | public void mouseReleased(int button, int mouseX, int mouseY) {
69 | // TODO Auto-generated method stub
70 |
71 | }
72 |
73 | @Override
74 | public void mouseWheelDown(int mouseX, int mouseY) {
75 | // TODO Auto-generated method stub
76 |
77 | }
78 |
79 | @Override
80 | public void mouseWheelUp(int mouseX, int mouseY) {
81 | // TODO Auto-generated method stub
82 |
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/client/Stat.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.client;
19 |
20 | public class Stat {
21 | private final long byteCount;
22 | private final long connectionTime;
23 | private final long idleTime;
24 | private final long packetLostCount;
25 | private final long packetCount;
26 |
27 | Stat(long byteCount, long connectionTime, long idleTime,
28 | long packetLostCount, long packetCount) {
29 | this.byteCount = byteCount;
30 | this.connectionTime = connectionTime;
31 | this.idleTime = idleTime;
32 | this.packetLostCount = packetLostCount;
33 | this.packetCount = packetCount;
34 |
35 | }
36 |
37 | public long getByteCount() {
38 | return byteCount;
39 | }
40 |
41 | public long getConnectionTime() {
42 | return connectionTime;
43 | }
44 |
45 | public long getIdleTime() {
46 | return idleTime;
47 | }
48 |
49 | public long getLossCount() {
50 | return packetLostCount;
51 | }
52 |
53 | public long getPacketCount() {
54 | return packetCount;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/BitmapOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | import java.awt.Color;
21 |
22 | import org.jopenray.util.BitArray;
23 | import org.jopenray.util.PacketAnalyser;
24 |
25 | public class BitmapOperation extends Operation {
26 | public BitmapOperation(int x, int y, int width, int height, Color c0,
27 | Color c1, BitArray b) {
28 |
29 | // System.err.println("Bitmap Operation: " + x + "," + y + " " + width
30 | // + "x" + height);
31 |
32 | if (b.length() % 32 != 0) {
33 | throw new IllegalArgumentException(
34 | "BitArray not padded (32 bits), length: " + b.length()
35 | + " bits");
36 | }
37 | allocate(20 + b.length() / 8);
38 | setHeader(0xA5, x, y, width, height);
39 |
40 | buffer.addColor(c0);
41 | buffer.addColor(c1);
42 |
43 | buffer.addBytes(b.toByteArray());
44 | }
45 |
46 | public static BitArray getBytes(int[] pixels, int bitmapWidth, int fromX,
47 | int fromY, int width, int height, int color1) {
48 |
49 | final int nbBytesPerRow = 1 + (width - 1) / 8;
50 |
51 | final int nbBits = PacketAnalyser.round(nbBytesPerRow * 8 * height, 32);
52 |
53 | final BitArray b = new BitArray(nbBits);
54 |
55 | int i = fromX + fromY * bitmapWidth;
56 | int j = 0;
57 |
58 | for (int y = 0; y < height; y++) {
59 |
60 | for (int x = 0; x < width; x++) {
61 |
62 | int c = pixels[i];
63 | i++;
64 |
65 | if (c == color1) {
66 | b.set(j);
67 | }
68 | j++;
69 | }
70 | j = (y + 1) * nbBytesPerRow * 8;
71 | i = fromX + (fromY + y + 1) * bitmapWidth;
72 | }
73 |
74 | return b;
75 | }
76 |
77 | @Override
78 | public void dump() {
79 | System.out.println("BitmapOperation:" + getHeader());
80 |
81 | }
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/CopyOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class CopyOperation extends Operation {
21 | public CopyOperation(int x, int y, int width, int height, int srcX, int srcY) {
22 | allocate(16);
23 | setHeader(0xA4, x, y, width, height);
24 | buffer.addInt16(srcX);
25 | buffer.addInt16(srcY);
26 | }
27 |
28 | @Override
29 | public void dump() {
30 | System.out.println("CopyOperation");
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/FillOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | import java.awt.Color;
21 |
22 | public class FillOperation extends Operation {
23 | public FillOperation(int x, int y, int width, int height, Color color) {
24 | // System.err.println("Fill Operation: " + x + "," + y + " " + width
25 | // + "x" + height);
26 |
27 | allocate(16);
28 | setHeader(0xA2, x, y, width, height);
29 | buffer.addInt8(0xFF);
30 | buffer.addInt8(color.getBlue());
31 | buffer.addInt8(color.getGreen());
32 | buffer.addInt8(color.getRed());
33 | }
34 |
35 | @Override
36 | public void dump() {
37 | System.out.println("FillOperation");
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/FlushOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Cameron Kaiser
3 | * All rights reserved.
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or (at
8 | * your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful, but
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see
17 | * */
18 |
19 | package org.jopenray.operation;
20 |
21 | public class FlushOperation extends Operation {
22 |
23 | public FlushOperation() {
24 | }
25 |
26 | @Override
27 | public void dump() {
28 | System.out.println("Flush");
29 | }
30 |
31 | @Override
32 | public int getLength() {
33 | return 0;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/GetVersionOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class GetVersionOperation extends Operation {
21 |
22 | public GetVersionOperation(int x, int y, int width, int height) {
23 | allocate(12);
24 | setHeader(0xD8, x, y, width, height);
25 | }
26 |
27 | @Override
28 | public void dump() {
29 | System.out.println("GetVersionOperation");
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/InitOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class InitOperation extends Operation {
21 |
22 | public InitOperation() {
23 | allocate(16);
24 | setHeader(0xA1, 0, 0, 1, 1);
25 | }
26 |
27 | @Override
28 | public void dump() {
29 | System.out.println("InitOperation");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/PadOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class PadOperation extends Operation {
21 |
22 | public PadOperation() {
23 | allocate(24);
24 | setHeader(0xAF, 0, 1, 0xFFFF, 0xFFFF);
25 | for (int i = 0; i < 12; i++) {
26 | buffer.addInt8(0xFF);
27 | }
28 | }
29 |
30 | final public int getSequenceIncrement() {
31 | return 0;
32 | }
33 |
34 | @Override
35 | public void dump() {
36 | System.out.println("PadOperation");
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/RawAudioOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class RawAudioOperation extends Operation {
21 | public RawAudioOperation(int x, byte[] b) {
22 | allocate(12 + b.length);
23 | setHeader(0xB1, x, 2159, 8500, 4102);
24 | buffer.addBytes(b);
25 | }
26 |
27 | @Override
28 | public void dump() {
29 | System.out.println("Audio:" + getHeader());
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/SetBoundsOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class SetBoundsOperation extends Operation {
21 | public SetBoundsOperation(int x, int y, int width, int height) {
22 | allocate(20);
23 | setHeader(0xA8, x, y, width, height);
24 | buffer.addInt16(x);
25 | buffer.addInt16(y);
26 | buffer.addInt16(width);
27 | buffer.addInt16(height);
28 | }
29 |
30 | @Override
31 | public void dump() {
32 | System.out.println("SetBoundsOperation");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/SleepOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | * */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class SleepOperation extends Operation {
21 |
22 | private int ms;
23 |
24 | public SleepOperation(int i) {
25 | this.ms = i;
26 | }
27 |
28 | @Override
29 | public void dump() {
30 | System.out.println("Sleep " + ms + " ms");
31 | }
32 |
33 | public int getSleepTime() {
34 | return ms;
35 | }
36 |
37 | @Override
38 | public int getLength() {
39 | return 0;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/TestOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class TestOperation extends Operation {
21 | public TestOperation() {
22 | allocate(12);
23 | setHeader(0xD1, 0, 0, 0, 0);
24 | }
25 |
26 | @Override
27 | public void dump() {
28 | System.out.println("TestOperation");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/operation/UnknownACOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.operation;
19 |
20 | public class UnknownACOperation extends Operation {
21 |
22 | public UnknownACOperation(int a, int b, int c, int d) {
23 | allocate(20);
24 | setHeader(0xAC, 0, 0, 0, 0);
25 | buffer.addInt16(a);
26 | buffer.addInt16(b);
27 | buffer.addInt16(c);
28 | buffer.addInt16(d);
29 | }
30 |
31 | public UnknownACOperation() {
32 | this(0, 1, 0, 4);
33 | }
34 |
35 | @Override
36 | public void dump() {
37 | System.out.println("UnknownACOperation");
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/Common.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rdp;
2 |
3 | import org.jopenray.rdp.rdp5.Rdp5;
4 |
5 | public class Common {
6 |
7 | public static Rdp5 rdp;
8 | public static Secure secure;
9 | public static MCS mcs;
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/CommunicationMonitor.java:
--------------------------------------------------------------------------------
1 | /* CommunicationMonitor.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.5 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Provide a lock for network communications,
11 | * used primarily by the Clipboard channel to
12 | * prevent sending of mouse/keyboard input when
13 | * sending large amounts of clipboard data.
14 | *
15 | * This program is free software; you can redistribute it and/or modify
16 | * it under the terms of the GNU General Public License as published by
17 | * the Free Software Foundation; either version 2 of the License, or (at
18 | * your option) any later version.
19 | *
20 | * This program is distributed in the hope that it will be useful, but
21 | * WITHOUT ANY WARRANTY; without even the implied warranty of
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 | * General Public License for more details.
24 | *
25 | * You should have received a copy of the GNU General Public License
26 | * along with this program; if not, write to the Free Software
27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 | * USA
29 | *
30 | * (See gpl.txt for details of the GNU General Public License.)
31 | *
32 | */
33 |
34 | package org.jopenray.rdp;
35 |
36 | public class CommunicationMonitor {
37 |
38 | public static Object locker = null;
39 |
40 | /**
41 | * Identify whether or not communications are locked
42 | * @return True if locked
43 | */
44 | public static boolean locked(){
45 | return locker != null;
46 | }
47 |
48 | /**
49 | * Wait for a lock on communications
50 | * @param o Calling object should supply reference to self
51 | */
52 | public static void lock(Object o){
53 | if(locker == null) locker = o;
54 | else{
55 | while(locker != null){
56 | try {
57 | Thread.sleep(100);
58 | } catch (InterruptedException e) {
59 | System.err.println("InterruptedException: " + e.getMessage());
60 | e.printStackTrace();
61 | }
62 | }
63 | }
64 | }
65 |
66 | /**
67 | * Unlock communications, only permitted if the caller holds the current lock
68 | * @param o Calling object should supply reference to self
69 | * @return
70 | */
71 | public static boolean unlock(Object o){
72 | if(locker == o){
73 | locker = null;
74 | return true;
75 | }
76 | return false;
77 | }
78 |
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/ConnectionException.java:
--------------------------------------------------------------------------------
1 | /* ConnectionException.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.4 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 |
31 | package org.jopenray.rdp;
32 |
33 | public class ConnectionException extends Exception {
34 |
35 | public ConnectionException(String message){
36 | super(message);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/Constants.java:
--------------------------------------------------------------------------------
1 | /* Constants.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Stores common constant values
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp;
31 |
32 | public class Constants {
33 |
34 | public static final boolean desktop_save = true;
35 | // public static final int keylayout = 0x809; // UK... was US, 0x409
36 |
37 | public static final boolean SystemExit = true;
38 | public static boolean encryption=true;
39 | public static boolean licence = true;
40 |
41 | public static final int WINDOWS = 1;
42 | public static final int LINUX = 2;
43 | public static final int MAC = 3;
44 |
45 | public static int OS = 0;
46 | }
47 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/DataBlob.java:
--------------------------------------------------------------------------------
1 | /* DataBlob.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Encapsulates Blobs of byte data, of
11 | * arbitrary size (although data cannot
12 | * be changed once set)
13 | *
14 | * This program is free software; you can redistribute it and/or modify
15 | * it under the terms of the GNU General Public License as published by
16 | * the Free Software Foundation; either version 2 of the License, or (at
17 | * your option) any later version.
18 | *
19 | * This program is distributed in the hope that it will be useful, but
20 | * WITHOUT ANY WARRANTY; without even the implied warranty of
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 | * General Public License for more details.
23 | *
24 | * You should have received a copy of the GNU General Public License
25 | * along with this program; if not, write to the Free Software
26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 | * USA
28 | *
29 | * (See gpl.txt for details of the GNU General Public License.)
30 | *
31 | */
32 | package org.jopenray.rdp;
33 |
34 | public class DataBlob {
35 |
36 | private byte[] data = null;
37 | private int size = 0;
38 |
39 | /**
40 | * Construct a DataBlob with a givne size and content.
41 | * Once constructed, the DataBlob cannot be modified
42 | * @param size Size of data
43 | * @param data Array of byte data to store in blob
44 | */
45 | public DataBlob(int size, byte[] data) {
46 | this.size = size;
47 | this.data = data;
48 | }
49 |
50 | /**
51 | * Retrieve size of data stored in this DataBlob
52 | * @return Size of stored data
53 | */
54 | public int getSize() {
55 | return this.size;
56 | }
57 |
58 | /**
59 | * Retrieve data stored in this DataBlob
60 | * @return Stored data
61 | */
62 | public byte[] getData() {
63 | return this.data;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/LicenceStore_Localised.java:
--------------------------------------------------------------------------------
1 | /* LicenceStore_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.4 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.4 specific extension of LicenceStore class
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | // Created on 05-Aug-2003
31 |
32 | package org.jopenray.rdp;
33 |
34 | import java.util.prefs.Preferences;
35 |
36 |
37 | public class LicenceStore_Localised extends LicenceStore {
38 |
39 | public byte[] load_licence(){
40 | Preferences prefs = Preferences.userNodeForPackage(this.getClass());
41 | return prefs.getByteArray("licence."+Options.hostname,null);
42 |
43 | }
44 |
45 | public void save_licence(byte[] databytes){
46 | Preferences prefs = Preferences.userNodeForPackage(this.getClass());
47 | prefs.putByteArray("licence."+Options.hostname, databytes);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/OrderException.java:
--------------------------------------------------------------------------------
1 | /* OrderException.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp;
31 |
32 | public class OrderException extends Exception {
33 |
34 | public OrderException() {
35 | super();
36 | }
37 |
38 | public OrderException(String s) {
39 | super(s);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/RdesktopException.java:
--------------------------------------------------------------------------------
1 | /* RdesktopException.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: General exception class for ProperJavaRDP
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp;
31 |
32 | public class RdesktopException extends Exception {
33 |
34 | public RdesktopException() {
35 | super();
36 | }
37 |
38 | public RdesktopException(String s) {
39 | super(s);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/Utilities_Localised.java:
--------------------------------------------------------------------------------
1 | /* Utilities_Localised.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.2 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Java 1.4 specific extension of Utilities class
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp;
31 |
32 | import java.awt.datatransfer.DataFlavor;
33 | import java.util.StringTokenizer;
34 |
35 | import org.jopenray.rdp.Utilities;
36 |
37 |
38 | public class Utilities_Localised extends Utilities {
39 |
40 | public static DataFlavor imageFlavor = DataFlavor.imageFlavor;
41 |
42 | public static String strReplaceAll(String in, String find, String replace){
43 | return in.replaceAll(find, replace);
44 | }
45 |
46 | public static String[] split(String in, String splitWith){
47 | return in.split(splitWith);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/crypto/CryptoException.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rdp.crypto;
2 |
3 | /**
4 | * This class is for any unexpected exception in the crypto library.
5 | *
6 | * Copyright © 1997
7 | * Systemics Ltd on behalf of the
8 | * Cryptix Development Team.
9 | *
All rights reserved.
10 | *
11 | * $Revision: 1.6 $
12 | * @author David Hopwood
13 | * @since Cryptix 2.2.2
14 | */
15 | public class CryptoException
16 | extends Exception
17 | {
18 | public CryptoException() { super(); }
19 | /** @param reason the reason why the exception was thrown. */
20 | public CryptoException(String reason) { super(reason); }
21 | }
22 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/crypto/Key.java:
--------------------------------------------------------------------------------
1 | /* java.security.Key interface
2 | * This file is in the public domain.
3 | */
4 | package org.jopenray.rdp.crypto;
5 |
6 | import java.io.Serializable;
7 |
8 | public interface Key extends Serializable {
9 | static long serialVersionUID = 6603384152749567654l;
10 |
11 | String getAlgorithm();
12 |
13 | byte[] getEncoded();
14 |
15 | String getFormat();
16 | }
17 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/keymapping/KeyMapException.java:
--------------------------------------------------------------------------------
1 | /* KeyMapException.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.4 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:39 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: General exception for keymapping operations
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.keymapping;
31 | /*
32 | * Created on 20-Apr-2005
33 | *
34 | * TODO To change the template for this generated file go to
35 | * Window - Preferences - Java - Code Style - Code Templates
36 | */
37 |
38 | /**
39 | * @author Tom Elliott
40 | *
41 | * TODO To change the template for this generated type comment go to
42 | * Window - Preferences - Java - Code Style - Code Templates
43 | */
44 | public class KeyMapException extends Exception {
45 |
46 | public KeyMapException(String s){
47 | super(s);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/BoundsOrder.java:
--------------------------------------------------------------------------------
1 | /* BoundsOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class BoundsOrder implements Order {
33 |
34 | private int left = 0;
35 | private int right = 0;
36 | private int top = 0;
37 | private int bottom = 0;
38 |
39 | public BoundsOrder() {
40 | }
41 |
42 | public int getLeft() {
43 | return this.left;
44 | }
45 |
46 | public int getRight() {
47 | return this.right;
48 | }
49 |
50 | public int getTop() {
51 | return this.top;
52 | }
53 |
54 | public int getBottom() {
55 | return this.bottom;
56 | }
57 |
58 | public void setLeft(int left) {
59 | this.left = left;
60 | }
61 |
62 | public void setRight(int right) {
63 | this.right = right;
64 | }
65 |
66 | public void setTop(int top) {
67 | this.top = top;
68 | }
69 |
70 | public void setBottom(int bottom) {
71 | this.bottom = bottom;
72 | }
73 |
74 | public void reset() {
75 | left = 0;
76 | right = 0;
77 | top = 0;
78 | bottom = 0;
79 | }
80 | }
81 |
82 |
83 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/Brush.java:
--------------------------------------------------------------------------------
1 | /* Brush.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class Brush {
33 |
34 | private int xorigin = 0;
35 | private int yorigin = 0;
36 | private int style = 0;
37 | private byte[] pattern = new byte[8];
38 |
39 | public Brush() {
40 | }
41 |
42 | public int getXOrigin() {
43 | return this.xorigin;
44 | }
45 |
46 | public int getYOrigin() {
47 | return this.yorigin;
48 | }
49 |
50 | public int getStyle() {
51 | return this.style;
52 | }
53 |
54 | public byte[] getPattern(){
55 | return this.pattern;
56 | }
57 |
58 | public void setXOrigin(int xorigin) {
59 | this.xorigin = xorigin;
60 | }
61 |
62 | public void setYOrigin(int yorigin) {
63 | this.yorigin = yorigin;
64 | }
65 |
66 | public void setStyle(int style) {
67 | this.style = style;
68 | }
69 |
70 | public void setPattern(byte[] pattern){
71 | this.pattern = pattern;
72 | }
73 |
74 | public void reset() {
75 | xorigin = 0;
76 | yorigin = 0;
77 | style = 0;
78 | pattern = new byte[8];
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/DeskSaveOrder.java:
--------------------------------------------------------------------------------
1 | /* DeskSaveOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class DeskSaveOrder extends BoundsOrder {
33 |
34 | private int offset = 0;
35 | private int action = 0;
36 |
37 | public DeskSaveOrder() {
38 | super();
39 | }
40 |
41 | public int getOffset() {
42 | return this.offset;
43 | }
44 |
45 | public int getAction() {
46 | return this.action;
47 | }
48 |
49 | public void setOffset(int offset) {
50 | this.offset = offset;
51 | }
52 |
53 | public void setAction(int action) {
54 | this.action = action;
55 | }
56 |
57 | public void reset() {
58 | super.reset();
59 | offset = 0;
60 | action = 0;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/DestBltOrder.java:
--------------------------------------------------------------------------------
1 | /* DestBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class DestBltOrder implements Order {
33 |
34 | private int x = 0;
35 | private int y = 0;
36 | private int cx = 0;
37 | private int cy = 0;
38 | private int opcode = 0;
39 |
40 | public DestBltOrder() {
41 | }
42 |
43 | public int getX() {
44 | return this.x;
45 | }
46 |
47 | public int getY() {
48 | return this.y;
49 | }
50 |
51 | public int getCX() {
52 | return this.cx;
53 | }
54 |
55 | public int getCY() {
56 | return this.cy;
57 | }
58 |
59 | public int getOpcode() {
60 | return this.opcode;
61 | }
62 |
63 | public void setX(int x) {
64 | this.x = x;
65 | }
66 |
67 | public void setY(int y) {
68 | this.y = y;
69 | }
70 |
71 | public void setCX(int cx) {
72 | this.cx = cx;
73 | }
74 |
75 | public void setCY(int cy) {
76 | this.cy = cy;
77 | }
78 |
79 | public void setOpcode(int opcode) {
80 | this.opcode = opcode;
81 | }
82 |
83 | public void reset() {
84 | x = 0;
85 | y = 0;
86 | cx = 0;
87 | cy = 0;
88 | opcode = 0;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/MemBltOrder.java:
--------------------------------------------------------------------------------
1 | /* MemBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class MemBltOrder extends ScreenBltOrder {
33 |
34 | private int color_table = 0;
35 | private int cache_id = 0;
36 | private int cache_idx = 0;
37 |
38 | public MemBltOrder() {
39 | super();
40 | }
41 |
42 | public int getColorTable(){
43 | return this.color_table;
44 | }
45 |
46 | public int getCacheID() {
47 | return this.cache_id;
48 | }
49 |
50 | public int getCacheIDX() {
51 | return this.cache_idx;
52 | }
53 |
54 | public void setColorTable(int color_table) {
55 | this.color_table = color_table;
56 | }
57 |
58 | public void setCacheID(int cache_id) {
59 | this.cache_id = cache_id;
60 | }
61 |
62 | public void setCacheIDX(int cache_idx) {
63 | this.cache_idx = cache_idx;
64 | }
65 |
66 | public void reset() {
67 | super.reset();
68 | color_table = 0;
69 | cache_id = 0;
70 | cache_idx = 0;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/Order.java:
--------------------------------------------------------------------------------
1 | /* Order.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public interface Order {
33 | }
34 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/PatBltOrder.java:
--------------------------------------------------------------------------------
1 | /* PatBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class PatBltOrder extends DestBltOrder {
33 |
34 | private int bgcolor = 0;
35 | private int fgcolor = 0;
36 | private Brush brush = null;
37 |
38 | public PatBltOrder() {
39 | super();
40 | brush = new Brush();
41 | }
42 |
43 | public int getBackgroundColor() {
44 | return this.bgcolor;
45 | }
46 |
47 | public int getForegroundColor() {
48 | return this.fgcolor;
49 | }
50 |
51 | public Brush getBrush(){
52 | return this.brush;
53 | }
54 |
55 | public void setBackgroundColor(int bgcolor) {
56 | this.bgcolor = bgcolor;
57 | }
58 |
59 | public void setForegroundColor(int fgcolor) {
60 | this.fgcolor = fgcolor;
61 | }
62 |
63 | public void reset() {
64 | super.reset();
65 | bgcolor = 0;
66 | fgcolor = 0;
67 | brush.reset();
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/Pen.java:
--------------------------------------------------------------------------------
1 | /* Pen.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class Pen {
33 |
34 | private int style = 0;
35 | private int width = 0;
36 | private int color = 0;
37 |
38 | public Pen() {
39 | }
40 |
41 | public int getStyle() {
42 | return this.style;
43 | }
44 |
45 | public int getWidth() {
46 | return this.width;
47 | }
48 |
49 | public int getColor() {
50 | return this.color;
51 | }
52 |
53 | public void setStyle(int style) {
54 | this.style = style;
55 | }
56 |
57 | public void setWidth(int width) {
58 | this.width = width;
59 | }
60 |
61 | public void setColor(int color) {
62 | this.color = color;
63 | }
64 |
65 | public void reset() {
66 | style = 0;
67 | width = 0;
68 | color = 0;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/RectangleOrder.java:
--------------------------------------------------------------------------------
1 | /* RectangleOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class RectangleOrder implements Order {
33 |
34 | private int x = 0;
35 | private int y = 0;
36 | private int cx = 0;
37 | private int cy = 0;
38 | public int color = 0;
39 |
40 | public RectangleOrder() {
41 | }
42 |
43 | public int getX() {
44 | return this.x;
45 | }
46 |
47 | public int getY() {
48 | return this.y;
49 | }
50 |
51 | public int getCX() {
52 | return this.cx;
53 | }
54 |
55 | public int getCY() {
56 | return this.cy;
57 | }
58 |
59 | public int getColor() {
60 | return this.color;
61 | }
62 |
63 | public void setX(int x) {
64 | this.x = x;
65 | }
66 |
67 | public void setY(int y) {
68 | this.y = y;
69 | }
70 |
71 | public void setCX(int cx) {
72 | this.cx = cx;
73 | }
74 |
75 | public void setCY(int cy) {
76 | this.cy = cy;
77 | }
78 |
79 | public void setColor(int color) {
80 | this.color = color;
81 | }
82 |
83 | public void reset() {
84 | x = 0;
85 | y = 0;
86 | cx = 0;
87 | cy = 0;
88 | color = 0;
89 | }
90 | }
91 |
92 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/orders/ScreenBltOrder.java:
--------------------------------------------------------------------------------
1 | /* ScreenBltOrder.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.7 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.orders;
31 |
32 | public class ScreenBltOrder extends DestBltOrder {
33 |
34 | private int srcx = 0;
35 | private int srcy = 0;
36 |
37 | public ScreenBltOrder() {
38 | super();
39 | }
40 |
41 | public int getSrcX() {
42 | return this.srcx;
43 | }
44 |
45 | public int getSrcY() {
46 | return this.srcy;
47 | }
48 |
49 | public void setSrcX(int srcx) {
50 | this.srcx = srcx;
51 | }
52 |
53 | public void setSrcY(int srcy) {
54 | this.srcy = srcy;
55 | }
56 |
57 | public void reset() {
58 | super.reset();
59 | srcx = 0;
60 | srcy = 0;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/rdp5/TestChannel.java:
--------------------------------------------------------------------------------
1 | /* TestChannel.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.3 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/26 10:01:01 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose: Dummy RDP5 channel for testing purposes
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.rdp5;
31 |
32 | import org.jopenray.rdp.RdpPacket;
33 |
34 | /**
35 | * @author Tom Elliott
36 | *
37 | * TODO To change the template for this generated type comment go to
38 | * Window - Preferences - Java - Code Style - Code Templates
39 | */
40 | public class TestChannel extends VChannel {
41 |
42 | public TestChannel(String name, int flags){
43 | this.name = name;
44 | this.flags = flags;
45 | }
46 |
47 | private String name;
48 | private int flags;
49 |
50 | public String name() {
51 | return name;
52 | }
53 |
54 | public int flags() {
55 | return flags;
56 | }
57 |
58 | public void process(RdpPacket data) {
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/rdp5/cliprdr/BMPToImageThread.java:
--------------------------------------------------------------------------------
1 | /* BMPToImageThread.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.4 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.rdp5.cliprdr;
31 |
32 | import java.awt.Image;
33 | import java.io.ByteArrayInputStream;
34 | import java.io.OutputStream;
35 |
36 | import org.jopenray.rdp.RdpPacket;
37 |
38 | public class BMPToImageThread extends Thread {
39 |
40 | RdpPacket data; int length; ClipInterface c;
41 |
42 | public BMPToImageThread(RdpPacket data, int length, ClipInterface c){
43 | super();
44 | this.data = data;
45 | this.length = length;
46 | this.c = c;
47 | }
48 |
49 | public void run(){
50 | String thingy = "";
51 | OutputStream out = null;
52 |
53 | int origin = data.getPosition();
54 |
55 | int head_len = data.getLittleEndian32();
56 |
57 | data.setPosition(origin);
58 |
59 | byte[] content = new byte[length];
60 |
61 | for(int i = 0; i < length; i++){
62 | content[i] = (byte) (data.get8() & 0xFF);
63 | }
64 |
65 | Image img = ClipBMP.loadbitmap(new ByteArrayInputStream(content));
66 | ImageSelection imageSelection = new ImageSelection(img);
67 | c.copyToClipboard(imageSelection);
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rdp/rdp5/cliprdr/ClipInterface.java:
--------------------------------------------------------------------------------
1 | /* ClipInterface.java
2 | * Component: ProperJavaRDP
3 | *
4 | * Revision: $Revision: 1.4 $
5 | * Author: $Author: telliott $
6 | * Date: $Date: 2005/09/27 14:15:40 $
7 | *
8 | * Copyright (c) 2005 Propero Limited
9 | *
10 | * Purpose:
11 | *
12 | * This program is free software; you can redistribute it and/or modify
13 | * it under the terms of the GNU General Public License as published by
14 | * the Free Software Foundation; either version 2 of the License, or (at
15 | * your option) any later version.
16 | *
17 | * This program is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | * General Public License for more details.
21 | *
22 | * You should have received a copy of the GNU General Public License
23 | * along with this program; if not, write to the Free Software
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 | * USA
26 | *
27 | * (See gpl.txt for details of the GNU General Public License.)
28 | *
29 | */
30 | package org.jopenray.rdp.rdp5.cliprdr;
31 |
32 | import java.awt.datatransfer.Transferable;
33 |
34 | public interface ClipInterface {
35 |
36 | public void copyToClipboard(Transferable t);
37 | public void send_data(byte []data, int length);
38 | public void send_null(int type, int status);
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rfb/CapabilityInfo.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rfb;
2 |
3 | //
4 | // Copyright (C) 2003 Constantin Kaplinsky. All Rights Reserved.
5 | //
6 | // This is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This software is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this software; if not, write to the Free Software
18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 | // USA.
20 | //
21 |
22 | //
23 | // CapabilityInfo.java - A class to hold information about a
24 | // particular capability as used in the RFB protocol 3.130.
25 | //
26 |
27 | class CapabilityInfo {
28 |
29 | // Public methods
30 |
31 | public CapabilityInfo(int code, String vendorSignature,
32 | String nameSignature, String description) {
33 | this.code = code;
34 | this.vendorSignature = vendorSignature;
35 | this.nameSignature = nameSignature;
36 | this.description = description;
37 | enabled = false;
38 | }
39 |
40 | public CapabilityInfo(int code, byte[] vendorSignature, byte[] nameSignature) {
41 | this.code = code;
42 | this.vendorSignature = new String(vendorSignature);
43 | this.nameSignature = new String(nameSignature);
44 | this.description = null;
45 | enabled = false;
46 | }
47 |
48 | public int getCode() {
49 | return code;
50 | }
51 |
52 | public String getDescription() {
53 | return description;
54 | }
55 |
56 | public boolean isEnabled() {
57 | return enabled;
58 | }
59 |
60 | public void enable() {
61 | enabled = true;
62 | }
63 |
64 | public boolean equals(CapabilityInfo other) {
65 | return (other != null && this.code == other.code
66 | && this.vendorSignature.equals(other.vendorSignature) && this.nameSignature
67 | .equals(other.nameSignature));
68 | }
69 |
70 | public boolean enableIfEquals(CapabilityInfo other) {
71 | if (this.equals(other))
72 | enable();
73 |
74 | return isEnabled();
75 | }
76 |
77 | // Protected data
78 |
79 | protected int code;
80 | protected String vendorSignature;
81 | protected String nameSignature;
82 |
83 | protected String description;
84 | protected boolean enabled;
85 | }
86 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rfb/HTTPConnectSocket.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rfb;
2 |
3 | //
4 | // Copyright (C) 2019 Cameron Kaiser. All rights reserved.
5 | // Copyright (C) 2002 Constantin Kaplinsky, Inc. All Rights Reserved.
6 | //
7 | // This is free software; you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation; either version 2 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This software is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this software; if not, write to the Free Software
19 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20 | // USA.
21 | //
22 |
23 | //
24 | // HTTPConnectSocket.java together with HTTPConnectSocketFactory.java
25 | // implement an alternate way to connect to VNC servers via one or two
26 | // HTTP proxies supporting the HTTP CONNECT method.
27 | //
28 |
29 | import java.io.InputStreamReader;
30 | import java.io.DataInputStream;
31 | import java.io.BufferedReader;
32 | import java.io.IOException;
33 | import java.net.Socket;
34 |
35 | class HTTPConnectSocket extends Socket {
36 |
37 | public HTTPConnectSocket(String host, int port, String proxyHost,
38 | int proxyPort) throws IOException {
39 |
40 | // Connect to the specified HTTP proxy
41 | super(proxyHost, proxyPort);
42 |
43 | // Send the CONNECT request
44 | getOutputStream().write(
45 | ("CONNECT " + host + ":" + port + " HTTP/1.0\r\n\r\n")
46 | .getBytes());
47 |
48 | // Read the first line of the response
49 | /*
50 | // Deprecated
51 | DataInputStream is = new DataInputStream(getInputStream());
52 | */
53 | BufferedReader is = new BufferedReader(
54 | new InputStreamReader(getInputStream()));
55 | String str = is.readLine();
56 |
57 | // Check the HTTP error code -- it should be "200" on success
58 | if (!str.startsWith("HTTP/1.0 200 ")) {
59 | if (str.startsWith("HTTP/1.0 "))
60 | str = str.substring(9);
61 | throw new IOException("Proxy reports \"" + str + "\"");
62 | }
63 |
64 | // Success -- skip remaining HTTP headers
65 | do {
66 | str = is.readLine();
67 | } while (str.length() != 0);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rfb/MemInStream.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rfb;
2 |
3 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
4 | *
5 | * This is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This software is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this software; if not, write to the Free Software
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 | * USA.
19 | */
20 |
21 | public class MemInStream extends InStream {
22 |
23 | public MemInStream(byte[] data, int offset, int len) {
24 | b = data;
25 | ptr = offset;
26 | end = offset + len;
27 | }
28 |
29 | public int pos() {
30 | return ptr;
31 | }
32 |
33 | protected int overrun(int itemSize, int nItems) throws Exception {
34 | throw new Exception("MemInStream overrun: end of stream");
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rfb/ReloginPanel.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rfb;
2 |
3 | //
4 | // Copyright (C) 2002 Cendio Systems. All Rights Reserved.
5 | // Copyright (C) 2002 Constantin Kaplinsky. All Rights Reserved.
6 | //
7 | // This is free software; you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation; either version 2 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This software is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this software; if not, write to the Free Software
19 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20 | // USA.
21 | //
22 |
23 | //
24 | // ReloginPanel class implements panel with a button for logging in again,
25 | // after fatal errors or disconnect
26 | //
27 |
28 | import java.awt.Button;
29 | import java.awt.FlowLayout;
30 | import java.awt.Panel;
31 | import java.awt.event.ActionEvent;
32 | import java.awt.event.ActionListener;
33 |
34 | //
35 | // The panel which implements the Relogin button
36 | //
37 |
38 | class ReloginPanel extends Panel implements ActionListener {
39 | Button reloginButton;
40 | Button closeButton;
41 | VncViewer viewer;
42 |
43 | //
44 | // Constructor.
45 | //
46 | public ReloginPanel(VncViewer v) {
47 | viewer = v;
48 | setLayout(new FlowLayout(FlowLayout.CENTER));
49 | reloginButton = new Button("Login again");
50 | add(reloginButton);
51 | reloginButton.addActionListener(this);
52 | if (viewer.inSeparateFrame) {
53 | closeButton = new Button("Close window");
54 | add(closeButton);
55 | closeButton.addActionListener(this);
56 | }
57 | }
58 |
59 | //
60 | // This method is called when a button is pressed.
61 | //
62 | public synchronized void actionPerformed(ActionEvent evt) {
63 | if (viewer.inSeparateFrame)
64 | viewer.vncFrame.dispose();
65 | if (evt.getSource() == reloginButton)
66 | viewer.getAppletContext().showDocument(viewer.getDocumentBase());
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/rfb/SocketFactory.java:
--------------------------------------------------------------------------------
1 | package org.jopenray.rfb;
2 |
3 | //
4 | // Copyright (C) 2002 HorizonLive.com, Inc. All Rights Reserved.
5 | //
6 | // This is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This software is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this software; if not, write to the Free Software
18 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 | // USA.
20 | //
21 |
22 | //
23 | // SocketFactory.java describes an interface used to substitute the
24 | // standard Socket class by its alternative implementations.
25 | //
26 |
27 | import java.applet.Applet;
28 | import java.io.IOException;
29 | import java.net.Socket;
30 |
31 | public interface SocketFactory {
32 |
33 | public Socket createSocket(String host, int port, Applet applet)
34 | throws IOException;
35 |
36 | public Socket createSocket(String host, int port, String[] args)
37 | throws IOException;
38 | }
39 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/src/org/jopenray/server/card.png
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/card/Card.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.card;
19 |
20 | import java.util.Date;
21 |
22 | public class Card {
23 | private final String id;
24 | private String name;
25 | private String type;
26 | private Date expirationDate; // null if never expire
27 | private boolean isEnabled;
28 |
29 | public Card(String id, String type) {
30 | this.id = id;
31 | this.type = type;
32 | this.name = id;
33 | expirationDate = null;
34 | isEnabled = true;
35 | }
36 |
37 | public String getId() {
38 | return id;
39 | }
40 |
41 | public String getType() {
42 | return type;
43 | }
44 |
45 | public String getName() {
46 | return name;
47 | }
48 |
49 | public void setName(String name) {
50 | this.name = name;
51 | }
52 |
53 | public Date getExpirationDate() {
54 | return expirationDate;
55 | }
56 |
57 | public void setExpirationDate(Date expirationDate) {
58 | this.expirationDate = expirationDate;
59 | }
60 |
61 | public boolean isEnabled() {
62 | return isEnabled;
63 | }
64 |
65 | public void setEnabled(boolean isEnabled) {
66 | this.isEnabled = isEnabled;
67 | }
68 |
69 | @Override
70 | public boolean equals(Object obj) {
71 | if (obj instanceof Card) {
72 | Card c = (Card) obj;
73 | return this.id.equals(c.id) && this.type.equals(c.type);
74 | }
75 | return super.equals(obj);
76 | }
77 |
78 | @Override
79 | public String toString() {
80 | return "Card:" + this.name + "[" + this.type + " " + this.id + "]";
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/card/CardManagerListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.card;
19 |
20 | public interface CardManagerListener {
21 |
22 | void cardListUpdated();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/card/CardPropertiesTableModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.card;
19 |
20 | import java.beans.PropertyChangeEvent;
21 | import java.beans.PropertyChangeListener;
22 |
23 | import javax.swing.event.TableModelListener;
24 | import javax.swing.table.AbstractTableModel;
25 | import javax.swing.table.DefaultTableModel;
26 | import javax.swing.table.TableModel;
27 |
28 | import org.jopenray.server.thinclient.ThinClient;
29 |
30 | public class CardPropertiesTableModel extends AbstractTableModel implements
31 | PropertyChangeListener {
32 | ThinClient c;
33 |
34 | public CardPropertiesTableModel(ThinClient c) {
35 | if (c == null) {
36 | throw new IllegalArgumentException("DisplayClient null");
37 | }
38 | this.c = c;
39 | this.c.addPropertyChangeListeneer(this);
40 | }
41 |
42 | /**
43 | *
44 | */
45 | private static final long serialVersionUID = -4707314332094004994L;
46 |
47 | @Override
48 | public Class> getColumnClass(int columnIndex) {
49 | return String.class;
50 | }
51 |
52 | @Override
53 | public int getColumnCount() {
54 | return 2;
55 | }
56 |
57 | @Override
58 | public String getColumnName(int columnIndex) {
59 | if (columnIndex == 0) {
60 | return "Name";
61 | }
62 | return "Value";
63 | }
64 |
65 | @Override
66 | public int getRowCount() {
67 | return c.getPropertyCount();
68 | }
69 |
70 | @Override
71 | public Object getValueAt(int rowIndex, int columnIndex) {
72 | if (columnIndex == 0) {
73 | return c.getPropertyName(rowIndex);
74 | }
75 | return c.getPropertyValue(rowIndex);
76 | }
77 |
78 | @Override
79 | public void propertyChange(PropertyChangeEvent evt) {
80 | this.fireTableDataChanged();
81 |
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/card/CardTableModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.card;
19 |
20 | import javax.swing.JTable;
21 | import javax.swing.table.AbstractTableModel;
22 |
23 | public class CardTableModel extends AbstractTableModel implements
24 | CardManagerListener {
25 |
26 | private static final long serialVersionUID = -564688414777763911L;
27 | private JTable table;
28 |
29 | CardTableModel() {
30 | CardManager.getInstance().addListUpdatedListener(this);
31 | }
32 |
33 | @Override
34 | public Class> getColumnClass(int columnIndex) {
35 | return String.class;
36 | }
37 |
38 | @Override
39 | public int getColumnCount() {
40 | return 1;
41 | }
42 |
43 | @Override
44 | public String getColumnName(int columnIndex) {
45 | return "Registered cards";
46 | }
47 |
48 | @Override
49 | public int getRowCount() {
50 | return CardManager.getInstance().getCardCount();
51 | }
52 |
53 | @Override
54 | public Object getValueAt(int rowIndex, int columnIndex) {
55 | return CardManager.getInstance().getCard(rowIndex);
56 | }
57 |
58 | @Override
59 | public void cardListUpdated() {
60 | int selectedRow = this.table.getSelectedRow();
61 | Card c = null;
62 | if (selectedRow >= 0) {
63 | c = this.getCard(selectedRow);
64 | }
65 | this.fireTableDataChanged();
66 | if (c != null) {
67 | for (int i = 0; i < this.getRowCount(); i++) {
68 | if (this.getCard(i).equals(c)) {
69 | table.getSelectionModel().setSelectionInterval(i, i);
70 | }
71 |
72 | }
73 | }
74 | }
75 |
76 | public Card getCard(int rowIndex) {
77 | return CardManager.getInstance().getCard(rowIndex);
78 |
79 | }
80 |
81 | public void setTable(JTable t) {
82 | this.table = t;
83 |
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/card_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/src/org/jopenray/server/card_red.png
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/event/Event.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.event;
19 |
20 | public class Event {
21 | public static final int TYPE_INFO = 0;
22 | public static final int TYPE_WARNING = 1;
23 | public static final int TYPE_ERROR = 2;
24 |
25 | private final int type;
26 | private final String title;
27 | private final String description;
28 | private final long date;
29 |
30 | public Event(String title, String desc, int type) {
31 | this.title = title;
32 | this.description = desc;
33 | this.type = type;
34 | this.date = System.currentTimeMillis();
35 | }
36 |
37 | public int getType() {
38 | return type;
39 | }
40 |
41 | public String getTitle() {
42 | return title;
43 | }
44 |
45 | public String getDescription() {
46 | return description;
47 | }
48 |
49 | public long getDate() {
50 | return date;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/event/EventListPanel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.event;
19 |
20 | import java.awt.GridLayout;
21 |
22 | import javax.swing.JPanel;
23 | import javax.swing.JScrollPane;
24 | import javax.swing.JTable;
25 |
26 | public class EventListPanel extends JPanel {
27 | /**
28 | *
29 | */
30 | private static final long serialVersionUID = -7916216374361693711L;
31 |
32 | public EventListPanel() {
33 | final EventTableModel dm = new EventTableModel();
34 | JTable t = new JTable(dm);
35 |
36 | this.setLayout(new GridLayout(1, 1));
37 | this.add(new JScrollPane(t));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/event/EventManagerListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.event;
19 |
20 | public interface EventManagerListener {
21 |
22 | public void eventListUpdated();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/src/org/jopenray/server/logo.png
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/session/CardComboBoxModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.session;
19 |
20 | import javax.swing.AbstractListModel;
21 | import javax.swing.ComboBoxModel;
22 |
23 | import org.jopenray.server.card.CardManager;
24 | import org.jopenray.server.card.CardManagerListener;
25 |
26 | public class CardComboBoxModel extends AbstractListModel implements
27 | ComboBoxModel, CardManagerListener {
28 | /**
29 | *
30 | */
31 | private static final long serialVersionUID = 4031486954747080284L;
32 | private Object selectedObject;
33 |
34 | CardComboBoxModel() {
35 | CardManager.getInstance().addListUpdatedListener(this);
36 | }
37 |
38 | public void setSelectedItem(Object anObject) {
39 | if ((selectedObject != null && !selectedObject.equals(anObject))
40 | || selectedObject == null && anObject != null) {
41 | selectedObject = anObject;
42 | fireContentsChanged(this, -1, -1);
43 | }
44 | }
45 |
46 | // implements javax.swing.ComboBoxModel
47 | public Object getSelectedItem() {
48 | return selectedObject;
49 | }
50 |
51 | @Override
52 | public Object getElementAt(int index) {
53 | return CardManager.getInstance().getCard(index);
54 | }
55 |
56 | @Override
57 | public int getSize() {
58 | return CardManager.getInstance().getCardCount();
59 | }
60 |
61 | @Override
62 | public void cardListUpdated() {
63 | fireContentsChanged(this, -1, -1);
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/session/CardListCellRenderer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.session;
19 |
20 | import java.awt.Component;
21 |
22 | import javax.swing.DefaultListCellRenderer;
23 | import javax.swing.JList;
24 |
25 | import org.jopenray.server.card.Card;
26 |
27 | public class CardListCellRenderer extends DefaultListCellRenderer {
28 | /**
29 | *
30 | */
31 | private static final long serialVersionUID = -1310283362770645032L;
32 |
33 | public Component getListCellRendererComponent(JList list, Object value,
34 | int index, boolean isSelected, boolean cellHasFocus) {
35 | if (value instanceof Card) {
36 | value = ((Card) value).getName();
37 | }
38 | return super.getListCellRendererComponent(list, value, index,
39 | isSelected, cellHasFocus);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/session/CardSessionListModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.session;
19 |
20 | import java.util.List;
21 |
22 | import javax.swing.AbstractListModel;
23 | import javax.swing.ListModel;
24 |
25 | import org.jopenray.server.card.Card;
26 |
27 | public class CardSessionListModel extends AbstractListModel implements
28 | ListModel, SessionManagerListener {
29 | /**
30 | *
31 | */
32 | private static final long serialVersionUID = -2357465461187203953L;
33 | private Session session;
34 | private List cards;
35 |
36 | public CardSessionListModel(Session session) {
37 | this.session = session;
38 | cards = session.getAllowedCards();
39 | SessionManager.getInstance().addListUpdatedListener(this);
40 | }
41 |
42 | @Override
43 | public Object getElementAt(int index) {
44 | return cards.get(index);
45 | }
46 |
47 | @Override
48 | public int getSize() {
49 | return cards.size();
50 | }
51 |
52 | @Override
53 | public void sessionListUpdated() {
54 | cards = session.getAllowedCards();
55 | fireContentsChanged(this, 0, cards.size());
56 |
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/session/SessionManagerListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.session;
19 |
20 | public interface SessionManagerListener {
21 |
22 | void sessionListUpdated();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/thinclient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/src/org/jopenray/server/thinclient.png
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/thinclient/ClientPropertiesTableModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.thinclient;
19 |
20 | import java.beans.PropertyChangeEvent;
21 | import java.beans.PropertyChangeListener;
22 |
23 | import javax.swing.table.AbstractTableModel;
24 |
25 | public class ClientPropertiesTableModel extends AbstractTableModel implements
26 | PropertyChangeListener {
27 | ThinClient c;
28 |
29 | public ClientPropertiesTableModel(ThinClient c) {
30 | if (c == null) {
31 | throw new IllegalArgumentException("DisplayClient null");
32 | }
33 | this.c = c;
34 | this.c.addPropertyChangeListeneer(this);
35 | }
36 |
37 | /**
38 | *
39 | */
40 | private static final long serialVersionUID = -4707314332094004994L;
41 |
42 | @Override
43 | public Class> getColumnClass(int columnIndex) {
44 | return String.class;
45 | }
46 |
47 | @Override
48 | public int getColumnCount() {
49 | return 2;
50 | }
51 |
52 | @Override
53 | public String getColumnName(int columnIndex) {
54 | if (columnIndex == 0) {
55 | return "Name";
56 | }
57 | return "Value";
58 | }
59 |
60 | @Override
61 | public int getRowCount() {
62 | return c.getPropertyCount();
63 | }
64 |
65 | @Override
66 | public Object getValueAt(int rowIndex, int columnIndex) {
67 |
68 | if (columnIndex == 0) {
69 | return c.getPropertyName(rowIndex);
70 | }
71 | return c.getPropertyValue(rowIndex);
72 | }
73 |
74 | @Override
75 | public void propertyChange(PropertyChangeEvent evt) {
76 | this.fireTableDataChanged();
77 |
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/thinclient/ClientTableModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.thinclient;
19 |
20 | import javax.swing.JTable;
21 | import javax.swing.table.AbstractTableModel;
22 |
23 | public class ClientTableModel extends AbstractTableModel implements
24 | ThinClientManagerListener {
25 | /**
26 | *
27 | */
28 | private static final long serialVersionUID = 6784201841899339306L;
29 | private JTable table;
30 |
31 | ClientTableModel() {
32 | ThinClientManager.getInstance().addListUpdatedListener(this);
33 | }
34 |
35 | @Override
36 | public Class> getColumnClass(int columnIndex) {
37 | return String.class;
38 | }
39 |
40 | @Override
41 | public int getColumnCount() {
42 | return 1;
43 | }
44 |
45 | @Override
46 | public String getColumnName(int columnIndex) {
47 | return "Client";
48 | }
49 |
50 | @Override
51 | public int getRowCount() {
52 | return ThinClientManager.getInstance().getClientCount();
53 | }
54 |
55 | @Override
56 | public Object getValueAt(int rowIndex, int columnIndex) {
57 | return ThinClientManager.getInstance().getClient(rowIndex).getName();
58 | }
59 |
60 | @Override
61 | public void clientListUpdated() {
62 | int selectedRow = this.table.getSelectedRow();
63 | ThinClient c = null;
64 | if (selectedRow >= 0) {
65 | c = this.getClient(selectedRow);
66 | }
67 | this.fireTableDataChanged();
68 | if (c != null) {
69 | for (int i = 0; i < this.getRowCount(); i++) {
70 | if (this.getClient(i).equals(c)) {
71 | table.getSelectionModel().setSelectionInterval(i, i);
72 | }
73 |
74 | }
75 | }
76 | }
77 |
78 | public ThinClient getClient(int rowIndex) {
79 | return ThinClientManager.getInstance().getClient(rowIndex);
80 |
81 | }
82 |
83 | public void setTable(JTable t) {
84 | this.table = t;
85 |
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/thinclient/InputListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.thinclient;
19 |
20 | public interface InputListener {
21 |
22 | public void mouseReleased(int button, int mouseX, int mouseY);
23 |
24 | public void mousePressed(int button, int mouseX, int mouseY);
25 |
26 | public void mouseMoved(int mouseX, int mouseY);
27 |
28 | public void mouseWheelUp(int mouseX, int mouseY);
29 |
30 | public void mouseWheelDown(int mouseX, int mouseY);
31 |
32 | public void keyPressed(int key, boolean shift, boolean ctrl, boolean alt,
33 | boolean meta, boolean altGr);
34 |
35 | public void keyReleased(int key);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/thinclient/ThinClientManagerListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.thinclient;
19 |
20 | public interface ThinClientManagerListener {
21 |
22 | public void clientListUpdated();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/user/User.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.user;
19 |
20 | import java.util.ArrayList;
21 | import java.util.List;
22 |
23 | import org.jopenray.server.card.Card;
24 |
25 | public class User {
26 |
27 | private String firstName;
28 | private String lastName;
29 | private final List cards = new ArrayList();
30 | private int id;
31 | private static int nextId = 0;
32 |
33 | public User(String firstName, String lastName) {
34 | this.firstName = firstName;
35 | this.lastName = lastName;
36 | this.id = nextId;
37 | nextId++;
38 | }
39 |
40 | public User(int userId, String firstName, String lastName) {
41 | this.id = userId;
42 | this.firstName = firstName;
43 | this.lastName = lastName;
44 | if (id >= nextId) {
45 | nextId = id + 1;
46 | }
47 | }
48 |
49 | public void setId(int id) {
50 | this.id = id;
51 | }
52 |
53 | public int getId() {
54 | return id;
55 | }
56 |
57 | @Override
58 | public boolean equals(Object obj) {
59 | if (obj instanceof User) {
60 | User u = (User) obj;
61 | return u.id == this.id;
62 | }
63 | return super.equals(obj);
64 | }
65 |
66 | public String getFirstName() {
67 | return firstName;
68 | }
69 |
70 | public String getLastName() {
71 | return lastName;
72 | }
73 |
74 | public String getName() {
75 |
76 | return this.getFirstName() + " " + this.getLastName();
77 | }
78 |
79 | public void setFirstName(String text) {
80 | text = text.trim();
81 |
82 | }
83 |
84 | public void setLastName(String text) {
85 | text = text.trim();
86 |
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/user/UserManagerListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.user;
19 |
20 | public interface UserManagerListener {
21 |
22 | void userListUpdated();
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/server/user/UserTableModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.server.user;
19 |
20 | import javax.swing.JTable;
21 | import javax.swing.table.AbstractTableModel;
22 |
23 | public class UserTableModel extends AbstractTableModel implements
24 | UserManagerListener {
25 |
26 | private static final long serialVersionUID = -564688414777763911L;
27 | private JTable table;
28 |
29 | public UserTableModel() {
30 | UserManager.getInstance().addListUpdatedListener(this);
31 | }
32 |
33 | @Override
34 | public Class> getColumnClass(int columnIndex) {
35 | return String.class;
36 | }
37 |
38 | @Override
39 | public int getColumnCount() {
40 | return 1;
41 | }
42 |
43 | @Override
44 | public String getColumnName(int columnIndex) {
45 | return "Registered users";
46 | }
47 |
48 | @Override
49 | public int getRowCount() {
50 | return UserManager.getInstance().getUserCount();
51 | }
52 |
53 | @Override
54 | public Object getValueAt(int rowIndex, int columnIndex) {
55 | return UserManager.getInstance().getUser(rowIndex).getName();
56 | }
57 |
58 | @Override
59 | public void userListUpdated() {
60 | int selectedRow = this.table.getSelectedRow();
61 | User c = null;
62 | if (selectedRow >= 0) {
63 | c = this.getUser(selectedRow);
64 | }
65 | this.fireTableDataChanged();
66 | if (c != null) {
67 | for (int i = 0; i < this.getRowCount(); i++) {
68 | if (this.getUser(i).equals(c)) {
69 | table.getSelectionModel().setSelectionInterval(i, i);
70 | }
71 |
72 | }
73 | }
74 | }
75 |
76 | public User getUser(int rowIndex) {
77 | return UserManager.getInstance().getUser(rowIndex);
78 |
79 | }
80 |
81 | public void setTable(JTable t) {
82 | this.table = t;
83 |
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/test/BitmapTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.test;
19 |
20 | import org.jopenray.server.thinclient.DisplayWriterThread;
21 |
22 | public class BitmapTest {
23 |
24 | public static void main(String[] args) {
25 |
26 | System.out.println("Starting");
27 |
28 | DisplayWriterThread w = new DisplayWriterThread(new DebugClient(
29 | "Debug Client"));
30 |
31 | w.sendImage("698_0.png", 100, 100);
32 | w.start();
33 | try {
34 | Thread.sleep(3600 * 1000);
35 | } catch (InterruptedException e) {
36 | // TODO Auto-generated catch block
37 | e.printStackTrace();
38 | }
39 |
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/test/DebugClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.test;
19 |
20 | import java.io.IOException;
21 |
22 | import org.jopenray.server.thinclient.ThinClient;
23 |
24 | public class DebugClient extends ThinClient {
25 | public DebugClient(String name) {
26 | super(name);
27 | }
28 |
29 | long l;
30 |
31 | @Override
32 | public void sendBytes(byte[] buffer, int bufferLength) throws IOException {
33 | System.out.println("DebugClient.sendBytes() length:" + bufferLength);
34 | l += bufferLength;
35 | System.out.println("Sent:" + l + " bytes -> " + (l / 1024) + " KB");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/test/KeyTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.test;
19 |
20 | import java.awt.Dimension;
21 | import java.awt.event.KeyEvent;
22 | import java.awt.event.KeyListener;
23 |
24 | import javax.swing.JFrame;
25 | import javax.swing.JPanel;
26 | import javax.swing.SwingUtilities;
27 |
28 | public class KeyTest {
29 | public static void main(String[] args) {
30 | Runnable r = new Runnable() {
31 | public void run() {
32 | JFrame f = new JFrame();
33 | JPanel p = new JPanel();
34 | p.setPreferredSize(new Dimension(80, 80));
35 | f.setContentPane(p);
36 | p.addKeyListener(new KeyListener() {
37 |
38 | @Override
39 | public void keyPressed(KeyEvent e) {
40 | System.out.println(".keyPressed()" + e);
41 | }
42 |
43 | @Override
44 | public void keyReleased(KeyEvent e) {
45 | System.out.println(".keyReleased()" + e);
46 | }
47 |
48 | @Override
49 | public void keyTyped(KeyEvent e) {
50 | System.out.println(".keyTyped()" + e);
51 | }
52 |
53 | });
54 | p.requestFocus();
55 | f.pack();
56 | f.setVisible(true);
57 | }
58 | };
59 | SwingUtilities.invokeLater(r);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/BitArray.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.util;
19 |
20 | public class BitArray {
21 | private byte bits[];
22 | private int length;
23 |
24 | /**
25 | * Bit array
26 | *
27 | * @param number
28 | * of bits
29 | * */
30 | public BitArray(int size) {
31 |
32 | bits = new byte[(size - 1) / 8 + 1];
33 | length = size;
34 | // System.out.println(this);
35 | // clear();
36 | }
37 |
38 | public void clear() {
39 | for (int i = 0; i < bits.length; i++) {
40 | bits[i] = 0;
41 | }
42 | }
43 |
44 | public void set(int index) {
45 | bits[index / 8] |= (byte) (1 << (7 - (index % 8)));
46 | }
47 |
48 | public int length() {
49 | return length;
50 | }
51 |
52 | public boolean get(int index) {
53 | if (index >= length) {
54 | throw new IndexOutOfBoundsException();
55 | }
56 | byte pattern = (byte) (1 << (7 - (index % 8)));
57 | return (bits[index / 8] & pattern) == pattern ? true : false;
58 | }
59 |
60 | public String toString() {
61 | final StringBuffer str = new StringBuffer(length);
62 | for (int i = 0; i < length; i++) {
63 | str.append(get(i) ? "1" : "0");
64 | }
65 | return str.toString();
66 | }
67 |
68 | public byte[] toByteArray() {
69 | return bits;
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/Hex.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | * Copyright 2019 Cameron Kaiser
4 | * All rights reserved.
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or (at
9 | * your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful, but
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see
18 | */
19 |
20 | package org.jopenray.util;
21 |
22 | public class Hex {
23 | private final static byte[] hexArray = "0123456789ABCDEF".getBytes();
24 |
25 | public static byte[] decodeHex(String s) {
26 | char[] data = s.toCharArray();
27 | int len = data.length;
28 | byte[] out = new byte[len / 2];
29 | for (int i = 0; i < len; i += 2) {
30 | int f = Character.digit(data[i], 16) << 4;
31 | f = f | Character.digit(data[i + 1], 16);
32 | out[i / 2] = (byte) (f & 0xFF);
33 | }
34 | return out;
35 | }
36 |
37 | // Replaces HexDumpEncoder
38 | public static byte[] encode(byte[] bytes) {
39 | byte[] hex = new byte[bytes.length + bytes.length];
40 | int i, j;
41 |
42 | for(i=0; i>> 4];
45 | hex[i+i+1] = hexArray[j & 0x0F];
46 | }
47 | return hex;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/JImage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.util;
19 |
20 | import java.awt.Dimension;
21 | import java.awt.Graphics;
22 | import java.awt.Image;
23 | import java.net.URL;
24 |
25 | import javax.swing.ImageIcon;
26 | import javax.swing.JComponent;
27 |
28 | public class JImage extends JComponent {
29 |
30 | /**
31 | *
32 | */
33 | private static final long serialVersionUID = -5600905043973642236L;
34 | private final Image image;
35 | private boolean centered;
36 |
37 | public JImage(String fileName) {
38 | this(new ImageIcon(fileName).getImage());
39 | }
40 |
41 | public JImage(URL url) {
42 | this(new ImageIcon(url).getImage());
43 | }
44 |
45 | public JImage(Image img) {
46 | this.image = img;
47 | }
48 |
49 | public void check() {
50 | if (this.image == null || this.image.getHeight(null) <= 0) {
51 | throw new IllegalStateException();
52 | }
53 | }
54 |
55 | protected void paintComponent(Graphics g) {
56 |
57 | g.setColor(this.getBackground());
58 | int imageW = this.image.getWidth(null);
59 | if (!centered) {
60 | g.fillRect(imageW, 0, this.getBounds().width - imageW, this
61 | .getBounds().height);
62 | g.drawImage(this.image, 0, 0, null);
63 | } else {
64 | int dx = (this.getBounds().width - imageW) / 2;
65 | g.fillRect(0, 0, dx, this.getBounds().height);
66 | g.fillRect(0, 0, dx + imageW, this.getBounds().height);
67 | g.drawImage(this.image, dx, 0, null);
68 | }
69 | }
70 |
71 | public Dimension getPreferredSize() {
72 | return this.getMinimumSize();
73 | }
74 |
75 | public Dimension getMinimumSize() {
76 | return new Dimension(this.image.getWidth(null), this.image
77 | .getHeight(null));
78 | }
79 |
80 | public void setCenterImage(boolean t) {
81 | this.centered = true;
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/MessageImage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | * Copyright 2019 Cameron Kaiser
4 | * All rights reserved.
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or (at
9 | * your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful, but
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see
18 | */
19 |
20 | package org.jopenray.util;
21 |
22 | import java.awt.Color;
23 | import java.awt.Font;
24 | import java.awt.Graphics2D;
25 | import java.awt.RenderingHints;
26 | import java.awt.geom.Rectangle2D;
27 | import java.awt.image.BufferedImage;
28 |
29 | public class MessageImage {
30 |
31 | public static BufferedImage createImage(String message, int width,
32 | int height) {
33 | final Color MORANGE = new Color(231, 156, 0);
34 | return createImage(message, width, height,
35 | MORANGE, Color.WHITE);
36 | }
37 |
38 | public static BufferedImage createImage(String message, int width,
39 | int height, Color background, Color text) {
40 | BufferedImage im = new BufferedImage(width, height,
41 | BufferedImage.TYPE_INT_ARGB);
42 | Graphics2D g2 = (Graphics2D) im.getGraphics();
43 | g2.setBackground(background);
44 | g2.clearRect(0, 0, width, height);
45 | Font f = VeraFont.getFont().deriveFont(58f);
46 | g2.setFont(f);
47 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
48 | RenderingHints.VALUE_ANTIALIAS_ON);
49 | g2.setColor(new Color(text.getRed(), text.getBlue(),
50 | text.getGreen(), 128));
51 | g2.drawString("kOpenRay", 10, 80);
52 | g2.setColor(text);
53 | Rectangle2D r = g2.getFontMetrics().getStringBounds(message, g2);
54 | g2.drawString(message, (width - (int) r.getWidth()) / 2,
55 | (height - (int) r.getHeight()) / 4);
56 | g2.dispose();
57 | return im;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/TIntArrayList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.util;
19 |
20 | public final class TIntArrayList {
21 |
22 | private int count;
23 | private int[] data;
24 |
25 | public TIntArrayList(int size) {
26 | count = 0;
27 | data = new int[size];
28 | }
29 |
30 | public final boolean contains(int value) {
31 | for (int i = 0; i < count; i++) {
32 | if (data[i] == value) {
33 | return true;
34 | }
35 | }
36 | return false;
37 | }
38 |
39 | public final void add(int value) {
40 | data[count] = value;
41 | count++;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/Vera.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/src/org/jopenray/util/Vera.ttf
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/VeraFont.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 jOpenRay, ILM Informatique
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see
16 | */
17 |
18 | package org.jopenray.util;
19 |
20 | import java.awt.Font;
21 | import java.io.InputStream;
22 |
23 | public class VeraFont {
24 |
25 | public static Font getMonoFont() {
26 | InputStream is = VeraFont.class.getResourceAsStream("VeraMono.ttf");
27 | Font font = null;
28 | try {
29 | font = Font.createFont(Font.TRUETYPE_FONT, is);
30 | } catch (Exception e) {
31 | e.printStackTrace();
32 | }
33 | return font;
34 | }
35 |
36 | public static Font getFont() {
37 | InputStream is = VeraFont.class.getResourceAsStream("Vera.ttf");
38 | Font font = null;
39 | try {
40 | font = Font.createFont(Font.TRUETYPE_FONT, is);
41 | } catch (Exception e) {
42 | e.printStackTrace();
43 | }
44 | return font;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/jopenray/src/org/jopenray/util/VeraMono.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/classilla/kopenray/612058f3a2a3cfea65b3100800ea0dbc23c3269f/jopenray/src/org/jopenray/util/VeraMono.ttf
--------------------------------------------------------------------------------