本文整理汇总了Java中org.onosproject.driver.extensions.OfdpaMatchVlanVid类的典型用法代码示例。如果您正苦于以下问题:Java OfdpaMatchVlanVid类的具体用法?Java OfdpaMatchVlanVid怎么用?Java OfdpaMatchVlanVid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OfdpaMatchVlanVid类属于org.onosproject.driver.extensions包,在下文中一共展示了OfdpaMatchVlanVid类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Activate
public void activate() {
codecService.registerCodec(MoveExtensionTreatment.class, new MoveExtensionTreatmentCodec());
codecService.registerCodec(NiciraMatchNshSi.class, new NiciraMatchNshSiCodec());
codecService.registerCodec(NiciraMatchNshSpi.class, new NiciraMatchNshSpiCodec());
codecService.registerCodec(NiciraResubmit.class, new NiciraResubmitCodec());
codecService.registerCodec(NiciraResubmitTable.class, new NiciraResubmitTableCodec());
codecService.registerCodec(NiciraSetNshSi.class, new NiciraSetNshSiCodec());
codecService.registerCodec(NiciraSetNshSpi.class, new NiciraSetNshSpiCodec());
codecService.registerCodec(NiciraSetTunnelDst.class, new NiciraSetTunnelDstCodec());
codecService.registerCodec(NiciraSetNshContextHeader.class, new NiciraSetNshContextHeaderCodec());
codecService.registerCodec(OfdpaMatchVlanVid.class, new OfdpaMatchVlanVidCodec());
codecService.registerCodec(OfdpaSetVlanVid.class, new OfdpaSetVlanVidCodec());
codecService.registerCodec(Ofdpa3SetMplsType.class, new Ofdpa3SetMplsTypeCodec());
codecService.registerCodec(Ofdpa3MatchOvid.class, new Ofdpa3MatchOvidCodec());
codecService.registerCodec(Ofdpa3SetOvid.class, new Ofdpa3SetOvidCodec());
codecService.registerCodec(Ofdpa3SetQosIndex.class, new Ofdpa3SetQosIndexCodec());
codecService.registerCodec(Ofdpa3MatchMplsL2Port.class, new Ofdpa3MatchMplsL2PortCodec());
codecService.registerCodec(Ofdpa3SetMplsL2Port.class, new Ofdpa3SetMplsL2PortCodec());
codecService.registerCodec(OplinkAttenuation.class, new OplinkAttenuationCodec());
log.info("Registered default driver codecs.");
}
示例2: deactivate
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Deactivate
public void deactivate() {
codecService.unregisterCodec(MoveExtensionTreatment.class);
codecService.unregisterCodec(NiciraMatchNshSi.class);
codecService.unregisterCodec(NiciraMatchNshSpi.class);
codecService.unregisterCodec(NiciraResubmit.class);
codecService.unregisterCodec(NiciraResubmitTable.class);
codecService.unregisterCodec(NiciraSetNshSi.class);
codecService.unregisterCodec(NiciraSetNshSpi.class);
codecService.unregisterCodec(NiciraSetTunnelDst.class);
codecService.unregisterCodec(NiciraSetNshContextHeader.class);
codecService.unregisterCodec(OfdpaMatchVlanVid.class);
codecService.unregisterCodec(OfdpaSetVlanVid.class);
codecService.unregisterCodec(Ofdpa3SetMplsType.class);
codecService.unregisterCodec(Ofdpa3MatchOvid.class);
codecService.unregisterCodec(Ofdpa3SetOvid.class);
codecService.unregisterCodec(Ofdpa3SetQosIndex.class);
codecService.unregisterCodec(Ofdpa3MatchMplsL2Port.class);
codecService.unregisterCodec(Ofdpa3SetMplsL2Port.class);
codecService.unregisterCodec(OplinkAttenuation.class);
log.info("Unregistered default driver codecs.");
}
示例3: encode
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Override
public ObjectNode encode(OfdpaMatchVlanVid vlanId, CodecContext context) {
checkNotNull(vlanId, "Vlan ID cannot be null");
ObjectNode root = context.mapper().createObjectNode()
.put(VLAN_ID, vlanId.vlanId().id());
return root;
}
示例4: decode
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Override
public OfdpaMatchVlanVid decode(ObjectNode json, CodecContext context) {
if (json == null || !json.isObject()) {
return null;
}
// parse ofdpa match vlan vid
short vlanVid = (short) nullIsIllegal(json.get(VLAN_ID),
VLAN_ID + MISSING_MEMBER_MESSAGE).asInt();
return new OfdpaMatchVlanVid(VlanId.vlanId(vlanVid));
}
示例5: activate
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Activate
public void activate() {
codecService.registerCodec(MoveExtensionTreatment.class, new MoveExtensionTreatmentCodec());
codecService.registerCodec(NiciraMatchNshSi.class, new NiciraMatchNshSiCodec());
codecService.registerCodec(NiciraMatchNshSpi.class, new NiciraMatchNshSpiCodec());
codecService.registerCodec(NiciraResubmit.class, new NiciraResubmitCodec());
codecService.registerCodec(NiciraResubmitTable.class, new NiciraResubmitTableCodec());
codecService.registerCodec(NiciraSetNshSi.class, new NiciraSetNshSiCodec());
codecService.registerCodec(NiciraSetNshSpi.class, new NiciraSetNshSpiCodec());
codecService.registerCodec(NiciraSetTunnelDst.class, new NiciraSetTunnelDstCodec());
codecService.registerCodec(NiciraSetNshContextHeader.class, new NiciraSetNshContextHeaderCodec());
codecService.registerCodec(OfdpaMatchVlanVid.class, new OfdpaMatchVlanVidCodec());
codecService.registerCodec(OfdpaSetVlanVid.class, new OfdpaSetVlanVidCodec());
log.info("Registered default driver codecs.");
}
示例6: deactivate
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Deactivate
public void deactivate() {
codecService.unregisterCodec(MoveExtensionTreatment.class);
codecService.unregisterCodec(NiciraMatchNshSi.class);
codecService.unregisterCodec(NiciraMatchNshSpi.class);
codecService.unregisterCodec(NiciraResubmit.class);
codecService.unregisterCodec(NiciraResubmitTable.class);
codecService.unregisterCodec(NiciraSetNshSi.class);
codecService.unregisterCodec(NiciraSetNshSpi.class);
codecService.unregisterCodec(NiciraSetTunnelDst.class);
codecService.unregisterCodec(NiciraSetNshContextHeader.class);
codecService.unregisterCodec(OfdpaMatchVlanVid.class);
codecService.unregisterCodec(OfdpaSetVlanVid.class);
log.info("Unregistered default driver codecs.");
}
示例7: buildTmacRuleForIpv4
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
/**
* Builds TMAC rules for IPv4 packets.
*
* @param ethCriterion dst mac matching
* @param vidCriterion vlan id assigned to the port
* @param ofdpaMatchVlanVid OFDPA vlan id matching
* @param applicationId application id
* @param pnum port number
* @return TMAC rule for IPV4 packets
*/
private FlowRule buildTmacRuleForIpv4(EthCriterion ethCriterion,
VlanIdCriterion vidCriterion,
OfdpaMatchVlanVid ofdpaMatchVlanVid,
ApplicationId applicationId,
PortNumber pnum) {
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
if (pnum != null) {
if (matchInPortTmacTable()) {
selector.matchInPort(pnum);
} else {
log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
"ignoring the IN_PORT criteria");
}
}
if (vidCriterion != null) {
if (requireVlanExtensions()) {
selector.extension(ofdpaMatchVlanVid, deviceId);
} else {
selector.matchVlanId(vidCriterion.vlanId());
}
}
selector.matchEthType(Ethernet.TYPE_IPV4);
selector.matchEthDst(ethCriterion.mac());
treatment.transition(UNICAST_ROUTING_TABLE);
return DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(DEFAULT_PRIORITY)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
}
示例8: buildTmacRuleForMpls
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
/**
* Builds TMAC rule for MPLS packets.
*
* @param ethCriterion dst mac matching
* @param vidCriterion vlan id assigned to the port
* @param ofdpaMatchVlanVid OFDPA vlan id matching
* @param applicationId application id
* @param pnum port number
* @return TMAC rule for MPLS packets
*/
private FlowRule buildTmacRuleForMpls(EthCriterion ethCriterion,
VlanIdCriterion vidCriterion,
OfdpaMatchVlanVid ofdpaMatchVlanVid,
ApplicationId applicationId,
PortNumber pnum) {
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
if (pnum != null) {
if (matchInPortTmacTable()) {
selector.matchInPort(pnum);
} else {
log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
"ignoring the IN_PORT criteria");
}
}
if (vidCriterion != null) {
if (requireVlanExtensions()) {
selector.extension(ofdpaMatchVlanVid, deviceId);
} else {
selector.matchVlanId(vidCriterion.vlanId());
}
}
selector.matchEthType(Ethernet.MPLS_UNICAST);
selector.matchEthDst(ethCriterion.mac());
treatment.transition(MPLS_TABLE_0);
return DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(DEFAULT_PRIORITY)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
}
示例9: buildTmacRuleForIpv6
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
/**
* Builds TMAC rules for IPv6 packets.
*
* @param ethCriterion dst mac matching
* @param vidCriterion vlan id assigned to the port
* @param ofdpaMatchVlanVid OFDPA vlan id matching
* @param applicationId application id
* @param pnum port number
* @return TMAC rule for IPV6 packets
*/
private FlowRule buildTmacRuleForIpv6(EthCriterion ethCriterion,
VlanIdCriterion vidCriterion,
OfdpaMatchVlanVid ofdpaMatchVlanVid,
ApplicationId applicationId,
PortNumber pnum) {
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
if (pnum != null) {
if (matchInPortTmacTable()) {
selector.matchInPort(pnum);
} else {
log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
"ignoring the IN_PORT criteria");
}
}
if (vidCriterion != null) {
if (requireVlanExtensions()) {
selector.extension(ofdpaMatchVlanVid, deviceId);
} else {
selector.matchVlanId(vidCriterion.vlanId());
}
}
selector.matchEthType(Ethernet.TYPE_IPV6);
selector.matchEthDst(ethCriterion.mac());
treatment.transition(UNICAST_ROUTING_TABLE);
return DefaultFlowRule.builder()
.forDevice(deviceId)
.withSelector(selector.build())
.withTreatment(treatment.build())
.withPriority(DEFAULT_PRIORITY)
.fromApp(applicationId)
.makePermanent()
.forTable(TMAC_TABLE).build();
}
示例10: buildIpv6Selector
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
/**
* Helper method to build Ipv6 selector using the selector provided by
* a forwarding objective.
*
* @param builderToUpdate the builder to update
* @param fwd the selector to read
* @return 0 if the update ends correctly. -1 if the matches
* are not yet supported
*/
protected int buildIpv6Selector(TrafficSelector.Builder builderToUpdate,
ForwardingObjective fwd) {
TrafficSelector selector = fwd.selector();
IpPrefix ipv6Dst = ((IPCriterion) selector.getCriterion(Criterion.Type.IPV6_DST)).ip();
if (ipv6Dst.isMulticast()) {
if (ipv6Dst.prefixLength() != IpAddress.INET6_BIT_LENGTH) {
log.warn("Multicast specific forwarding objective can only be /128");
fail(fwd, ObjectiveError.BADPARAMS);
return -1;
}
VlanId assignedVlan = readVlanFromSelector(fwd.meta());
if (assignedVlan == null) {
log.warn("VLAN ID required by multicast specific fwd obj is missing. Abort.");
fail(fwd, ObjectiveError.BADPARAMS);
return -1;
}
if (requireVlanExtensions()) {
OfdpaMatchVlanVid ofdpaMatchVlanVid = new OfdpaMatchVlanVid(assignedVlan);
builderToUpdate.extension(ofdpaMatchVlanVid, deviceId);
} else {
builderToUpdate.matchVlanId(assignedVlan);
}
builderToUpdate.matchEthType(Ethernet.TYPE_IPV6).matchIPv6Dst(ipv6Dst);
log.debug("processing IPv6 multicast specific forwarding objective {} -> next:{}"
+ " in dev:{}", fwd.id(), fwd.nextId(), deviceId);
} else {
if (ipv6Dst.prefixLength() != 0) {
builderToUpdate.matchIPv6Dst(ipv6Dst);
}
builderToUpdate.matchEthType(Ethernet.TYPE_IPV6);
log.debug("processing IPv6 unicast specific forwarding objective {} -> next:{}"
+ " in dev:{}", fwd.id(), fwd.nextId(), deviceId);
}
return 0;
}
示例11: buildIpv4Selector
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
protected int buildIpv4Selector(TrafficSelector.Builder builderToUpdate,
TrafficSelector.Builder extBuilder,
ForwardingObjective fwd,
boolean allowDefaultRoute) {
TrafficSelector selector = fwd.selector();
IpPrefix ipv4Dst = ((IPCriterion) selector.getCriterion(Criterion.Type.IPV4_DST)).ip();
if (ipv4Dst.isMulticast()) {
if (ipv4Dst.prefixLength() != 32) {
log.warn("Multicast specific forwarding objective can only be /32");
fail(fwd, ObjectiveError.BADPARAMS);
return -1;
}
VlanId assignedVlan = readVlanFromSelector(fwd.meta());
if (assignedVlan == null) {
log.warn("VLAN ID required by multicast specific fwd obj is missing. Abort.");
fail(fwd, ObjectiveError.BADPARAMS);
return -1;
}
if (requireVlanExtensions()) {
OfdpaMatchVlanVid ofdpaMatchVlanVid = new OfdpaMatchVlanVid(assignedVlan);
builderToUpdate.extension(ofdpaMatchVlanVid, deviceId);
} else {
builderToUpdate.matchVlanId(assignedVlan);
}
builderToUpdate.matchEthType(Ethernet.TYPE_IPV4).matchIPDst(ipv4Dst);
log.debug("processing IPv4 multicast specific forwarding objective {} -> next:{}"
+ " in dev:{}", fwd.id(), fwd.nextId(), deviceId);
} else {
if (ipv4Dst.prefixLength() == 0) {
if (allowDefaultRoute) {
// The entire IPV4_DST field is wildcarded intentionally
builderToUpdate.matchEthType(Ethernet.TYPE_IPV4);
} else {
// NOTE: The switch does not support matching 0.0.0.0/0
// Split it into 0.0.0.0/1 and 128.0.0.0/1
builderToUpdate.matchEthType(Ethernet.TYPE_IPV4)
.matchIPDst(IpPrefix.valueOf("0.0.0.0/1"));
extBuilder.matchEthType(Ethernet.TYPE_IPV4)
.matchIPDst(IpPrefix.valueOf("128.0.0.0/1"));
}
} else {
builderToUpdate.matchEthType(Ethernet.TYPE_IPV4).matchIPDst(ipv4Dst);
}
log.debug("processing IPv4 unicast specific forwarding objective {} -> next:{}"
+ " in dev:{}", fwd.id(), fwd.nextId(), deviceId);
}
return 0;
}
示例12: encode
import org.onosproject.driver.extensions.OfdpaMatchVlanVid; //导入依赖的package包/类
@Override
public ObjectNode encode(OfdpaMatchVlanVid vlanId, CodecContext context) {
checkNotNull(vlanId, MISSING_VLAN_ID_MESSAGE);
return context.mapper().createObjectNode()
.put(VLAN_ID, vlanId.vlanId().id());
}