public EthernetTypeBuilder(EthernetType base) { this._type = base.getType(); if (base instanceof EthernetTypeImpl) { EthernetTypeImpl _impl = (EthernetTypeImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
private void equalOrNotSetValidation(EthernetType ethTypeInMatch, long paramValue) { if (ethTypeInMatch != null) { if (paramValue != ethTypeInMatch.getType().getValue()) { throw new IllegalArgumentException(MSG_CLASSIFICATION_CONFLICT_DETECTED + " at " + EtherTypeClassifierDefinition.ETHERTYPE_PARAM + " parameter for values " + ethTypeInMatch.getType().getValue() + " and " + paramValue + ". It is not allowed " + "to assign different values to the same parameter among all the classifiers within one rule."); } } }
private boolean matchEthernetType(EthernetType ethernetType, MatchFields matchFields) { return (ethernetType == null) || (matchFields.ethernetType != null && ethernetType.getType().getValue().longValue() == matchFields.ethernetType.longValue()); }
/** * Return the ethernet type in the given {@link EthernetType} instance. * * @param etype An {@link EthernetType} instance. * @return An {@link Integer} instance if the ethernet type is present * in the given {@link EthernetType} instance. * Otherwise {@code null}. * @throws RpcException The given ethernet type is invalid. */ public static Integer getEtherType(EthernetType etype) throws RpcException { return (etype == null) ? null : getEtherType(etype.getType()); }
@Override protected void checkPrereqs(List<MatchBuilder> matches) { for (MatchBuilder match : matches) { Long readEthType = null; try { readEthType = match.getEthernetMatch().getEthernetType().getType().getValue(); } catch (NullPointerException e) { throw new IllegalArgumentException( "Parameter " + EtherTypeClassifierDefinition.ETHERTYPE_PARAM + " " + MSG_IS_MISSING); } if (!FlowUtils.IPv4.equals(readEthType) && !FlowUtils.IPv6.equals(readEthType)) { throw new IllegalArgumentException("Parameter " + EtherTypeClassifierDefinition.ETHERTYPE_PARAM + " must have value " + FlowUtils.IPv4 + " or " + FlowUtils.IPv6 + "."); } } }
private static boolean convertEthernetDlType(final MatchV10Builder matchBuilder, final EthernetMatch ethernetMatch) { if (ethernetMatch.getEthernetType() != null) { matchBuilder.setDlType(ethernetMatch.getEthernetType().getType().getValue().intValue()); return false; } return true; }
private static MatchEntry toOfEthernetType(final EthernetType ethernetType) { MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder(); matchEntryBuilder.setOxmClass(OpenflowBasicClass.class); matchEntryBuilder.setHasMask(false); matchEntryBuilder.setOxmMatchField(EthType.class); EthTypeCaseBuilder ethTypeCaseBuilder = new EthTypeCaseBuilder(); EthTypeBuilder ethTypeBuilder = new EthTypeBuilder(); EtherType etherType = new EtherType(ethernetType.getType().getValue().intValue()); ethTypeBuilder.setEthType(etherType); ethTypeCaseBuilder.setEthType(ethTypeBuilder.build()); matchEntryBuilder.setMatchEntryValue(ethTypeCaseBuilder.build()); return matchEntryBuilder.build(); }
Long etherType = match.getEthernetMatch().getEthernetType().getType().getValue(); LOG.debug("layer 3 match : {}", match.getLayer3Match());
IpMatch ipMatch = match.getIpMatch(); Layer4Match layer4Match = match.getLayer4Match(); Long etherType = match.getEthernetMatch().getEthernetType().getType().getValue();
private static void fillFrom(Match target, EthernetMatch source) { if (source == null) return; EthernetType ethType = source.getEthernetType(); if (ethType != null) { EtherType ethInnerType = ethType.getType(); if (ethInnerType != null && target.getField(DL_TYPE) == null) { Long value = ethInnerType.getValue(); target.setField(DL_TYPE, value.shortValue()); } } MacAddressFilter ethSource = source.getEthernetSource(); if (ethSource != null) { target.setField(DL_SRC, bytesFrom(ethSource.getAddress())); } MacAddressFilter ethDest = source.getEthernetDestination(); if (ethDest != null) { target.setField(DL_DST, bytesFrom(ethDest.getAddress())); } }
NodeConnectorId inPort = filterObj.getInPort(); Ipv4Prefix ipDst = ((Ipv4Match) filterObj.getLayer3Match()).getIpv4Destination(); Long ethType = filterObj.getEthernetMatch().getEthernetType().getType().getValue();
VlanId vlanID = filterObj.getVlanMatch().getVlanId(); NodeConnectorId inPort = filterObj.getInPort(); Long ethType = filterObj.getEthernetMatch().getEthernetType().getType().getValue();