Committed by
Gerrit Code Review
[ONOS-3845] BGP FlowSpec capability handling.
Change-Id: I5368dea5a0d959399550737ccf6eb6742a7510b9
Showing
6 changed files
with
122 additions
and
18 deletions
| ... | @@ -61,7 +61,7 @@ public interface BgpCfg { | ... | @@ -61,7 +61,7 @@ public interface BgpCfg { |
| 61 | /** | 61 | /** |
| 62 | * Get the status of the link state support for this BGP speaker. | 62 | * Get the status of the link state support for this BGP speaker. |
| 63 | * | 63 | * |
| 64 | - * @return true if the link state is supported else false | 64 | + * @return true if the link state is supported else false |
| 65 | */ | 65 | */ |
| 66 | boolean getLsCapability(); | 66 | boolean getLsCapability(); |
| 67 | 67 | ||
| ... | @@ -73,6 +73,20 @@ public interface BgpCfg { | ... | @@ -73,6 +73,20 @@ public interface BgpCfg { |
| 73 | void setLsCapability(boolean lscapability); | 73 | void setLsCapability(boolean lscapability); |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | + * Get the status of the flow specification support for this BGP speaker. | ||
| 77 | + * | ||
| 78 | + * @return true if the flow specification is supported otherwise false | ||
| 79 | + */ | ||
| 80 | + boolean flowSpecCapability(); | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * Set the flow specification support to this BGP speaker. | ||
| 84 | + * | ||
| 85 | + * @param flowSpecCapability BGP flow specification capability support | ||
| 86 | + */ | ||
| 87 | + void setFlowSpecCapability(boolean flowSpecCapability); | ||
| 88 | + | ||
| 89 | + /** | ||
| 76 | * Get the status of the 32 bit AS support for this BGP speaker. | 90 | * Get the status of the 32 bit AS support for this BGP speaker. |
| 77 | * | 91 | * |
| 78 | * @return true if the 32 bit AS number is supported else false | 92 | * @return true if the 32 bit AS number is supported else false |
| ... | @@ -82,7 +96,7 @@ public interface BgpCfg { | ... | @@ -82,7 +96,7 @@ public interface BgpCfg { |
| 82 | /** | 96 | /** |
| 83 | * Set the 32 bit AS support capability to this BGP speaker. | 97 | * Set the 32 bit AS support capability to this BGP speaker. |
| 84 | * | 98 | * |
| 85 | - * @param largeAs true value if the 32 bit AS is supported else false | 99 | + * @param largeAs true value if the 32 bit AS is supported else false |
| 86 | */ | 100 | */ |
| 87 | void setLargeASCapability(boolean largeAs); | 101 | void setLargeASCapability(boolean largeAs); |
| 88 | 102 | ||
| ... | @@ -166,7 +180,7 @@ public interface BgpCfg { | ... | @@ -166,7 +180,7 @@ public interface BgpCfg { |
| 166 | /** | 180 | /** |
| 167 | * Set the Router ID of this BGP speaker. | 181 | * Set the Router ID of this BGP speaker. |
| 168 | * | 182 | * |
| 169 | - * @param routerid IP address in string format | 183 | + * @param routerid IP address in string format |
| 170 | */ | 184 | */ |
| 171 | void setRouterId(String routerid); | 185 | void setRouterId(String routerid); |
| 172 | 186 | ||
| ... | @@ -174,7 +188,7 @@ public interface BgpCfg { | ... | @@ -174,7 +188,7 @@ public interface BgpCfg { |
| 174 | * Add the BGP peer IP address and the AS number to which it belongs. | 188 | * Add the BGP peer IP address and the AS number to which it belongs. |
| 175 | * | 189 | * |
| 176 | * @param routerid IP address in string format | 190 | * @param routerid IP address in string format |
| 177 | - * @param remoteAs AS number to which it belongs | 191 | + * @param remoteAs AS number to which it belongs |
| 178 | * | 192 | * |
| 179 | * @return true if added successfully else false | 193 | * @return true if added successfully else false |
| 180 | */ | 194 | */ |
| ... | @@ -197,7 +211,7 @@ public interface BgpCfg { | ... | @@ -197,7 +211,7 @@ public interface BgpCfg { |
| 197 | * @param remoteAs AS number to which it belongs | 211 | * @param remoteAs AS number to which it belongs |
| 198 | * @param holdTime keep alive time for the connection | 212 | * @param holdTime keep alive time for the connection |
| 199 | * | 213 | * |
| 200 | - * @return true if added successfully else false | 214 | + * @return true if added successfully else false |
| 201 | */ | 215 | */ |
| 202 | boolean addPeer(String routerid, int remoteAs, short holdTime); | 216 | boolean addPeer(String routerid, int remoteAs, short holdTime); |
| 203 | 217 | ||
| ... | @@ -215,14 +229,14 @@ public interface BgpCfg { | ... | @@ -215,14 +229,14 @@ public interface BgpCfg { |
| 215 | * | 229 | * |
| 216 | * @param routerid router IP address | 230 | * @param routerid router IP address |
| 217 | * | 231 | * |
| 218 | - * @return true of the configuration is found and able to connect else false | 232 | + * @return true of the configuration is found and able to connect else false |
| 219 | */ | 233 | */ |
| 220 | boolean connectPeer(String routerid); | 234 | boolean connectPeer(String routerid); |
| 221 | 235 | ||
| 222 | /** | 236 | /** |
| 223 | * Disconnect this BGP peer with this IP address. | 237 | * Disconnect this BGP peer with this IP address. |
| 224 | * | 238 | * |
| 225 | - * @param routerid router IP address in string format | 239 | + * @param routerid router IP address in string format |
| 226 | * | 240 | * |
| 227 | * @return true if the configuration is found and able to disconnect else false | 241 | * @return true if the configuration is found and able to disconnect else false |
| 228 | */ | 242 | */ |
| ... | @@ -247,9 +261,9 @@ public interface BgpCfg { | ... | @@ -247,9 +261,9 @@ public interface BgpCfg { |
| 247 | /** | 261 | /** |
| 248 | * Check if this BGP peer is configured. | 262 | * Check if this BGP peer is configured. |
| 249 | * | 263 | * |
| 250 | - * @param routerid router IP address in string format | 264 | + * @param routerid router IP address in string format |
| 251 | * | 265 | * |
| 252 | - * @return true if configured exists else false | 266 | + * @return true if configured exists else false |
| 253 | */ | 267 | */ |
| 254 | boolean isPeerConfigured(String routerid); | 268 | boolean isPeerConfigured(String routerid); |
| 255 | 269 | ||
| ... | @@ -272,7 +286,7 @@ public interface BgpCfg { | ... | @@ -272,7 +286,7 @@ public interface BgpCfg { |
| 272 | /** | 286 | /** |
| 273 | * Set the current connection state information. | 287 | * Set the current connection state information. |
| 274 | * | 288 | * |
| 275 | - * @param routerid router IP address in string format | 289 | + * @param routerid router IP address in string format |
| 276 | * @param state state information | 290 | * @param state state information |
| 277 | */ | 291 | */ |
| 278 | void setPeerConnState(String routerid, BgpPeerCfg.State state); | 292 | void setPeerConnState(String routerid, BgpPeerCfg.State state); |
| ... | @@ -280,9 +294,9 @@ public interface BgpCfg { | ... | @@ -280,9 +294,9 @@ public interface BgpCfg { |
| 280 | /** | 294 | /** |
| 281 | * Check if the peer can be connected or not. | 295 | * Check if the peer can be connected or not. |
| 282 | * | 296 | * |
| 283 | - * @param routerid router IP address in string format | 297 | + * @param routerid router IP address in string format |
| 284 | * | 298 | * |
| 285 | - * @return true if the peer can be connected else false | 299 | + * @return true if the peer can be connected else false |
| 286 | */ | 300 | */ |
| 287 | boolean isPeerConnectable(String routerid); | 301 | boolean isPeerConnectable(String routerid); |
| 288 | 302 | ... | ... |
| ... | @@ -13,7 +13,10 @@ | ... | @@ -13,7 +13,10 @@ |
| 13 | 13 | ||
| 14 | package org.onosproject.bgp.controller; | 14 | package org.onosproject.bgp.controller; |
| 15 | 15 | ||
| 16 | +import java.util.List; | ||
| 17 | + | ||
| 16 | import org.onosproject.bgpio.protocol.BgpVersion; | 18 | import org.onosproject.bgpio.protocol.BgpVersion; |
| 19 | +import org.onosproject.bgpio.types.BgpValueType; | ||
| 17 | 20 | ||
| 18 | /** | 21 | /** |
| 19 | * Abstraction of an BGP session info. Maintian session parameters obtained during session creation. | 22 | * Abstraction of an BGP session info. Maintian session parameters obtained during session creation. |
| ... | @@ -67,4 +70,11 @@ public interface BgpSessionInfo { | ... | @@ -67,4 +70,11 @@ public interface BgpSessionInfo { |
| 67 | * @return bgp identifier. | 70 | * @return bgp identifier. |
| 68 | */ | 71 | */ |
| 69 | int remoteBgpIdentifier(); | 72 | int remoteBgpIdentifier(); |
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * Gets the BGP capabilities for this BGP peer. | ||
| 76 | + * | ||
| 77 | + * @return BGP peer capabilities. | ||
| 78 | + */ | ||
| 79 | + List<BgpValueType> remoteBgpCapability(); | ||
| 70 | } | 80 | } | ... | ... |
| ... | @@ -34,6 +34,11 @@ public final class Constants { | ... | @@ -34,6 +34,11 @@ 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 | + | ||
| 38 | + public static final short AFI_FLOWSPEC_VALUE = 1; | ||
| 39 | + public static final byte SAFI_FLOWSPEC_VALUE = (byte) 133; | ||
| 40 | + public static final byte VPN_SAFI_FLOWSPEC_VALUE = (byte) 134; | ||
| 41 | + | ||
| 37 | public static final int EXTRA_TRAFFIC = 0x01; | 42 | public static final int EXTRA_TRAFFIC = 0x01; |
| 38 | public static final int UNPROTECTED = 0x02; | 43 | public static final int UNPROTECTED = 0x02; |
| 39 | public static final int SHARED = 0x04; | 44 | public static final int SHARED = 0x04; |
| ... | @@ -41,4 +46,23 @@ public final class Constants { | ... | @@ -41,4 +46,23 @@ public final class Constants { |
| 41 | public static final int DEDICATED_ONE_PLUS_ONE = 0x10; | 46 | public static final int DEDICATED_ONE_PLUS_ONE = 0x10; |
| 42 | public static final int ENHANCED = 0x20; | 47 | public static final int ENHANCED = 0x20; |
| 43 | public static final int RESERVED = 0x40; | 48 | public static final int RESERVED = 0x40; |
| 49 | + | ||
| 50 | + public static final byte BGP_FLOWSPEC_DST_PREFIX = 0x01; | ||
| 51 | + public static final byte BGP_FLOWSPEC_SRC_PREFIX = 0x02; | ||
| 52 | + public static final byte BGP_FLOWSPEC_IP_PROTO = 0x03; | ||
| 53 | + public static final byte BGP_FLOWSPEC_PORT = 0x04; | ||
| 54 | + public static final byte BGP_FLOWSPEC_DST_PORT = 0x05; | ||
| 55 | + public static final byte BGP_FLOWSPEC_SRC_PORT = 0x06; | ||
| 56 | + public static final byte BGP_FLOWSPEC_ICMP_TP = 0x07; | ||
| 57 | + public static final byte BGP_FLOWSPEC_ICMP_CD = 0x08; | ||
| 58 | + public static final byte BGP_FLOWSPEC_TCP_FLAGS = 0x09; | ||
| 59 | + public static final byte BGP_FLOWSPEC_PCK_LEN = 0x10; | ||
| 60 | + public static final byte BGP_FLOWSPEC_DSCP = 0x11; | ||
| 61 | + public static final byte BGP_FLOWSPEC_FRAGMENT = 0x12; | ||
| 62 | + | ||
| 63 | + public static final short BGP_FLOWSPEC_ACTION_TRAFFIC_RATE = (short) 0x8006; | ||
| 64 | + public static final short BGP_FLOWSPEC_ACTION_TRAFFIC_ACTION = (short) 0x8007; | ||
| 65 | + public static final short BGP_FLOWSPEC_ACTION_TRAFFIC_REDIRECT = (short) 0x8008; | ||
| 66 | + public static final short BGP_FLOWSPEC_ACTION_TRAFFIC_MARKING = (short) 0x8009; | ||
| 67 | + | ||
| 44 | } | 68 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -44,6 +44,7 @@ import org.onosproject.bgpio.types.BgpErrorType; | ... | @@ -44,6 +44,7 @@ import org.onosproject.bgpio.types.BgpErrorType; |
| 44 | import org.onosproject.bgpio.types.BgpValueType; | 44 | import org.onosproject.bgpio.types.BgpValueType; |
| 45 | import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv; | 45 | import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv; |
| 46 | import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv; | 46 | import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv; |
| 47 | +import org.onosproject.bgpio.util.Constants; | ||
| 47 | import org.slf4j.Logger; | 48 | import org.slf4j.Logger; |
| 48 | import org.slf4j.LoggerFactory; | 49 | import org.slf4j.LoggerFactory; |
| 49 | 50 | ||
| ... | @@ -108,6 +109,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -108,6 +109,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 108 | private SocketAddress address; | 109 | private SocketAddress address; |
| 109 | private String peerAddr; | 110 | private String peerAddr; |
| 110 | private BgpCfg bgpconfig; | 111 | private BgpCfg bgpconfig; |
| 112 | + List<BgpValueType> remoteBgpCapability; | ||
| 111 | 113 | ||
| 112 | /** | 114 | /** |
| 113 | * Create a new unconnected BGPChannelHandler. | 115 | * Create a new unconnected BGPChannelHandler. |
| ... | @@ -171,6 +173,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -171,6 +173,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 171 | return; | 173 | return; |
| 172 | } | 174 | } |
| 173 | log.debug("Sending handshake OPEN message"); | 175 | log.debug("Sending handshake OPEN message"); |
| 176 | + h.remoteBgpCapability = pOpenmsg.getCapabilityTlv(); | ||
| 174 | 177 | ||
| 175 | /* | 178 | /* |
| 176 | * RFC 4271, section 4.2: Upon receipt of an OPEN message, a BGP speaker MUST calculate the | 179 | * RFC 4271, section 4.2: Upon receipt of an OPEN message, a BGP speaker MUST calculate the |
| ... | @@ -225,6 +228,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -225,6 +228,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 225 | return; | 228 | return; |
| 226 | } | 229 | } |
| 227 | log.debug("Sending handshake OPEN message"); | 230 | log.debug("Sending handshake OPEN message"); |
| 231 | + h.remoteBgpCapability = pOpenmsg.getCapabilityTlv(); | ||
| 228 | 232 | ||
| 229 | /* | 233 | /* |
| 230 | * RFC 4271, section 4.2: Upon receipt of an OPEN message, a BGP speaker MUST calculate the | 234 | * RFC 4271, section 4.2: Upon receipt of an OPEN message, a BGP speaker MUST calculate the |
| ... | @@ -277,7 +281,8 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -277,7 +281,8 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 277 | h.negotiatedHoldTime = (h.peerHoldTime < h.bgpconfig.getHoldTime()) ? h.peerHoldTime | 281 | h.negotiatedHoldTime = (h.peerHoldTime < h.bgpconfig.getHoldTime()) ? h.peerHoldTime |
| 278 | : h.bgpconfig.getHoldTime(); | 282 | : h.bgpconfig.getHoldTime(); |
| 279 | h.sessionInfo = new BgpSessionInfoImpl(h.thisbgpId, h.bgpVersion, h.peerAsNum, h.peerHoldTime, | 283 | h.sessionInfo = new BgpSessionInfoImpl(h.thisbgpId, h.bgpVersion, h.peerAsNum, h.peerHoldTime, |
| 280 | - h.peerIdentifier, h.negotiatedHoldTime, h.isIbgpSession); | 284 | + h.peerIdentifier, h.negotiatedHoldTime, h.isIbgpSession, |
| 285 | + h.remoteBgpCapability); | ||
| 281 | 286 | ||
| 282 | h.bgpPeer = h.peerManager.getBgpPeerInstance(h.bgpController, h.sessionInfo, h.bgpPacketStats); | 287 | h.bgpPeer = h.peerManager.getBgpPeerInstance(h.bgpController, h.sessionInfo, h.bgpPacketStats); |
| 283 | // set the status of bgp as connected | 288 | // set the status of bgp as connected |
| ... | @@ -760,7 +765,6 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -760,7 +765,6 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 760 | private boolean capabilityValidation(BgpChannelHandler h, BgpOpenMsg openmsg) throws BgpParseException { | 765 | private boolean capabilityValidation(BgpChannelHandler h, BgpOpenMsg openmsg) throws BgpParseException { |
| 761 | log.debug("capabilityValidation"); | 766 | log.debug("capabilityValidation"); |
| 762 | 767 | ||
| 763 | - boolean isMultiProtocolcapabilityExists = false; | ||
| 764 | boolean isFourOctetCapabilityExits = false; | 768 | boolean isFourOctetCapabilityExits = false; |
| 765 | int capAsNum = 0; | 769 | int capAsNum = 0; |
| 766 | 770 | ||
| ... | @@ -771,11 +775,27 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -771,11 +775,27 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 771 | BgpValueType tempTlv; | 775 | BgpValueType tempTlv; |
| 772 | boolean isLargeAsCapabilityCfg = h.bgpconfig.getLargeASCapability(); | 776 | boolean isLargeAsCapabilityCfg = h.bgpconfig.getLargeASCapability(); |
| 773 | boolean isLsCapabilityCfg = h.bgpconfig.getLsCapability(); | 777 | boolean isLsCapabilityCfg = h.bgpconfig.getLsCapability(); |
| 778 | + boolean isFlowSpecCapabilityCfg = h.bgpconfig.flowSpecCapability(); | ||
| 779 | + MultiProtocolExtnCapabilityTlv tempCapability; | ||
| 780 | + boolean isMultiProtocolLsCapability = false; | ||
| 781 | + boolean isMultiProtocolFlowSpecCapability = false; | ||
| 782 | + boolean isMultiProtocolVpnFlowSpecCapability = false; | ||
| 774 | 783 | ||
| 775 | while (listIterator.hasNext()) { | 784 | while (listIterator.hasNext()) { |
| 776 | BgpValueType tlv = listIterator.next(); | 785 | BgpValueType tlv = listIterator.next(); |
| 777 | if (tlv.getType() == MULTI_PROTOCOL_EXTN_CAPA_TYPE) { | 786 | if (tlv.getType() == MULTI_PROTOCOL_EXTN_CAPA_TYPE) { |
| 778 | - isMultiProtocolcapabilityExists = true; | 787 | + tempCapability = (MultiProtocolExtnCapabilityTlv) tlv; |
| 788 | + if (Constants.SAFI_FLOWSPEC_VALUE == tempCapability.getSafi()) { | ||
| 789 | + isMultiProtocolFlowSpecCapability = true; | ||
| 790 | + } | ||
| 791 | + | ||
| 792 | + if (Constants.VPN_SAFI_FLOWSPEC_VALUE == tempCapability.getSafi()) { | ||
| 793 | + isMultiProtocolVpnFlowSpecCapability = true; | ||
| 794 | + } | ||
| 795 | + | ||
| 796 | + if (SAFI == tempCapability.getSafi()) { | ||
| 797 | + isMultiProtocolLsCapability = true; | ||
| 798 | + } | ||
| 779 | } | 799 | } |
| 780 | if (tlv.getType() == FOUR_OCTET_AS_NUM_CAPA_TYPE) { | 800 | if (tlv.getType() == FOUR_OCTET_AS_NUM_CAPA_TYPE) { |
| 781 | isFourOctetCapabilityExits = true; | 801 | isFourOctetCapabilityExits = true; |
| ... | @@ -796,12 +816,26 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -796,12 +816,26 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 796 | } | 816 | } |
| 797 | 817 | ||
| 798 | if ((isLsCapabilityCfg)) { | 818 | if ((isLsCapabilityCfg)) { |
| 799 | - if (!isMultiProtocolcapabilityExists) { | 819 | + if (!isMultiProtocolLsCapability) { |
| 800 | tempTlv = new MultiProtocolExtnCapabilityTlv(AFI, RES, SAFI); | 820 | tempTlv = new MultiProtocolExtnCapabilityTlv(AFI, RES, SAFI); |
| 801 | unSupportedCapabilityTlv.add(tempTlv); | 821 | unSupportedCapabilityTlv.add(tempTlv); |
| 802 | } | 822 | } |
| 803 | } | 823 | } |
| 804 | 824 | ||
| 825 | + if ((isFlowSpecCapabilityCfg)) { | ||
| 826 | + if (!isMultiProtocolFlowSpecCapability) { | ||
| 827 | + tempTlv = new MultiProtocolExtnCapabilityTlv(Constants.AFI_FLOWSPEC_VALUE, | ||
| 828 | + RES, Constants.SAFI_FLOWSPEC_VALUE); | ||
| 829 | + unSupportedCapabilityTlv.add(tempTlv); | ||
| 830 | + } | ||
| 831 | + | ||
| 832 | + if (!isMultiProtocolVpnFlowSpecCapability) { | ||
| 833 | + tempTlv = new MultiProtocolExtnCapabilityTlv(Constants.AFI_FLOWSPEC_VALUE, | ||
| 834 | + RES, Constants.VPN_SAFI_FLOWSPEC_VALUE); | ||
| 835 | + unSupportedCapabilityTlv.add(tempTlv); | ||
| 836 | + } | ||
| 837 | + } | ||
| 838 | + | ||
| 805 | if ((isLargeAsCapabilityCfg)) { | 839 | if ((isLargeAsCapabilityCfg)) { |
| 806 | if (!isFourOctetCapabilityExits) { | 840 | if (!isFourOctetCapabilityExits) { |
| 807 | tempTlv = new FourOctetAsNumCapabilityTlv(h.bgpconfig.getAsNumber()); | 841 | tempTlv = new FourOctetAsNumCapabilityTlv(h.bgpconfig.getAsNumber()); |
| ... | @@ -809,7 +843,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -809,7 +843,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler { |
| 809 | } | 843 | } |
| 810 | } | 844 | } |
| 811 | 845 | ||
| 812 | - if (unSupportedCaplistIterator.hasNext()) { | 846 | + if (unSupportedCapabilityTlv.size() == 3) { |
| 813 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); | 847 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 814 | while (unSupportedCaplistIterator.hasNext()) { | 848 | while (unSupportedCaplistIterator.hasNext()) { |
| 815 | BgpValueType tlv = unSupportedCaplistIterator.next(); | 849 | BgpValueType tlv = unSupportedCaplistIterator.next(); | ... | ... |
| ... | @@ -47,6 +47,7 @@ public class BgpConfig implements BgpCfg { | ... | @@ -47,6 +47,7 @@ public class BgpConfig implements BgpCfg { |
| 47 | private int localAs; | 47 | private int localAs; |
| 48 | private int maxSession; | 48 | private int maxSession; |
| 49 | private boolean lsCapability; | 49 | private boolean lsCapability; |
| 50 | + private boolean flowSpecCapability; | ||
| 50 | private short holdTime; | 51 | private short holdTime; |
| 51 | private boolean largeAs = false; | 52 | private boolean largeAs = false; |
| 52 | private int maxConnRetryTime; | 53 | private int maxConnRetryTime; |
| ... | @@ -119,6 +120,16 @@ public class BgpConfig implements BgpCfg { | ... | @@ -119,6 +120,16 @@ public class BgpConfig implements BgpCfg { |
| 119 | } | 120 | } |
| 120 | 121 | ||
| 121 | @Override | 122 | @Override |
| 123 | + public boolean flowSpecCapability() { | ||
| 124 | + return this.flowSpecCapability; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + @Override | ||
| 128 | + public void setFlowSpecCapability(boolean vpnFlowSpecCapability) { | ||
| 129 | + this.flowSpecCapability = flowSpecCapability; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + @Override | ||
| 122 | public String getRouterId() { | 133 | public String getRouterId() { |
| 123 | if (this.routerId != null) { | 134 | if (this.routerId != null) { |
| 124 | return this.routerId.toString(); | 135 | return this.routerId.toString(); | ... | ... |
| ... | @@ -13,9 +13,12 @@ | ... | @@ -13,9 +13,12 @@ |
| 13 | 13 | ||
| 14 | package org.onosproject.bgp.controller.impl; | 14 | package org.onosproject.bgp.controller.impl; |
| 15 | 15 | ||
| 16 | +import java.util.List; | ||
| 17 | + | ||
| 16 | import org.onosproject.bgp.controller.BgpId; | 18 | import org.onosproject.bgp.controller.BgpId; |
| 17 | import org.onosproject.bgp.controller.BgpSessionInfo; | 19 | import org.onosproject.bgp.controller.BgpSessionInfo; |
| 18 | import org.onosproject.bgpio.protocol.BgpVersion; | 20 | import org.onosproject.bgpio.protocol.BgpVersion; |
| 21 | +import org.onosproject.bgpio.types.BgpValueType; | ||
| 19 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| 20 | import org.slf4j.LoggerFactory; | 23 | import org.slf4j.LoggerFactory; |
| 21 | 24 | ||
| ... | @@ -32,6 +35,7 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { | ... | @@ -32,6 +35,7 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { |
| 32 | private int remoteBgpIdentifier; | 35 | private int remoteBgpIdentifier; |
| 33 | private short negotiatedholdTime; | 36 | private short negotiatedholdTime; |
| 34 | private boolean isIbgpSession; | 37 | private boolean isIbgpSession; |
| 38 | + List<BgpValueType> remoteBgpCapability; | ||
| 35 | 39 | ||
| 36 | /** | 40 | /** |
| 37 | * Initialize session info. | 41 | * Initialize session info. |
| ... | @@ -43,10 +47,11 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { | ... | @@ -43,10 +47,11 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { |
| 43 | *@param remoteBgpIdentifier remote peer identifier | 47 | *@param remoteBgpIdentifier remote peer identifier |
| 44 | *@param negotiatedholdTime negotiated hold time | 48 | *@param negotiatedholdTime negotiated hold time |
| 45 | *@param isIbgpSession session type ibgp/ebgp | 49 | *@param isIbgpSession session type ibgp/ebgp |
| 50 | + *@param remoteBgpCapability remote peer capabilities | ||
| 46 | */ | 51 | */ |
| 47 | public BgpSessionInfoImpl(BgpId remoteBgpId, BgpVersion remoteBgpVersion, long remoteBgpASNum, | 52 | public BgpSessionInfoImpl(BgpId remoteBgpId, BgpVersion remoteBgpVersion, long remoteBgpASNum, |
| 48 | short remoteBgpholdTime, int remoteBgpIdentifier, short negotiatedholdTime, | 53 | short remoteBgpholdTime, int remoteBgpIdentifier, short negotiatedholdTime, |
| 49 | - boolean isIbgpSession) { | 54 | + boolean isIbgpSession, List<BgpValueType> remoteBgpCapability) { |
| 50 | this.remoteBgpId = remoteBgpId; | 55 | this.remoteBgpId = remoteBgpId; |
| 51 | this.remoteBgpVersion = remoteBgpVersion; | 56 | this.remoteBgpVersion = remoteBgpVersion; |
| 52 | this.remoteBgpASNum = remoteBgpASNum; | 57 | this.remoteBgpASNum = remoteBgpASNum; |
| ... | @@ -54,6 +59,12 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { | ... | @@ -54,6 +59,12 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { |
| 54 | this.remoteBgpIdentifier = remoteBgpIdentifier; | 59 | this.remoteBgpIdentifier = remoteBgpIdentifier; |
| 55 | this.negotiatedholdTime = negotiatedholdTime; | 60 | this.negotiatedholdTime = negotiatedholdTime; |
| 56 | this.isIbgpSession = isIbgpSession; | 61 | this.isIbgpSession = isIbgpSession; |
| 62 | + this.remoteBgpCapability = remoteBgpCapability; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + @Override | ||
| 66 | + public List<BgpValueType> remoteBgpCapability() { | ||
| 67 | + return remoteBgpCapability; | ||
| 57 | } | 68 | } |
| 58 | 69 | ||
| 59 | @Override | 70 | @Override | ... | ... |
-
Please register or login to post a comment