summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/BGPFsm.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/BGPFsm.java')
-rw-r--r--src/main/java/com/lumaserv/bgp/BGPFsm.java31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/main/java/com/lumaserv/bgp/BGPFsm.java b/src/main/java/com/lumaserv/bgp/BGPFsm.java
index 2cf598f..a2143bd 100644
--- a/src/main/java/com/lumaserv/bgp/BGPFsm.java
+++ b/src/main/java/com/lumaserv/bgp/BGPFsm.java
@@ -1,8 +1,5 @@
package com.lumaserv.bgp;
-import com.lumaserv.bgp.protocol.AFI;
-import com.lumaserv.bgp.protocol.BGPPacket;
-import com.lumaserv.bgp.protocol.SAFI;
import com.lumaserv.bgp.protocol.message.BGPNotification;
import com.lumaserv.bgp.protocol.message.BGPOpen;
import com.lumaserv.bgp.protocol.message.BGPUpdate;
@@ -15,8 +12,8 @@ import java.util.Timer;
import java.util.TimerTask;
public class BGPFsm {
- final int CONFIG_HOLD_TIME = 80; // FIXME use from configuration
- final byte CONFIG_VERSION = 4;
+ public static final int CONFIG_HOLD_TIME = 80; // FIXME use from configuration
+ public static final byte CONFIG_VERSION = 4;
public final State IDLE;
public final State CONNECT;
@@ -182,18 +179,8 @@ public class BGPFsm {
setConnectRetryTimer(0);
// - completes BGP initialization
- BGPSessionConfiguration config = session.getConfiguration();
- BGPOpen.Capabilities caps = new BGPOpen.Capabilities();
- caps.getCapabilities().add(new BGPOpen.MultiprotocolExtensionCapability(AFI.IPV4.getValue(), SAFI.UNICAST.getValue()));
- caps.getCapabilities().add(new BGPOpen.MultiprotocolExtensionCapability(AFI.IPV6.getValue(), SAFI.UNICAST.getValue()));
- BGPOpen request = new BGPOpen()
- .setAsn(config.getLocalAs())
- .setHoldTime(CONFIG_HOLD_TIME)
- .setVersion(CONFIG_VERSION)
- .setIdentifier(config.getLocalIdentifier());
- request.getOptionalParameters().add(caps);
try {
- session.sendOpen(request);
+ session.sendOpen();
setHoldTimer(4 * 60);
setState(OPEN_SENT);
} catch (IOException ex) {
@@ -242,18 +229,8 @@ public class BGPFsm {
setConnectRetryTimer(0);
// - completes the BGP initialization,
- BGPSessionConfiguration config = session.getConfiguration();
- BGPOpen.Capabilities caps = new BGPOpen.Capabilities();
- caps.getCapabilities().add(new BGPOpen.MultiprotocolExtensionCapability(AFI.IPV4.getValue(), SAFI.UNICAST.getValue()));
- caps.getCapabilities().add(new BGPOpen.MultiprotocolExtensionCapability(AFI.IPV6.getValue(), SAFI.UNICAST.getValue()));
- BGPOpen request = new BGPOpen()
- .setAsn(config.getLocalAs())
- .setHoldTime(CONFIG_HOLD_TIME)
- .setVersion(CONFIG_VERSION)
- .setIdentifier(config.getLocalIdentifier());
- request.getOptionalParameters().add(caps);
try {
- session.sendOpen(request);
+ session.sendOpen();
setHoldTimer(4 * 60);
setState(OPEN_SENT);
} catch (IOException ex) {