comparison src/net/sourceforge/jsocks/UDPEncapsulation.java @ 0:0ce5cc452d02

initial version
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 10:41:19 -0700
parents
children 205ee2873330
comparison
equal deleted inserted replaced
-1:000000000000 0:0ce5cc452d02
1 package net.sourceforge.jsocks;
2 /**
3 This interface provides for datagram encapsulation for SOCKSv5 protocol.
4 <p>
5 SOCKSv5 allows for datagrams to be encapsulated for purposes of integrity
6 and/or authenticity. How it should be done is aggreed during the
7 authentication stage, and is authentication dependent. This interface is
8 provided to allow this encapsulation.
9 @see Authentication
10 */
11 public interface UDPEncapsulation {
12
13 /**
14 This method should provide any authentication depended transformation
15 on datagrams being send from/to the client.
16
17 @param data Datagram data (including any SOCKS related bytes), to be
18 encapsulated/decapsulated.
19 @param out Wether the data is being send out. If true method should
20 encapsulate/encrypt data, otherwise it should decapsulate/
21 decrypt data.
22 @throw IOException if for some reason data can be transformed correctly.
23 @return Should return byte array containing data after transformation.
24 It is possible to return same array as input, if transformation
25 only involves bit mangling, and no additional data is being
26 added or removed.
27 */
28 byte[] udpEncapsulate(byte[] data, boolean out) throws java.io.IOException;
29 }