|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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._05InPacket
public abstract class _05InPacket
input packet base class 0f 05 series 1. packet header sign, 1 byte 2. source, 2 byte 3. packet length, 2 byte 4. packet command, 2 byte 5. packet sequence number, 2 byte 6. user QQ number, 4 byte 7. packet body 8. packet tail, 1 byte noteworthiness is: packet body of this packet is really not full encryption type, but part encryption. 05系列的输入包基类 1. åŒ…å¤´æ ‡è¯†ï¼Œ1å—节 2. source,2å—节 3. 包长度,2å—节 4. 包命令,2å—节 5. 包åºå·ï¼Œ2å—节 6. 用户QQå·ï¼Œ4å—节 7. 包体 8. 包尾,1å—节 值得注æ„的是:这ç§åŒ…的包体并éžå®Œå…¨åŠ å¯†åž‹ï¼Œè€Œæ˜¯éƒ¨åˆ†åŠ å¯†åž‹
Field Summary |
---|
Fields inherited from class net.sf.jqql.packets.Packet |
---|
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user |
Constructor Summary | |
---|---|
_05InPacket(ByteBuffer buf,
int length,
QQUser user)
|
|
_05InPacket(ByteBuffer buf,
QQUser user)
|
|
_05InPacket(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 åŠ å¯†åŒ…ä½“ |
protected byte[] |
getBodyBytes(ByteBuffer buf,
int length)
get byte array of packet body 得到包体的å—节数组 |
int |
getFamily()
|
protected int |
getHeadLength()
|
protected int |
getLength(int bodyLength)
get total length of UDP form packet, rule out TCP form 得到UDPå½¢å¼åŒ…的总长度,ä¸è€ƒè™‘TCPå½¢å¼ |
String |
getPacketName()
|
int |
getQqNum()
|
protected int |
getTailLength()
|
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. |
void |
setQqNum(int qqNum)
|
String |
toString()
|
Methods inherited from class net.sf.jqql.packets.InPacket |
---|
validateHeader |
Methods inherited from class net.sf.jqql.packets.Packet |
---|
dump, equals, getCommand, getCryptographStart, getHeader, getSequence, getSource, hash, hashCode, isDuplicated, parseBody, setDuplicated, setHeader, setSequence |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public _05InPacket(char command, QQUser user)
header
- source
- command
- user
- public _05InPacket(ByteBuffer buf, int length, QQUser user) throws PacketParseException
buf
- length
- user
-
PacketParseException
public _05InPacket(ByteBuffer buf, QQUser user) throws PacketParseException
buf
- user
-
PacketParseException
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
包总长度
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 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 String getPacketName()
getPacketName
in class Packet
public String toString()
toString
in class Object
public int getQqNum()
public void setQqNum(int qqNum)
public int getFamily()
getFamily
in class Packet
|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |