本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFFlowStatsEntry.getMatch方法的典型用法代码示例。如果您正苦于以下问题:Java OFFlowStatsEntry.getMatch方法的具体用法?Java OFFlowStatsEntry.getMatch怎么用?Java OFFlowStatsEntry.getMatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.protocol.OFFlowStatsEntry
的用法示例。
在下文中一共展示了OFFlowStatsEntry.getMatch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FlowEntryBuilder
import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; //导入方法依赖的package包/类
public FlowEntryBuilder(DeviceId deviceId, OFFlowStatsEntry entry, DriverService driverService) {
this.stat = entry;
this.match = entry.getMatch();
this.instructions = getInstructions(entry);
this.deviceId = deviceId;
this.removed = null;
this.flowMod = null;
this.type = FlowType.STAT;
this.driverService = driverService;
}
示例2: FlowEntryBuilder
import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; //导入方法依赖的package包/类
public FlowEntryBuilder(Dpid dpid, OFFlowStatsEntry entry, Type tableType) {
this.stat = entry;
this.match = entry.getMatch();
this.instructions = getInstructions(entry);
this.dpid = dpid;
this.removed = null;
this.flowMod = null;
this.type = FlowType.STAT;
this.tableType = tableType;
}
示例3: FlowEntryBuilder
import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; //导入方法依赖的package包/类
public FlowEntryBuilder(DeviceId deviceId, OFFlowStatsEntry entry, DriverHandler driverHandler) {
this.stat = entry;
this.match = entry.getMatch();
this.instructions = getInstructions(entry);
this.deviceId = deviceId;
this.removed = null;
this.flowMod = null;
this.type = FlowType.STAT;
this.driverHandler = driverHandler;
this.afsc = null;
this.lightWeightStat = null;
}
示例4: getPairFlowSet
import org.projectfloodlight.openflow.protocol.OFFlowStatsEntry; //导入方法依赖的package包/类
public Map<OFFlowStatsEntry, Boolean> getPairFlowSet(Map<OFFlowStatsEntry, FlowEntry> table) {
Map<OFFlowStatsEntry, Boolean> pairFlowSet = new HashMap<>();
Map<OFFlowStatsEntry, int[]> pairFlowInfo = new HashMap<>();
for (Map.Entry<OFFlowStatsEntry, FlowEntry> entry : table.entrySet()) {
OFFlowStatsEntry e = entry.getKey();
Match match = e.getMatch();
//0 - src, 1 - dst, 2 - proto
int[] vals = new int[3];
vals[0] = 0;
vals[1] = 0;
vals[2] = 0;
for (MatchField<?> field : match.getMatchFields()) {
switch (field.id) {
case IPV4_SRC:
vals[0] = match.get(MatchField.IPV4_SRC).getInt();
break;
case IPV4_DST:
vals[1] = match.get(MatchField.IPV4_DST).getInt();
break;
case IP_PROTO:
vals[2] = match.get(MatchField.IP_PROTO).getIpProtocolNumber();
break;
default:
break;
}
}
if (vals[0] == 0 || vals[1] == 0) {
continue;
}
pairFlowInfo.put(e, vals);
}
//extract pairflow
for (Map.Entry<OFFlowStatsEntry, int[]> entryCur : pairFlowInfo.entrySet()) {
boolean pairflow = false;
int[] valsCur = entryCur.getValue();
for (Map.Entry<OFFlowStatsEntry, int[]> entryTar : pairFlowInfo.entrySet()) {
int[] valsTar = entryTar.getValue();
//src(cur) == dst(tar), src(cur) == dst(tar), proto ==
if ((valsCur[0] == valsTar[1]) &&
(valsCur[1] == valsTar[0]) &&
(valsCur[2] == valsTar[2])
) {
pairflow = true;
break;
}
}
if (pairflow) {
pairFlowSet.put(entryCur.getKey(), true);
}
}
return pairFlowSet;
}