本文整理汇总了Java中org.onosproject.pcepio.protocol.PcepFecObjectIPv4类的典型用法代码示例。如果您正苦于以下问题:Java PcepFecObjectIPv4类的具体用法?Java PcepFecObjectIPv4怎么用?Java PcepFecObjectIPv4使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PcepFecObjectIPv4类属于org.onosproject.pcepio.protocol包,在下文中一共展示了PcepFecObjectIPv4类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.onosproject.pcepio.protocol.PcepFecObjectIPv4; //导入依赖的package包/类
/**
* Reads from channel buffer and returns object of PcepFecObjectIPv4.
*
* @param cb of channel buffer
* @return object of PcepFecObjectIPv4
* @throws PcepParseException when fails to read from channel buffer
*/
public static PcepFecObjectIPv4 read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader fecObjHeader;
int nodeID;
fecObjHeader = PcepObjectHeader.read(cb);
nodeID = cb.readInt();
return new PcepFecObjectIPv4Ver1(fecObjHeader, nodeID);
}
示例2: build
import org.onosproject.pcepio.protocol.PcepFecObjectIPv4; //导入依赖的package包/类
@Override
public PcepFecObjectIPv4 build() throws PcepParseException {
PcepObjectHeader fecObjHeader = this.bIsHeaderSet ? this.fecObjHeader : DEFAULT_FEC_OBJECT_HEADER;
if (!this.bIsNodeIdset) {
throw new PcepParseException("NodeID not set while building PcepFecObjectIPv4 object.");
}
if (bIsPFlagSet) {
fecObjHeader.setPFlag(bPFlag);
}
if (bIsIFlagSet) {
fecObjHeader.setIFlag(bIFlag);
}
return new PcepFecObjectIPv4Ver1(fecObjHeader, this.nodeID);
}
示例3: pushGlobalNodeLabel
import org.onosproject.pcepio.protocol.PcepFecObjectIPv4; //导入依赖的package包/类
private void pushGlobalNodeLabel(DeviceId deviceId, LabelResourceId labelId,
IpPrefix ipPrefix, PcepFlowType type, boolean isBos) throws PcepParseException {
checkNotNull(deviceId);
checkNotNull(labelId);
checkNotNull(type);
PcepClient pc = getPcepClient(deviceId);
if (pc == null) {
log.error("PCEP client not found");
return;
}
LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>();
if (ipPrefix == null) {
// Pushing self node label to device.
ipPrefix = IpPrefix.valueOf(pc.getPccId().ipAddress(), 32);
}
PcepFecObjectIPv4 fecObject = pc.factory().buildFecObjectIpv4()
.setNodeID(ipPrefix.address().getIp4Address().toInt())
.build();
boolean bSFlag = false;
if (pc.labelDbSyncStatus() == IN_SYNC && !isBos) {
// Need to set sync flag in all messages till sync completes.
bSFlag = true;
}
PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag);
//Global NODE-SID as label object
PcepLabelObject labelObject = pc.factory().buildLabelObject()
.setLabel((int) labelId.labelId())
.build();
PcepLabelMap labelMap = new PcepLabelMap();
labelMap.setFecObject(fecObject);
labelMap.setLabelObject(labelObject);
labelMap.setSrpObject(srpObj);
labelUpdateList.add(pc.factory().buildPcepLabelUpdateObject()
.setLabelMap(labelMap)
.build());
PcepLabelUpdateMsg labelMsg = pc.factory().buildPcepLabelUpdateMsg()
.setPcLabelUpdateList(labelUpdateList)
.build();
pc.sendMessage(labelMsg);
if (isBos) {
// Sync is completed.
pc.setLabelDbSyncStatus(SYNCED);
}
}
示例4: pushGlobalNodeLabel
import org.onosproject.pcepio.protocol.PcepFecObjectIPv4; //导入依赖的package包/类
void pushGlobalNodeLabel(PcepClient pc, LabelResourceId labelId,
int labelForNode, PcepLabelOp type, boolean isBos) throws PcepParseException {
checkNotNull(pc);
checkNotNull(labelId);
checkNotNull(type);
LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>();
PcepFecObjectIPv4 fecObject = pc.factory().buildFecObjectIpv4()
.setNodeID(labelForNode)
.build();
boolean bSFlag = false;
if (pc.labelDbSyncStatus() == IN_SYNC && !isBos) {
// Need to set sync flag in all messages till sync completes.
bSFlag = true;
}
PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag);
//Global NODE-SID as label object
PcepLabelObject labelObject = pc.factory().buildLabelObject()
.setLabel((int) labelId.labelId())
.build();
PcepLabelMap labelMap = new PcepLabelMap();
labelMap.setFecObject(fecObject);
labelMap.setLabelObject(labelObject);
labelMap.setSrpObject(srpObj);
labelUpdateList.add(pc.factory().buildPcepLabelUpdateObject()
.setLabelMap(labelMap)
.build());
PcepLabelUpdateMsg labelMsg = pc.factory().buildPcepLabelUpdateMsg()
.setPcLabelUpdateList(labelUpdateList)
.build();
pc.sendMessage(labelMsg);
if (isBos) {
// Sync is completed.
pc.setLabelDbSyncStatus(SYNCED);
}
}