diff options
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/BGPFsm.java')
-rw-r--r-- | src/main/java/com/lumaserv/bgp/BGPFsm.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/lumaserv/bgp/BGPFsm.java b/src/main/java/com/lumaserv/bgp/BGPFsm.java index b38ce6a..2cf598f 100644 --- a/src/main/java/com/lumaserv/bgp/BGPFsm.java +++ b/src/main/java/com/lumaserv/bgp/BGPFsm.java @@ -1,6 +1,8 @@ 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; @@ -181,11 +183,15 @@ public class BGPFsm { // - 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); setHoldTimer(4 * 60); @@ -237,11 +243,15 @@ public class BGPFsm { // - 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); setHoldTimer(4 * 60); @@ -259,6 +269,7 @@ public class BGPFsm { class OpenSent extends State { @Override void openMsg(BGPOpen msg) { + System.out.println("openMsg:" + msg); if(session.getConfiguration().getRemoteAs() == msg.getAsn()) { // - resets the DelayOpenTimer to zero, // - sets the BGP ConnectRetryTimer to zero, |