public static Dscp getDefaultInstance(String defaultValue) { return new Dscp(java.lang.Short.valueOf(defaultValue)); }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_vppDscpType != null) { return _vppDscpType.toString(); } if (_dscp != null) { return _dscp.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
@ConstructorProperties("value") public Dscp(Short _value) { if (_value != null) { check_valueRange(_value); } Objects.requireNonNull(_value, "Supplied value may not be null"); this._value = _value; }
@Override public Optional<MatchBuilder> process(@Nonnull IpDscpCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) { final MatchBuilder matchBuilder = data.getMatchBuilder(); final IpMatchBuilder ipMatchBuilder = data.getIpMatchBuilder(); IpDscp ipDscp = source.getIpDscp(); if (ipDscp != null) { ipMatchBuilder.setIpDscp(new Dscp(ipDscp.getDscp().getValue())); matchBuilder.setIpMatch(ipMatchBuilder.build()); } return Optional.of(matchBuilder); } }
public static Dscp getDefaultInstance(String defaultValue) { return new Dscp(Short.valueOf(defaultValue)); }
/** * Return the IP DSCP value in the given instance. * * @param vaction A {@link VtnSetInetDscpAction} instance. * @return IP DSCP value. */ private short getDscpValue(VtnSetInetDscpAction vaction) { if (vaction != null) { Dscp d = vaction.getDscp(); if (d != null) { Short v = d.getValue(); if (v != null) { return v.shortValue(); } } } return DEFAULT_VALUE; }
@ConstructorProperties("value") public Dscp(java.lang.Short _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
public static Dscp getDefaultInstance(String defaultValue) { return new Dscp(Short.valueOf(defaultValue)); }
/** * Return the IP DSCP field value configured in the given {@link Dscp} * instance. * * @param dscp A {@link Dscp} instance. * @return A {@link Short} instance if the DSCP value is present in the * given {@link Dscp} instance. * Otherwise {@code null}. * @throws RpcException The given DSCP value is invalid. */ public static Short getIpDscp(Dscp dscp) throws RpcException { Short value = null; if (dscp != null) { value = dscp.getValue(); if (value != null) { // This check can be removed when RESTCONF implements the // restriction check. checkIpDscp(value.shortValue()); } } return value; }
@ConstructorProperties("value") public Dscp(java.lang.Short _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
private DscpType parseDscp(final byte dscp, final byte conformActionType) { if (dscp == -1 || conformActionType != 2) { return null; } VppDscpType vppDcspType = VppDscpType.forValue(dscp); if (vppDcspType != null) { return new DscpType(vppDcspType); } return new DscpType(new Dscp((short) dscp)); }
@Override public void serialize(MatchEntry entry, ByteBuf outBuffer) { super.serialize(entry, outBuffer); IpDscpCase entryValue = (IpDscpCase) entry.getMatchEntryValue(); outBuffer.writeByte(entryValue.getIpDscp().getDscp().getValue()); }
@Nonnull @Override public Optional<Action> process(@Nonnull final SetNwTosActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) { SetNwTosAction setnwtosaction = source.getSetNwTosAction(); SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder(); SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder(); List<MatchEntry> entries = new ArrayList<>(); entries.add(MatchConvertorUtil.toOfIpDscp(new Dscp( ActionUtil.tosToDscp(setnwtosaction.getTos().shortValue()) ))); setFieldBuilder.setMatchEntry(entries); setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build()); return Optional.of(new ActionBuilder() .setActionChoice(setFieldCaseBuilder.build()) .build()); } }
private static boolean convertNwTos(final MatchV10Builder matchBuilder, final IpMatch ipMatch) { if (ipMatch.getIpDscp() != null) { matchBuilder.setNwTos(ActionUtil.dscpToTos(ipMatch.getIpDscp().getValue())); return false; } return true; }
public static void addMatchDscp(MatchBuilder match, short dscpVal) { addMatchEtherType(match, ETHERTYPE_IPV4); IpMatchBuilder ipMatch = new IpMatchBuilder(); Dscp dscp = new Dscp(dscpVal); ipMatch.setIpDscp(dscp); match.setIpMatch(mergeIpMatch(match, ipMatch)); }
private byte parseDscp(@Nonnull MeterActionParams actionParams) { final DscpType dscp = actionParams.getDscp(); if (dscp == null) { return 0; } final Class<? extends MeterActionType> meterActionType = actionParams.getMeterActionType(); checkArgument(MeterActionMarkDscp.class == meterActionType, "dcsp is supported only for meter-action-mark-dscp, but %s defined", meterActionType); if (dscp.getVppDscpType() != null) { return (byte) dscp.getVppDscpType().getIntValue(); } if (dscp.getDscp() != null) { return dscp.getDscp().getValue().byteValue(); } return 0; }
/** * Create a new {@link VtnSetInetDscpActionCase} instance. * * @param d A {@link Short} instance which specifies the DSCP value. * @return A {@link VtnSetInetDscpActionCase} instance. */ public static VtnSetInetDscpActionCase newVtnAction(Short d) { VtnSetInetDscpAction vaction = new VtnSetInetDscpActionBuilder(). setDscp(new Dscp(d)).build(); return new VtnSetInetDscpActionCaseBuilder(). setVtnSetInetDscpAction(vaction).build(); }
request.match[baseOffset + DSCP_OFFSET] = (byte) (DSCP_MASK & (aceIp.getDscp().getValue() << 2));
/** * Configure the condition represented by this instance into the given * MD-SAL flow match builder. * * @param builder A {@link MatchBuilder} instance. */ public void setMatch(MatchBuilder builder) { IpMatchBuilder imatch; if (protocol == null) { imatch = null; } else { imatch = create((IpMatchBuilder)null).setIpProtocol(protocol); } if (dscp != null) { imatch = create(imatch).setIpDscp(new Dscp(dscp)); } if (imatch != null) { builder.setIpMatch(imatch.build()); } }
final int dscp = aceIp.getDscp().getValue();