forked from KNEMC/KLALB
优化代码,性能暴涨
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package org.kne.cloud.network.srv6;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class SRv6TLV {
|
||||
public static final int PAD1=0;
|
||||
public static final int PADN=4;
|
||||
public static final int HMAC=5;
|
||||
public static final int SEQS=7;
|
||||
|
||||
private int type;
|
||||
private int length;
|
||||
private byte[]value;
|
||||
public SRv6TLV(int type, int length, byte[] value) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.length = length;
|
||||
this.value = value;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SRv6TLV [type=" + type + ", length=" + length + ", value=" + Arrays.toString(value) + "]";
|
||||
}
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
public int getLength() {
|
||||
return length;
|
||||
}
|
||||
public byte[] getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public int getTotalLength() {
|
||||
if(type==PAD1) {
|
||||
return 1;
|
||||
}
|
||||
return 2+length;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user