All Packages Class Hierarchy This Package Previous Next Index
Class net.fsp.FSPpacket
java.lang.Object
|
+----net.fsp.FSPpacket
- public class FSPpacket
- extends Object
This class handles assembly and disassembly FSP packets from/to DatagramPacket.
FSPpacket class represents one packet sent over network while carrying
payload of FSP protocol.
- See Also:
- DatagramPacket
-
bb_key
- server access KEY, needs to be correct
-
bb_len
- number of required bytes in buffer
-
bb_pos
- file position pointer (4GB-1 max)
-
bb_seq
- client side sequence number, any number can be used
-
buf
- buffer for holding user generated data to be transmited via FSP protocol
-
CC_BYE
- finish a session
-
CC_DEL_DIR
- delete directory
-
CC_DEL_FILE
- delete file
-
CC_ERR
- error response from server
-
CC_GET_DIR
- get a directory listing
-
CC_GET_FILE
- get a file
-
CC_GET_PRO
- get directory protection
-
CC_GRAB_DONE
- atomic get+delete done
-
CC_GRAB_FILE
- atomic get+delete
-
CC_INFO
- get server info block
-
CC_INSTALL
- close a opened file f/wrt
-
CC_LIMIT
- commands >7f are reserverd for FSP v3 headers
-
CC_MAKE_DIR
- make directory
-
CC_RENAME
- rename file or directory
-
CC_SET_PRO
- set directory protection
-
CC_STAT
- get file/directory information
-
CC_TEST
- reserved for testing FSP v3 header
-
CC_UP_LOAD
- open file for writing
-
CC_VERSION
- get server setup
-
cmd
- FSP command, use one of CC_ constants
-
HSIZE
- Size of FSP protocol v2 header - 12 bytes.
-
MAXSIZE
- Maximum packet size (HSIZE+SPACE)
-
SPACE
- Maximum size of FSP data space - 1024 bytes.
-
sum
- FSP packet checksum, field is computed by assemble()
-
xtra_len
- optional data size in buffer
-
assemble(DatagramPacket)
- generate UDP packet from this FSP packet
-
disassemble(DatagramPacket)
- Disassemble UDP packet into this FSP packet
-
setData(byte[], int, int, byte[], int, int)
- set FSP data payload to data1 and data2
-
toString()
- prints header of FSP packet.
HSIZE
public static final int HSIZE
- Size of FSP protocol v2 header - 12 bytes.
SPACE
public static final int SPACE
- Maximum size of FSP data space - 1024 bytes.
MAXSIZE
public static final int MAXSIZE
- Maximum packet size (HSIZE+SPACE)
cmd
public byte cmd
- FSP command, use one of CC_ constants
sum
public byte sum
- FSP packet checksum, field is computed by assemble()
bb_key
public short bb_key
- server access KEY, needs to be correct
bb_seq
public short bb_seq
- client side sequence number, any number can be used
bb_len
public short bb_len
- number of required bytes in buffer
bb_pos
public int bb_pos
- file position pointer (4GB-1 max)
xtra_len
public int xtra_len
- optional data size in buffer
buf
public byte buf[]
- buffer for holding user generated data to be transmited via FSP protocol
CC_VERSION
public static final byte CC_VERSION
- get server setup
CC_INFO
public static final byte CC_INFO
- get server info block
CC_ERR
public static final byte CC_ERR
- error response from server
CC_GET_DIR
public static final byte CC_GET_DIR
- get a directory listing
CC_GET_FILE
public static final byte CC_GET_FILE
- get a file
CC_UP_LOAD
public static final byte CC_UP_LOAD
- open file for writing
CC_INSTALL
public static final byte CC_INSTALL
- close a opened file f/wrt
CC_DEL_FILE
public static final byte CC_DEL_FILE
- delete file
CC_DEL_DIR
public static final byte CC_DEL_DIR
- delete directory
CC_GET_PRO
public static final byte CC_GET_PRO
- get directory protection
CC_SET_PRO
public static final byte CC_SET_PRO
- set directory protection
CC_MAKE_DIR
public static final byte CC_MAKE_DIR
- make directory
CC_BYE
public static final byte CC_BYE
- finish a session
CC_GRAB_FILE
public static final byte CC_GRAB_FILE
- atomic get+delete
CC_GRAB_DONE
public static final byte CC_GRAB_DONE
- atomic get+delete done
CC_STAT
public static final byte CC_STAT
- get file/directory information
CC_RENAME
public static final byte CC_RENAME
- rename file or directory
CC_LIMIT
public static final byte CC_LIMIT
- commands >7f are reserverd for FSP v3 headers
CC_TEST
public static final byte CC_TEST
- reserved for testing FSP v3 header
disassemble
public boolean disassemble(DatagramPacket udp)
- Disassemble UDP packet into this FSP packet
- Parameters:
- udp - the DatagramPacket to be dissassembled.
- Returns:
- true if valid FSP packet was found
assemble
public void assemble(DatagramPacket udp)
- generate UDP packet from this FSP packet
toString
public String toString()
- prints header of FSP packet.
- Returns:
- Header converted to the string
- Overrides:
- toString in class Object
setData
public void setData(byte data1[],
int offset1,
int length1,
byte data2[],
int offset2,
int length2)
- set FSP data payload to data1 and data2
- Parameters:
- data1 - data payload array
- offset1 - starting offset of data in data1 array
- length1 - data size
- data2 - xtra data payload array
- offset2 - starting offset of xtra data in data2 array
- length2 - xtra data size
All Packages Class Hierarchy This Package Previous Next Index