Shashikanth VH
Committed by Gerrit Code Review

BGP support default IPV4 unicast capability.

Change-Id: Id9ad101e82a9148ddf029fdcf6404173a9574539
...@@ -292,6 +292,7 @@ public class BgpOpenMsgVer4 implements BgpOpenMsg { ...@@ -292,6 +292,7 @@ public class BgpOpenMsgVer4 implements BgpOpenMsg {
292 private short asNumber; 292 private short asNumber;
293 private boolean isBgpIdSet = false; 293 private boolean isBgpIdSet = false;
294 private int bgpId; 294 private int bgpId;
295 + private boolean isIpV4UnicastCapabilityTlvSet = true;
295 private boolean isLargeAsCapabilityTlvSet = false; 296 private boolean isLargeAsCapabilityTlvSet = false;
296 private boolean isLsCapabilityTlvSet = false; 297 private boolean isLsCapabilityTlvSet = false;
297 private boolean isFlowSpecCapabilityTlvSet = false; 298 private boolean isFlowSpecCapabilityTlvSet = false;
...@@ -312,6 +313,13 @@ public class BgpOpenMsgVer4 implements BgpOpenMsg { ...@@ -312,6 +313,13 @@ public class BgpOpenMsgVer4 implements BgpOpenMsg {
312 throw new BgpParseException("BGPID is not set (mandatory)"); 313 throw new BgpParseException("BGPID is not set (mandatory)");
313 } 314 }
314 315
316 + if (this.isIpV4UnicastCapabilityTlvSet) {
317 + BgpValueType tlv;
318 + tlv = new MultiProtocolExtnCapabilityTlv((short) Constants.AFI_IPV4_UNICAST, RES,
319 + (byte) Constants.SAFI_IPV4_UNICAST);
320 + this.capabilityTlv.add(tlv);
321 + }
322 +
315 if (this.isLargeAsCapabilityTlvSet) { 323 if (this.isLargeAsCapabilityTlvSet) {
316 BgpValueType tlv; 324 BgpValueType tlv;
317 int value = this.asNumber; 325 int value = this.asNumber;
......
...@@ -34,7 +34,8 @@ public final class Constants { ...@@ -34,7 +34,8 @@ public final class Constants {
34 public static final short AFI_VALUE = 16388; 34 public static final short AFI_VALUE = 16388;
35 public static final byte VPN_SAFI_VALUE = (byte) 0x80; 35 public static final byte VPN_SAFI_VALUE = (byte) 0x80;
36 public static final byte SAFI_VALUE = 71; 36 public static final byte SAFI_VALUE = 71;
37 - 37 + public static final short AFI_IPV4_UNICAST = 1;
38 + public static final byte SAFI_IPV4_UNICAST = 1;
38 public static final short AFI_FLOWSPEC_VALUE = 1; 39 public static final short AFI_FLOWSPEC_VALUE = 1;
39 public static final byte SAFI_FLOWSPEC_VALUE = (byte) 133; 40 public static final byte SAFI_FLOWSPEC_VALUE = (byte) 133;
40 public static final byte VPN_SAFI_FLOWSPEC_VALUE = (byte) 134; 41 public static final byte VPN_SAFI_FLOWSPEC_VALUE = (byte) 134;
......