|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jqql.packets.Packet
net.sf.jqql.packets.InPacket
net.sf.jqql.packets.DiskInPacket
public abstract class DiskInPacket
] network disk protocol family input packet 1. packet length, 4 byte, exclusive 2. version sign, 2 byte Note: although part2 now is named as version sign, it isn't very sure, in faith is this meaning. for input packet, its version sign may be different from sever sign, or be same. and two instance since have different meaning. for now, suppose this field is version sign, then while it is server sign, sign notify client to session. while it is as same as output packet sign, it means reply packet. 3. unknown 2 byte 4. command 2 byte 5. reply code 4 byte 6. reply message length, 4 byte 7. reply message 8. unknown content Note: part5-8 in all is 72 byte, (8)length = 72 - (5,6,7)length 9. packet body 网络硬盘协议族输入包 1. 包长,4字节,exclusive 2. 版本标识,2字节 Note: 虽然2部分目前起名叫做版本标识,但是不能很肯定,确实就是这个意思,对于输入包来说,其版本标识 既可能和输出包不一样,也可能一样,而且两种情况似乎有不同的含义。对于目前来说,假设这个字段是版本标识, 则当其为服务器端标识时,标识通知客户端开始会话。当其和输出包标志一致时,表示回复包 3. 未知的2字节 4. 命令,2字节 5. 回复码,4字节 6. 回复消息长度,4字节 7. 回复消息 8. 未知内容 Note: 5-8部分共72字节,8部分长度为72 - (5,6,7)长度 9. 包体 Note: 此协议族包体不加密,并且只用于TCP连接
Field Summary | |
---|---|
int |
replyCode
|
String |
replyMessage
|
Fields inherited from class net.sf.jqql.packets.Packet |
---|
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user |
Constructor Summary | |
---|---|
DiskInPacket(ByteBuffer buf,
int length,
QQUser user)
|
|
DiskInPacket(char command,
QQUser user)
|
Method Summary | |
---|---|
protected byte[] |
decryptBody(byte[] body,
int offset,
int length)
decrypt packet body 解密包体 |
protected byte[] |
encryptBody(byte[] b,
int offset,
int length)
encrypt packet body 加密包体 |
boolean |
equals(Object obj)
|
protected byte[] |
getBodyBytes(ByteBuffer buf,
int length)
get byte array of packet body 得到包体的字节数组 |
protected int |
getCryptographStart()
|
int |
getFamily()
|
protected int |
getHeadLength()
|
protected int |
getLength(int bodyLength)
get total length of UDP form packet, rule out TCP form 得到UDP形式包的总长度,不考虑TCP形式 |
protected int |
getTailLength()
|
int |
hashCode()
make up sequence number and command as hash code. |
protected void |
parseHeader(ByteBuffer buf)
parse packet header from current position of buf 从buf的当前位置解析包头 |
protected void |
parseTail(ByteBuffer buf)
parse packet tail from current position of buf 从buf的当前未知解析包尾 |
protected void |
putBody(ByteBuffer buf)
initialize packet body 初始化包体 |
protected void |
putHead(ByteBuffer buf)
change packet header to byte stream, and write into appointed ByteBuffer object. |
protected void |
putTail(ByteBuffer buf)
change packet tail to byte stream, and write into appointed ByteBuffer object. |
Methods inherited from class net.sf.jqql.packets.InPacket |
---|
validateHeader |
Methods inherited from class net.sf.jqql.packets.Packet |
---|
dump, getCommand, getHeader, getPacketName, getSequence, getSource, hash, isDuplicated, parseBody, setDuplicated, setHeader, setSequence |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int replyCode
public String replyMessage
Constructor Detail |
---|
public DiskInPacket(ByteBuffer buf, int length, QQUser user) throws PacketParseException
PacketParseException
public DiskInPacket(char command, QQUser user)
Method Detail |
---|
protected int getLength(int bodyLength)
Packet
getLength
in class Packet
bodyLength
- packet body length
包体长度
protected int getHeadLength()
getHeadLength
in class Packet
protected int getTailLength()
getTailLength
in class Packet
protected void putHead(ByteBuffer buf)
Packet
putHead
in class Packet
buf
- ByteBuffer object whicn packet need to write into
写入的ByteBuffer对象.protected void putBody(ByteBuffer buf)
Packet
putBody
in class Packet
buf
- ByteBufferprotected byte[] getBodyBytes(ByteBuffer buf, int length)
Packet
getBodyBytes
in class Packet
buf
- ByteBufferlength
- packet total length
包总长度
public int getFamily()
getFamily
in class Packet
protected void putTail(ByteBuffer buf)
Packet
putTail
in class Packet
buf
- ByteBuffer object whicn packet need to write into
写入的ByteBuffer对象.protected byte[] encryptBody(byte[] b, int offset, int length)
Packet
encryptBody
in class Packet
b
- unencrypt byte array
未加密的字节数组offset
- offset of packet body begin
包体开始的偏移length
- packet body length
包体长度
protected byte[] decryptBody(byte[] body, int offset, int length)
Packet
decryptBody
in class Packet
body
- byte array of packet body
包体字节数组offset
- offset of packet body begin
包体开始偏移length
- packet length
包体长度
protected int getCryptographStart()
getCryptographStart
in class Packet
protected void parseHeader(ByteBuffer buf) throws PacketParseException
Packet
parseHeader
in class Packet
buf
- ByteBuffer
PacketParseException
- if parse error
如果解析出错protected void parseTail(ByteBuffer buf) throws PacketParseException
Packet
parseTail
in class Packet
buf
- ByteBuffer
PacketParseException
- if parse error
如果解析出错public int hashCode()
Packet
hashCode
in class Packet
public boolean equals(Object obj)
equals
in class Packet
|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |