本文整理汇总了Java中org.onosproject.pcepio.types.PcepValueType类的典型用法代码示例。如果您正苦于以下问题:Java PcepValueType类的具体用法?Java PcepValueType怎么用?Java PcepValueType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PcepValueType类属于org.onosproject.pcepio.types包,在下文中一共展示了PcepValueType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: capabilityNegotiation
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
private void capabilityNegotiation(PcepOpenMsg pOpenmsg) {
LinkedList<PcepValueType> tlvList = pOpenmsg.getPcepOpenObject().getOptionalTlv();
boolean pceccCapability = false;
boolean statefulPceCapability = false;
boolean pcInstantiationCapability = false;
boolean labelStackCapability = false;
boolean srCapability = false;
ListIterator<PcepValueType> listIterator = tlvList.listIterator();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
switch (tlv.getType()) {
case PceccCapabilityTlv.TYPE:
pceccCapability = true;
if (((PceccCapabilityTlv) tlv).sBit()) {
labelStackCapability = true;
}
break;
case StatefulPceCapabilityTlv.TYPE:
statefulPceCapability = true;
StatefulPceCapabilityTlv stetefulPcCapTlv = (StatefulPceCapabilityTlv) tlv;
if (stetefulPcCapTlv.getIFlag()) {
pcInstantiationCapability = true;
}
break;
case SrPceCapabilityTlv.TYPE:
srCapability = true;
break;
default:
continue;
}
}
this.capability = new ClientCapability(pceccCapability, statefulPceCapability, pcInstantiationCapability,
labelStackCapability, srCapability);
}
示例2: getLspType
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
private LspType getLspType(PcepSrpObject srpObj) {
LspType lspType = WITH_SIGNALLING;
if (null != srpObj) {
LinkedList<PcepValueType> llOptionalTlv = srpObj.getOptionalTlv();
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
switch (tlv.getType()) {
case PathSetupTypeTlv.TYPE:
lspType = LspType.values()[Integer.valueOf(((PathSetupTypeTlv) tlv).getPst())];
break;
default:
break;
}
}
}
return lspType;
}
示例3: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads from channel buffer and returns object of PcepErrorObject.
*
* @param cb of channel buffer.
* @return object of PCEP-ERROR-OBJECT
*/
public static PcepErrorObject read(ChannelBuffer cb) {
PcepObjectHeader errorObjHeader;
byte errorType;
byte errorValue;
LinkedList<PcepValueType> optionalTlv;
errorObjHeader = PcepObjectHeader.read(cb);
//take only ErrorObject buffer.
ChannelBuffer tempCb = cb.readBytes(errorObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
tempCb.readByte(); //ignore Reserved
tempCb.readByte(); //ignore Flags
errorType = tempCb.readByte();
errorValue = tempCb.readByte();
optionalTlv = parseOptionalTlv(tempCb);
return new PcepErrorObjectVer1(errorObjHeader, errorType, errorValue, optionalTlv);
}
示例4: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads from channel buffer and returns object of PcepEroObject.
*
* @param cb channel buffer.
* @return object of PcepEroObject
* @throws PcepParseException when ERO object is not present in channel buffer
*/
public static PcepEroObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader eroObjHeader;
LinkedList<PcepValueType> subObjectList = new LinkedList<>();
eroObjHeader = PcepObjectHeader.read(cb);
if (eroObjHeader.getObjClass() != PcepEroObjectVer1.ERO_OBJ_CLASS) {
log.debug("ErrorType:" + PcepErrorDetailInfo.ERROR_TYPE_6 + " ErrorValue:"
+ PcepErrorDetailInfo.ERROR_VALUE_9);
throw new PcepParseException(PcepErrorDetailInfo.ERROR_TYPE_6, PcepErrorDetailInfo.ERROR_VALUE_9);
}
if (eroObjHeader.getObjLen() > OBJECT_HEADER_LENGTH) {
ChannelBuffer tempCb = cb.readBytes(eroObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
subObjectList = parseSubObjects(tempCb);
}
return new PcepEroObjectVer1(eroObjHeader, subObjectList);
}
示例5: packOptionalTlv
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Returns writer index.
*
* @param cb of type channel buffer.
* @return writer index
*/
protected int packOptionalTlv(ChannelBuffer cb) {
int startIndex = cb.writerIndex();
LinkedList<PcepValueType> llOptionalTlv = this.llOptionalTlv;
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
if (tlv == null) {
log.debug("TLV is null from OptionalTlv list");
continue;
}
tlv.write(cb);
// need to take care of padding
int pad = tlv.getLength() % 4;
if (0 != pad) {
pad = 4 - pad;
for (int i = 0; i < pad; ++i) {
cb.writeByte((byte) 0);
}
}
}
return cb.writerIndex() - startIndex;
}
示例6: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads form channel buffer and returns objects of PcepLabelObject.
*
* @param cb of type channel buffer
* @return objects of PcepLabelObject
* @throws PcepParseException when fails to read from channel buffer
*/
public static PcepLabelObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader labelObjHeader;
boolean oBit;
int label;
// Optional TLV
LinkedList<PcepValueType> optionalTlv = new LinkedList<>();
labelObjHeader = PcepObjectHeader.read(cb);
//take only LspObject buffer.
ChannelBuffer tempCb = cb.readBytes(labelObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
int iTemp = tempCb.readInt();
oBit = (iTemp & (byte) OFLAG_SET) == OFLAG_SET;
iTemp = tempCb.readInt();
label = (int) iTemp >> SHIFT_LABEL;
// parse optional TLV
optionalTlv = parseOptionalTlv(tempCb);
return new PcepLabelObjectVer1(labelObjHeader, oBit, label, optionalTlv);
}
示例7: packOptionalTlv
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Returns the writer index.
*
* @param cb of channel buffer.
* @return writer index
*/
protected int packOptionalTlv(ChannelBuffer cb) {
ListIterator<PcepValueType> listIterator = optionalTlv.listIterator();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
if (tlv == null) {
log.debug("tlv is null from OptionalTlv list");
continue;
}
tlv.write(cb);
}
return cb.writerIndex();
}
示例8: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads from the channel buffer and returns object of PcepLabelRangeObject.
*
* @param cb of type channel buffer
* @return object of PcepLabelRangeObject
* @throws PcepParseException when fails to read from channel buffer
*/
public static PcepLabelRangeObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader labelRangeObjHeader;
byte labelType;
int rangeSize;
int labelBase;
LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
labelRangeObjHeader = PcepObjectHeader.read(cb);
//take only LabelRangeObject buffer.
ChannelBuffer tempCb = cb.readBytes(labelRangeObjHeader.getObjLen() - MINIMUM_COMMON_HEADER_LENGTH);
int temp = 0;
temp = tempCb.readInt();
rangeSize = temp & 0x00FFFFFF;
labelType = (byte) (temp >> 24);
labelBase = tempCb.readInt();
llOptionalTlv = parseOptionalTlv(tempCb);
return new PcepLabelRangeObjectVer1(labelRangeObjHeader, labelType, rangeSize, labelBase, llOptionalTlv);
}
示例9: packOptionalTlv
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Pack optional tlvs.
*
* @param cb of channel buffer
* @return true
*/
protected boolean packOptionalTlv(ChannelBuffer cb) {
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
if (tlv == null) {
log.debug("tlv is null from OptionalTlv list");
continue;
}
tlv.write(cb);
// need to take care of padding
int pad = tlv.getLength() % 4;
if (0 != pad) {
pad = 4 - pad;
for (int i = 0; i < pad; ++i) {
cb.writeByte((byte) 0);
}
}
}
return true;
}
示例10: packOptionalTlv
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Returns the writer index.
*
* @param cb of type channel buffer
* @return the writer index.
*/
protected int packOptionalTlv(ChannelBuffer cb) {
ListIterator<PcepValueType> listIterator = optionalTlvList.listIterator();
while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next();
if (tlv == null) {
log.debug("TLV is null from OptionalTlv list");
continue;
}
tlv.write(cb);
// need to take care of padding
int pad = tlv.getLength() % 4;
if (0 != pad) {
pad = 4 - pad;
for (int i = 0; i < pad; ++i) {
cb.writeByte((byte) 0);
}
}
}
return cb.writerIndex();
}
示例11: PcepErrorObjectVer1
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Constructor to initialize variables.
*
* @param errorObjHeader ERROR Object header
* @param errorType Error Type
* @param errorValue Error Value
* @param optionalTlv list of optional TLV
*/
public PcepErrorObjectVer1(PcepObjectHeader errorObjHeader, byte errorType, byte errorValue,
LinkedList<PcepValueType> optionalTlv) {
this.errorObjHeader = errorObjHeader;
this.errorType = errorType;
this.errorValue = errorValue;
this.optionalTlv = optionalTlv;
}
示例12: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads from channel buffer and return object of PcepIroObject.
*
* @param cb of type channel buffer
* @return object of PcepIroObject
* @throws PcepParseException while parsing from channel buffer
*/
public static PcepIroObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader iroObjHeader;
LinkedList<PcepValueType> llSubObjects;
iroObjHeader = PcepObjectHeader.read(cb);
//take only IroObject buffer.
ChannelBuffer tempCb = cb.readBytes(iroObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
llSubObjects = parseSubObjects(tempCb);
return new PcepIroObjectVer1(iroObjHeader, llSubObjects);
}
示例13: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads the channel buffer and returns the object of PcepRPObject.
*
* @param cb of type channel buffer
* @return the object of PcepRPObject
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepRPObject read(ChannelBuffer cb) throws PcepParseException {
log.debug("read");
PcepObjectHeader rpObjHeader;
int iRequestIdNum;
boolean bOFlag;
boolean bBFlag;
boolean bRFlag;
byte yPriFlag; // 3bytes
LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
rpObjHeader = PcepObjectHeader.read(cb);
//take only LspObject buffer.
ChannelBuffer tempCb = cb.readBytes(rpObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
int iTemp = tempCb.readInt();
yPriFlag = (byte) (iTemp & PRIFLAG_TEMP_SHIFT_VALUE);
bOFlag = (iTemp & OFLAG_TEMP_SHIFT_VALUE) == OFLAG_TEMP_SHIFT_VALUE;
bBFlag = (iTemp & BFLAG_TEMP_SHIFT_VALUE) == BFLAG_TEMP_SHIFT_VALUE;
bRFlag = (iTemp & RFLAG_TEMP_SHIFT_VALUE) == RFLAG_TEMP_SHIFT_VALUE;
iRequestIdNum = tempCb.readInt();
// parse optional TLV
llOptionalTlv = parseOptionalTlv(tempCb);
return new PcepRPObjectVer1(rpObjHeader, iRequestIdNum, bOFlag, bBFlag, bRFlag, yPriFlag, llOptionalTlv);
}
示例14: packOptionalTlv
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Returns optional tlvs.
*
* @param cb of type channel buffer
* @return llOptionalTlv linked list of Optional TLV
*/
protected int packOptionalTlv(ChannelBuffer cb) {
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
listIterator.next().write(cb);
}
return cb.writerIndex();
}
示例15: read
import org.onosproject.pcepio.types.PcepValueType; //导入依赖的package包/类
/**
* Reads from channel buffer and returns object of PcepOpenObject.
*
* @param cb of type channel buffer
* @return object of PcepOpenObject
* @throws PcepParseException if mandatory fields are missing
*/
public static PcepOpenObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader openObjHeader;
byte version;
byte keepAliveTime;
byte deadTime;
byte sessionID;
LinkedList<PcepValueType> llOptionalTlv;
openObjHeader = PcepObjectHeader.read(cb);
version = cb.readByte();
version = (byte) (version >> PcepMessageVer1.SHIFT_FLAG);
if (version != OPEN_OBJECT_VERSION) {
throw new PcepParseException("Wrong version: Expected=PcepVersion.PCEP_1(1), got=" + version);
}
/* Keepalive */
keepAliveTime = cb.readByte();
/* DeadTimer */
deadTime = cb.readByte();
/* SID */
sessionID = cb.readByte();
// Optional TLV
llOptionalTlv = parseOptionalTlv(cb);
return new PcepOpenObjectVer1(openObjHeader, keepAliveTime, deadTime, sessionID, llOptionalTlv);
}