本文整理汇总了Java中org.projectfloodlight.openflow.protocol.match.MatchFields类的典型用法代码示例。如果您正苦于以下问题:Java MatchFields类的具体用法?Java MatchFields怎么用?Java MatchFields使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MatchFields类属于org.projectfloodlight.openflow.protocol.match包,在下文中一共展示了MatchFields类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkMatchFields
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
/**
* Examine all the MatchFields in a Match object and pick out
* the MatchFields that are not supported by OF-DPA.
*
* @param m
* @return
*/
public static List<MatchFields> checkMatchFields(Match m) {
List<MatchFields> unsupported = null;
Iterator<MatchField<?>> mfi = m.getMatchFields().iterator();
while (mfi.hasNext()) {
MatchField<?> mf = mfi.next();
if (!getSupportedMatchFields().contains(mf.id)) {
if (unsupported == null) {
unsupported = new ArrayList<MatchFields>();
}
unsupported.add(mf.id);
}
}
return unsupported;
}
示例2: checkMatchFields
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
/**
* Examine all the MatchFields in a Match object and pick out
* the MatchFields that are not supported by OF-DPA.
*
* @param m
* @return
*/
public static List<MatchFields> checkMatchFields(Match m) {
List<MatchFields> unsupported = null;
Iterator<MatchField<?>> mfi = m.getMatchFields().iterator();
while (mfi.hasNext()) {
MatchField<?> mf = mfi.next();
if (!getSupportedMatchFields().contains(mf.id)) {
if (unsupported == null) {
unsupported = new ArrayList<MatchFields>();
}
unsupported.add(mf.id);
}
}
return unsupported;
}
示例3: ofList
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
public static OFOxmList ofList(Iterable<OFOxm<?>> oxmList) {
Map<MatchFields, OFOxm<?>> map = new EnumMap<MatchFields, OFOxm<?>>(
MatchFields.class);
for (OFOxm<?> o : oxmList) {
OFOxm<?> canonical = o.getCanonical();
if(logger.isDebugEnabled() && !Objects.equal(o, canonical)) {
logger.debug("OFOxmList: normalized non-canonical OXM {} to {}", o, canonical);
}
if(canonical != null)
map.put(canonical.getMatchField().id, canonical);
}
return new OFOxmList(map);
}
示例4: iterateSingleExactMatchField
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
@Test
public void iterateSingleExactMatchField() {
OFPort port5 = OFPort.of(5);
Match match = factory.buildMatch()
.setExact(MatchField.IN_PORT, port5)
.build();
Iterator<MatchField<?>> iter = match.getMatchFields().iterator();
assertThat(iter.hasNext(), is(true));
MatchField<?> matchField = iter.next();
assertThat(matchField.id, is(MatchFields.IN_PORT));
assertThat(match.isExact(matchField), is(true));
@SuppressWarnings("unchecked")
MatchField<OFPort> portMatchField = (MatchField<OFPort>) matchField;
OFPort port = match.get(portMatchField);
assertThat(port, is(port5));
assertThat(iter.hasNext(), is(false));
}
示例5: of
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
public static OFOxmList of(OFOxm<?>... oxms) {
Map<MatchFields, OFOxm<?>> map = new EnumMap<MatchFields, OFOxm<?>>(
MatchFields.class);
for (OFOxm<?> o : oxms) {
OFOxm<?> canonical = o.getCanonical();
if(logger.isDebugEnabled() && !Objects.equal(o, canonical)) {
logger.debug("OFOxmList: normalized non-canonical OXM {} to {}", o, canonical);
}
if(canonical != null)
map.put(canonical.getMatchField().id, canonical);
}
return new OFOxmList(map);
}
示例6: OFOxmList
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
private OFOxmList(Map<MatchFields, OFOxm<?>> oxmMap) {
this.oxmMap = oxmMap;
}
示例7: Builder
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
public Builder() {
oxmMap = new EnumMap<MatchFields, OFOxm<?>>(MatchFields.class);
}
示例8: createBuilder
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
public OFOxmList.Builder createBuilder() {
return new OFOxmList.Builder(new EnumMap<MatchFields, OFOxm<?>>(oxmMap));
}
示例9: getSupportedMatchFields
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
/**
* Get the MatchFields that an OF-DPA switch supports matching.
* Note that this does not specify match codependencies or
* mutually exclusive matches.
*
* @return, an unmodifiable list of potential MatchFields
*/
public static List<MatchFields> getSupportedMatchFields() {
return ALLOWED_MATCHES;
}
示例10: getSupportedMatchFields
import org.projectfloodlight.openflow.protocol.match.MatchFields; //导入依赖的package包/类
/**
* Get the MatchFields that an OF-DPA switch supports matching.
* Note that this does not specify match codependencies or
* mutually exclusive matches.
*
* @return, an unmodifiable list of potential MatchFields
*/
public static List<MatchFields> getSupportedMatchFields() {
return ALLOWED_MATCHES;
}