if (body.readableBytes() != 0) {
data = ByteArray.readAllBytes(body);
}
- LOG.trace("Notification message was parsed: err = {}, data = {}.", BGPError.forValue(errorCode, errorSubcode),
- Arrays.toString(data));
final NotifyBuilder builder = new NotifyBuilder().setErrorCode((short) errorCode).setErrorSubcode((short) errorSubcode);
if (data != null) {
builder.setData(data);
}
+ LOG.debug("BGP Notification message was parsed: err = {}, data = {}.", BGPError.forValue(errorCode, errorSubcode),
+ Arrays.toString(data));
return builder.build();
}
}
if (optLength > 0) {
fillParams(body.slice(body.readerIndex(), optLength), optParams);
}
- LOG.trace("Open message was parsed: AS = {}, holdTimer = {}, bgpId = {}, optParams = {}", as, holdTime, bgpId, optParams);
+ LOG.debug("BGP Open message was parsed: AS = {}, holdTimer = {}, bgpId = {}, optParams = {}", as, holdTime, bgpId, optParams);
return new OpenBuilder().setMyAsNumber(as.getValue().intValue()).setHoldTimer(holdTime).setBgpIdentifier(bgpId).setBgpParameters(
optParams).build();
}
if (nlri != null && !nlri.isEmpty()) {
eventBuilder.setNlri(new NlriBuilder().setNlri(nlri).build());
}
- LOG.trace("Update message was parsed.");
- return eventBuilder.build();
+ Update msg = eventBuilder.build();
+ LOG.debug("BGP Update message was parsed {}.", msg);
+ return msg;
}
}
this.stateTimer = Preconditions.checkNotNull(timer);
this.channel = Preconditions.checkNotNull(channel);
this.holdTimerValue = (remoteOpen.getHoldTimer() < localHoldTimer) ? remoteOpen.getHoldTimer() : localHoldTimer;
- LOG.info("HoldTimer new value: {}", this.holdTimerValue);
+ LOG.info("BGP HoldTimer new value: {}", this.holdTimerValue);
this.keepAlive = this.holdTimerValue / 3;
this.asNumber = AsNumberUtil.advertizedAsNumber(remoteOpen);
@Override
public synchronized void close() {
- LOG.debug("Closing session: {}", this);
+ LOG.info("Closing session: {}", this);
if (this.state != State.Idle) {
this.sendMessage(new NotifyBuilder().setErrorCode(BGPError.CEASE.getCode()).build());
this.channel.close();
new BGPTerminationReason(BGPError.forValue(((Notify) msg).getErrorCode(), ((Notify) msg).getErrorSubcode())));
} else if (msg instanceof Keepalive) {
// Keepalives are handled internally
- LOG.debug("Received KeepAlive messsage.");
+ LOG.trace("Received KeepAlive messsage.");
this.kaCounter++;
if (this.kaCounter >= 2) {
this.sync.kaReceived();
case Finished:
case Idle:
this.sendMessage(buildErrorNotify(BGPError.FSM_ERROR));
- // FIXME: is something missing here? (at least an explanation why fall-through is okay
+ return;
case OpenConfirm:
if (msg instanceof Keepalive) {
negotiationSuccessful(this.session);
+ LOG.info("BGP Session with peer {} established successfully.", this.channel);
} else if (msg instanceof Notify) {
final Notify ntf = (Notify) msg;
negotiationFailed(new BGPDocumentedException("Peer refusal", BGPError.forValue(ntf.getErrorCode(), ntf.getErrorSubcode())));
private void handleOpen(final Open openObj) {
final AsNumber as = AsNumberUtil.advertizedAsNumber(openObj);
if (!this.remoteAs.equals(as)) {
- LOG.info("Unexpected remote AS number. Expecting {}, got {}", this.remoteAs, as);
+ LOG.warn("Unexpected remote AS number. Expecting {}, got {}", this.remoteAs, as);
this.sendMessage(buildErrorNotify(BGPError.BAD_PEER_AS));
negotiationFailed(new BGPDocumentedException("Peer AS number mismatch", BGPError.BAD_PEER_AS));
this.state = State.Finished;
final List<BgpParameters> prefs = openObj.getBgpParameters();
if (prefs != null && !prefs.isEmpty()) {
if (!prefs.containsAll(this.localPref.getParams())) {
- LOG.info("Open message session parameters differ, session still accepted.");
+ LOG.info("BGP Open message session parameters differ, session still accepted.");
}
this.sendMessage(new KeepaliveBuilder().build());
this.session = new BGPSessionImpl(this.timer, this.listener, this.channel, openObj, this.localPref.getHoldTime());
if (!s.getEor()) {
if (!s.getUpd()) {
s.setEorTrue();
+ LOG.info("BGP Synchronization finished for table {} ", entry.getKey());
final Update up = generateEOR(entry.getKey());
LOG.debug("Sending synchronization message: {}", up);
this.listener.onMessage(this.session, up);
final TopologyKey tk = new TopologyKey(Preconditions.checkNotNull(topologyId));
this.topology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, tk).toInstance();
- LOG.debug("Initiating topology builder from {} at {}", locRibReference, topology);
+ LOG.debug("Initiating topology builder from {} at {}", locRibReference, this.topology);
DataModificationTransaction t = dataProvider.beginTransaction();
- Object o = t.readOperationalData(topology);
- Preconditions.checkState(o == null, "Data provider conflict detected on object {}", topology);
+ Object o = t.readOperationalData(this.topology);
+ Preconditions.checkState(o == null, "Data provider conflict detected on object {}", this.topology);
- t.putOperationalData(topology, new TopologyBuilder().setKey(tk).setServerProvided(Boolean.TRUE).setTopologyTypes(types).build());
+ t.putOperationalData(this.topology, new TopologyBuilder().setKey(tk).setServerProvided(Boolean.TRUE).setTopologyTypes(types).build());
Futures.addCallback(JdkFutureAdapters.listenInPoolThread(t.commit()), new FutureCallback<RpcResult<TransactionStatus>>() {
@Override
public void onSuccess(final RpcResult<TransactionStatus> result) {
@Override
public void onFailure(final Throwable t) {
- LOG.error("Failed to initiate topology {} by listener {}", topology, AbstractTopologyBuilder.this, t);
+ LOG.error("Failed to initiate topology {} by listener {}", AbstractTopologyBuilder.this.topology, AbstractTopologyBuilder.this, t);
}
});
}
public final InstanceIdentifier<Tables> tableInstanceIdentifier(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi) {
- return locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).toInstance();
+ return this.locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).toInstance();
}
protected abstract void createObject(DataModification<InstanceIdentifier<?>, DataObject> trans, InstanceIdentifier<T> id, T value);
if (id != null) {
out.add(id);
} else {
- LOG.info("Identifier {} in {} set does not contain listening class {}, ignoring it", i, set, this.idClass);
+ LOG.debug("Identifier {} in {} set does not contain listening class {}, ignoring it", i, set, this.idClass);
}
}