/**
* Cease. 6/0
*/
- CEASE((short) 6, (short) 0);
+ CEASE((short) 6, (short) 0),
+ /**
+ * Maximum Number of Prefixes Reached. 6/1
+ */
+ MAX_NUMBER_OF_PREFIXES_REACHED((short) 6, (short) 1),
+ /**
+ * Administrative Shutdown. 6/2
+ */
+ ADMINISTRATIVE_SHUTDOWN((short) 6, (short) 2),
+ /**
+ * Peer De-configured. 6/3
+ */
+ PEER_DECONFIGURED((short) 6, (short) 3),
+ /**
+ * Administrative Reset. 6/4
+ */
+ ADMINISTRATIVE_RESTART((short) 6, (short) 4),
+ /**
+ * Connection Rejected. 6/5
+ */
+ CONNECTION_REJECTED((short) 6, (short) 5),
+ /**
+ * Other Configuration Change. 6/6
+ */
+ OTHER_CONFIGURATION_CHANGE((short) 6, (short) 6),
+ /**
+ * Connection Collision Resolution. 6/7
+ */
+ CONNECTION_COLLISION_RESOLUTION((short) 6, (short) 7),
+ /**
+ * Out of Resources. 6/8
+ */
+ OUT_OF_RESOURCES((short) 6, (short) 8);
private static final Map<BGPErrorIdentifier, BGPError> VALUE_MAP;
final BGPDocumentedException cause = new BGPDocumentedException(
"BGP peer with ip: " + getRemoteIp()
+ " not configured, check configured peers in : "
- + this.registry, BGPError.CEASE);
+ + this.registry, BGPError.CONNECTION_REJECTED);
negotiationFailed(cause);
return;
}
public synchronized void close() {
LOG.info("Closing session: {}", this);
if (this.state != State.Idle) {
- this.sendMessage(new NotifyBuilder().setErrorCode(BGPError.CEASE.getCode()).setErrorSubcode((short)0).build());
+ this.sendMessage(new NotifyBuilder().setErrorCode(BGPError.CEASE.getCode()).setErrorSubcode(
+ BGPError.CEASE.getSubcode()).build());
this.channel.close();
this.state = State.Idle;
}
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
-
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.Map;
-
import javax.annotation.concurrent.GuardedBy;
import javax.annotation.concurrent.ThreadSafe;
-
import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
import org.opendaylight.protocol.bgp.parser.BGPError;
import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
throw new BGPDocumentedException(
String.format("BGP session with %s %s has to be dropped. Same session already present %s",
ip, currentConnection, previousConnection),
- BGPError.CEASE);
+ BGPError.CONNECTION_COLLISION_RESOLUTION);
// Session reestablished with lower source bgp id, dropping current
} else if (previousConnection.isHigherDirection(currentConnection)) {
throw new BGPDocumentedException(
String.format("BGP session with %s initiated %s has to be dropped. Opposite session already present",
ip, currentConnection),
- BGPError.CEASE);
+ BGPError.CONNECTION_COLLISION_RESOLUTION);
// Session reestablished with higher source bgp id, dropping previous
} else if (currentConnection.isHigherDirection(previousConnection)) {
throw new BGPDocumentedException(
String.format("BGP session with %s initiated %s has to be dropped. Same session already present",
ip, currentConnection),
- BGPError.CEASE);
+ BGPError.CONNECTION_COLLISION_RESOLUTION);
}
}