@Override public AsNumber getAsNumber() { return new AsNumber(AS); }
@ConstructorProperties("value") public AsNumber(java.lang.Long _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
throw new BGPDocumentedException("BGP Protocol version " + version + " not supported.", BGPError.VERSION_NOT_SUPPORTED); final AsNumber as = new AsNumber((long) body.readUnsignedShort()); final int holdTime = body.readUnsignedShort(); if (holdTime == 1 || holdTime == 2) { return new OpenBuilder().setMyAsNumber(as.getValue().intValue()).setHoldTimer(holdTime).setBgpIdentifier(bgpId).setBgpParameters( optParams).build();
return false; } else if(!_identifier.equals(other.getIdentifier())) { return false;
return false; } else if(!_identifier.equals(other.getIdentifier())) { return false;
public ConfigBuilder setPeerAs(AsNumber value) { if (value != null) { checkPeerAsRange(value.getValue()); } this._peerAs = value; return this; } /**
public static AsNumber getDefaultInstance(String defaultValue) { return new AsNumber(Long.valueOf(defaultValue)); }
return false; } else if(!_as.equals(other.getAs())) { return false;
@ConstructorProperties("value") public AsNumber(Long _value) { if (_value != null) { check_valueRange(_value); } Objects.requireNonNull(_value, "Supplied value may not be null"); this._value = _value; }
public StateBuilder setAs(AsNumber value) { if (value != null) { checkAsRange(value.getValue()); } this._as = value; return this; } /**
public static AsNumber getDefaultInstance(String defaultValue) { return new AsNumber(java.lang.Long.valueOf(defaultValue)); }
Boolean isGlobalEqual(final Global global) { final List<AfiSafi> globalAfiSafi = global.getAfiSafis().getAfiSafi(); final AsNumber globalAs = global.getConfig().getAs(); final Ipv4Address globalRouterId = global.getConfig().getRouterId(); return this.afiSafi.containsAll(globalAfiSafi) && globalAfiSafi.containsAll(this.afiSafi) && globalAs.equals(this.asNumber) && globalRouterId.getValue().equals(this.routerId.getValue()); }
@ConstructorProperties("value") public AsNumber(java.lang.Long _value) { if (_value != null) { check_valueRange(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
public StateBuilder setPeerAs(AsNumber value) { if (value != null) { checkPeerAsRange(value.getValue()); } this._peerAs = value; return this; } /**
public static AsNumber getDefaultInstance(String defaultValue) { return new AsNumber(Long.valueOf(defaultValue)); }
return false; } else if(!_as.equals(other.getAs())) { return false;
public static LocRibWriter create(@Nonnull final RIBSupportContextRegistry registry, @Nonnull final TablesKey tablesKey, @Nonnull final DOMTransactionChain chain, @Nonnull final YangInstanceIdentifier target, @Nonnull final AsNumber ourAs, @Nonnull final DOMDataTreeChangeService service, @Nonnull final PolicyDatabase pd, final CacheDisconnectedPeers cacheDisconnectedPeers, @Nonnull final PathSelectionMode pathSelectionStrategy, @Nonnull final UnsignedInt32Counter routeCounter) { return new LocRibWriter(registry, chain, target, ourAs.getValue(), service, pd, tablesKey, cacheDisconnectedPeers, pathSelectionStrategy, routeCounter); }
@Override public AsNumber parseTlvBody(final ByteBuf value) { return new AsNumber(value.readUnsignedInt()); }
private static void validateAs(final AsNumber remoteAs, final Open openObj, final BGPSessionPreferences localPref) throws BGPDocumentedException { if (!remoteAs.equals(localPref.getExpectedRemoteAs())) { LOG.warn("Unexpected remote AS number. Expecting {}, got {}", remoteAs, localPref.getExpectedRemoteAs()); throw new BGPDocumentedException("Peer AS number mismatch", BGPError.BAD_PEER_AS); } // https://tools.ietf.org/html/rfc6286#section-2.2 if (openObj.getBgpIdentifier() != null && openObj.getBgpIdentifier().getValue().equals(localPref.getBgpId().getValue())) { LOG.warn("Remote and local BGP Identifiers are the same: {}", openObj.getBgpIdentifier()); throw new BGPDocumentedException("Remote and local BGP Identifiers are the same.", BGPError.BAD_BGP_ID); } final List<BgpParameters> prefs = openObj.getBgpParameters(); if (prefs != null) { if (getAs4BytesCapability(localPref.getParams()).isPresent() && !getAs4BytesCapability(prefs).isPresent()) { throw new BGPDocumentedException("The peer must advertise AS4Bytes capability.", BGPError.UNSUPPORTED_CAPABILITY, serializeAs4BytesCapability(getAs4BytesCapability(localPref.getParams()).get())); } if (!prefs.containsAll(localPref.getParams())) { LOG.info("BGP Open message session parameters differ, session still accepted."); } } else { throw new BGPDocumentedException("Open message unacceptable. Check the configuration of BGP speaker.", BGPError.UNSPECIFIC_OPEN_ERROR); } }