mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
modify packet: MINPacket
This commit is contained in:
1 parent
7f28f54810
commit
ff613d8a63
1 file changed
+10
-10
@@ -3,19 +3,19 @@ package packet;
|
||||
import component.IdentifierField;
|
||||
import component.MutableField;
|
||||
import component.ReadOnlyField;
|
||||
import component.SignatureField;
|
||||
import encoding.*;
|
||||
|
||||
/*
|
||||
* @Author: Wang Fengs
|
||||
* @Description: 表示一个MIN网络层包的通用结构
|
||||
* todo: 需要在signature完成之后取消signatureField的注释
|
||||
* @Version: 1.0.0
|
||||
* @Date: 22:07 2021/3/13
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public class MINPacket implements IEncodingAble {
|
||||
public IdentifierField identifierField; // 标识区
|
||||
// private SignatureField signatureField; // 签名区
|
||||
private SignatureField signatureField; // 签名区
|
||||
public ReadOnlyField readOnlyField; // 只读区
|
||||
public MutableField mutableField; // 可变区
|
||||
public VlInt packetType; // 包类型
|
||||
@@ -58,11 +58,11 @@ public class MINPacket implements IEncodingAble {
|
||||
totalLength+=tmplen;
|
||||
|
||||
// 签名区
|
||||
// tmplen=this.signatureField.wireEncode(encoder);
|
||||
// if(tmplen<=0){
|
||||
// return 0;
|
||||
// }
|
||||
// totalLength+=tmplen;
|
||||
tmplen=this.signatureField.wireEncode(encoder);
|
||||
if(tmplen<=0){
|
||||
return 0;
|
||||
}
|
||||
totalLength+=tmplen;
|
||||
|
||||
// 标识区
|
||||
tmplen=this.identifierField.wireEncode(encoder);
|
||||
@@ -134,9 +134,9 @@ public class MINPacket implements IEncodingAble {
|
||||
existIdentifier=true;
|
||||
case TLV.TlvSignatureField: // 签名区
|
||||
// 解析签名区,保证如果存在签名,则签名均符合格式
|
||||
// if(!this.signatureField.wireDecode(cacheBlock)){
|
||||
// return false;
|
||||
// }
|
||||
if(!this.signatureField.wireDecode(cacheBlock)){
|
||||
return false;
|
||||
}
|
||||
case TLV.TlvReadOnlyField: // 只读区
|
||||
// 解析只读区
|
||||
if(!this.readOnlyField.wireDecode(cacheBlock)){
|
||||
|
||||
Reference in new issue
Block a user