本文整理汇总了Java中org.projectfloodlight.openflow.protocol.oxm.OFOxms类的典型用法代码示例。如果您正苦于以下问题:Java OFOxms类的具体用法?Java OFOxms怎么用?Java OFOxms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OFOxms类属于org.projectfloodlight.openflow.protocol.oxm包,在下文中一共展示了OFOxms类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionReplaceVlan
import org.projectfloodlight.openflow.protocol.oxm.OFOxms; //导入依赖的package包/类
/**
* Create an OFAction to change the outer most vlan.
*
* @param sw switch object
* @param newVlan final VLAN to be set on the packet
* @return {@link OFAction}
*/
private OFAction actionReplaceVlan(final IOFSwitch sw, final int newVlan) {
OFFactory factory = sw.getOFFactory();
OFOxms oxms = factory.oxms();
OFActions actions = factory.actions();
if (OF_12.compareTo(factory.getVersion()) == 0) {
return actions.buildSetField().setField(oxms.buildVlanVid()
.setValue(OFVlanVidMatch.ofRawVid((short) newVlan))
.build()).build();
} else {
return actions.buildSetField().setField(oxms.buildVlanVid()
.setValue(OFVlanVidMatch.ofVlan(newVlan))
.build()).build();
}
}
示例2: buildOFMatchV3
import org.projectfloodlight.openflow.protocol.oxm.OFOxms; //导入依赖的package包/类
private OFMatchV3 buildOFMatchV3() {
OFFactory of13Factory = OFFactories.getFactory(OFVersion.OF_13);
OFOxms oxms = of13Factory.oxms();
OFOxmEthType ofOxmEthType = oxms.buildEthType().setValue(EthType.IPv4).build();
OFOxmIpv4Src ofOxmIpv4Src = oxms.buildIpv4Src().setValue(IPv4Address.of(multicastGroup.sourceIP)).build();
OFOxmIpProto ofOxmIpProto = oxms.buildIpProto().setValue(IpProtocol.UDP).build();
OFOxmIpv4Dst ofOxmIpv4Dst = oxms.buildIpv4Dst().setValue(IPv4Address.of(multicastGroup.groupIP)).build();
OFOxmList oxmList = OFOxmList.of(ofOxmEthType, ofOxmIpv4Src, ofOxmIpv4Dst, ofOxmIpProto);
OFMatchV3 of13Match = of13Factory.buildMatchV3().setOxmList(oxmList).build();
return of13Match;
}
示例3: actionSetDstMac
import org.projectfloodlight.openflow.protocol.oxm.OFOxms; //导入依赖的package包/类
/**
* Create an action to set the DstMac of a packet
*
* @param sw switch object
* @param macAddress MacAddress to set
* @return {@link OFAction}
*/
private OFAction actionSetDstMac(final IOFSwitch sw, final MacAddress macAddress) {
OFOxms oxms = sw.getOFFactory().oxms();
OFActions actions = sw.getOFFactory().actions();
return actions.buildSetField()
.setField(oxms.buildEthDst().setValue(macAddress).build()).build();
}