|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jqql.obsolete.FilePacket
net.sf.jqql.obsolete.FileControlPacket
public class FileControlPacket
file control packet.file control packet has a common format, only fewness packet form si defferent 1. 16 byte session key and QQ number md5 form, use to session key in file transfer 2. command type, 2 byte 3. sequence number, 2 byte 4. sending time, 4 byte 5. a unknown byte 0 6. sender face, 1 byte 7. 19 unused byte, all 0 8. fixed byte 0x65 9. 1 unknown byte, maybe is connection mode 10. Internet Ip, 4 byte 11. Internet port, 2 byte 13. first monitor port, 2 byte 14. real IP, 4 byte 15. second monitor port, 2 byte total is 61 byte for some command type, haven't part10-15, but at part9 follow a unknown byte, this unknown byte since need original sample return, such command is 0x0031, 0x0032, 0x0033, 0x0034 文件控制信息包,文件控制信息包有一个很普遍的格式,只有少数包的格式有所不同 1. 16个字节的session key和qq号的md5形式,用来做为文件传输时的会话密钥 2. 命令类型,2字节 3. 序号,2字节 4. 发送时间,4字节 5. 一个未知字节0 6. 发送者头像,1字节 7. 19个未用字节,全0 8. 固定字节0x65 9. 1个未知字节,可能是连接方式 10. 外部IP,4字节 11. 外部端口,2字节 13. 第一个监听端口,2字节 14. 真实IP,4字节 15. 第二个监听端口,2字节 一共61字节 对于有些命令类型,不存在10-15部分,而是在9部分之后带一个未知字节,这个未知字节似乎 需要原样返回,这样的命令有0x0031, 0x0032, 0x0033, 0x0034
Field Summary |
---|
Fields inherited from class net.sf.jqql.obsolete.FilePacket |
---|
crypter, key, log, random, receiver, sender, source, tag, watcher |
Constructor Summary | |
---|---|
FileControlPacket(FileWatcher watcher)
create a fil control packet object 构造一个文件控制信息包对象 |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
protected void |
fill(ByteBuffer out)
initialize packet content, subclass should overide this method, and first use this method in super class × content of input ByteBuffer will be clear, after complete, buffer position equal to packet length 初始化包内容,子类应该覆盖这个方法,并首先调用父类的这个方法 输入ByteBuffer原来的内容将被清空,完成后,buffer的position 等于包长 |
protected void |
fill(ByteBuffer out,
int from)
initialize packet content, subclass should overide this method, and first use this method in super class content of input ByteBuffer won't be clear, new content start fill from from position, after complete, buffer position = packet length + from 初始化包内容,子类应该覆盖这个方法,并首先调用父类的这个方法 输入ByteBuffer的原来内容不被清空,新的内容从from位置开始 填充,完成后,buffer的position等于包长加上from |
char |
getCommand()
|
byte |
getHelloByte()
|
byte[] |
getInternetIp()
|
int |
getInternetPort()
|
byte[] |
getLocalIp()
|
int |
getMajorPort()
|
int |
getMinorPort()
|
long |
getTime()
|
int |
hashCode()
|
protected void |
initFixedFields()
init some fixed field toward fixed type packet 初始化一些对于固定类型的包来说固定值的字段 |
protected void |
parse(ByteBuffer in)
parse packet header, subclass should overide this method, and first use this method in super class parse start from current position of in, after parse complete, position of in will be after this packet 解析包头,子类应该覆盖该方法,并首先调用父类的这个方法 解析从in的当前位置开始,解析完毕后in的position将位于 这个包之后 |
void |
setCommand(char command)
|
void |
setHelloByte(byte helloByte)
|
void |
setInternetIp(byte[] internetIp)
|
void |
setInternetPort(int internetPort)
|
void |
setLocalIp(byte[] localIp)
|
void |
setMajorPort(int directPort)
|
void |
setMinorPort(int localPort)
|
void |
setTime(long time)
|
Methods inherited from class net.sf.jqql.obsolete.FilePacket |
---|
decryptQQ, encryptQQ, generateKey, getKey, getReceiver, getSender, getSource, getTag, refreshKey, setReceiver, setSender, setSource, setTag |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileControlPacket(FileWatcher watcher)
watcher
- FileWatcher对象 //objectMethod Detail |
---|
protected void fill(ByteBuffer out)
FilePacket
initialize packet content, subclass should overide this method, and first use this method in super class × content of input ByteBuffer will be clear, after complete, buffer position equal to packet length 初始化包内容,子类应该覆盖这个方法,并首先调用父类的这个方法 输入ByteBuffer原来的内容将被清空,完成后,buffer的position 等于包长
fill
in class FilePacket
out
- ByteBuffer对象,做为输出缓冲区 // ByteBuffer object, use to output bufferprotected void fill(ByteBuffer out, int from)
FilePacket
initialize packet content, subclass should overide this method, and first use this method in super class content of input ByteBuffer won't be clear, new content start fill from from position, after complete, buffer position = packet length + from 初始化包内容,子类应该覆盖这个方法,并首先调用父类的这个方法 输入ByteBuffer的原来内容不被清空,新的内容从from位置开始 填充,完成后,buffer的position等于包长加上from
fill
in class FilePacket
out
- ByteBuffer对象,做为输出缓冲区 // ByteBuffer object, use to output bufferfrom
- 开始填充的位置 //start fill positionprotected void parse(ByteBuffer in) throws PacketParseException
FilePacket
parse
in class FilePacket
in
- ByteBuffer对象,做为输入缓冲区 // ByteBuffer object, as input buffer
PacketParseException
public byte getHelloByte()
public void setHelloByte(byte helloByte)
helloByte
- The helloByte to set.public long getTime()
public void setTime(long time)
time
- The time to set.protected void initFixedFields()
FilePacket
initFixedFields
in class FilePacket
public char getCommand()
public void setCommand(char command)
command
- The command to set.public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int getMajorPort()
public void setMajorPort(int directPort)
majorPort
- The majorPort to set.public byte[] getInternetIp()
public void setInternetIp(byte[] internetIp)
internetIp
- The internetIp to set.public int getInternetPort()
public void setInternetPort(int internetPort)
internetPort
- The internetPort to set.public byte[] getLocalIp()
public void setLocalIp(byte[] localIp)
localIp
- The localIp to set.public int getMinorPort()
public void setMinorPort(int localPort)
minorPort
- The minorPort to set.
|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |