Shashikanth VH
Committed by Gerrit Code Review

Modified bgp file name according to naming convention.

Change-Id: I403139b53fbc1a2dba894dfd39720707a52ba7cd
Showing 118 changed files with 1329 additions and 1337 deletions
...@@ -20,7 +20,7 @@ import java.util.TreeMap; ...@@ -20,7 +20,7 @@ import java.util.TreeMap;
20 /** 20 /**
21 * Abstraction of an BGP configuration. Manages the BGP configuration from CLI to the BGP controller. 21 * Abstraction of an BGP configuration. Manages the BGP configuration from CLI to the BGP controller.
22 */ 22 */
23 -public interface BGPCfg { 23 +public interface BgpCfg {
24 24
25 enum State { 25 enum State {
26 /** 26 /**
...@@ -233,7 +233,7 @@ public interface BGPCfg { ...@@ -233,7 +233,7 @@ public interface BGPCfg {
233 * 233 *
234 * @return return the tree map with IP as key and BGPPeerCfg as object 234 * @return return the tree map with IP as key and BGPPeerCfg as object
235 */ 235 */
236 - TreeMap<String, BGPPeerCfg> displayPeers(); 236 + TreeMap<String, BgpPeerCfg> displayPeers();
237 237
238 /** 238 /**
239 * Return the BGP Peer information with this matching IP. 239 * Return the BGP Peer information with this matching IP.
...@@ -242,7 +242,7 @@ public interface BGPCfg { ...@@ -242,7 +242,7 @@ public interface BGPCfg {
242 * 242 *
243 * @return BGPPeerCfg object 243 * @return BGPPeerCfg object
244 */ 244 */
245 - BGPPeerCfg displayPeers(String routerid); 245 + BgpPeerCfg displayPeers(String routerid);
246 246
247 /** 247 /**
248 * Check if this BGP peer is configured. 248 * Check if this BGP peer is configured.
...@@ -267,7 +267,7 @@ public interface BGPCfg { ...@@ -267,7 +267,7 @@ public interface BGPCfg {
267 * 267 *
268 * @return return the tree map with IP as key and BGPPeerCfg as object 268 * @return return the tree map with IP as key and BGPPeerCfg as object
269 */ 269 */
270 - TreeMap<String, BGPPeerCfg> getPeerTree(); 270 + TreeMap<String, BgpPeerCfg> getPeerTree();
271 271
272 /** 272 /**
273 * Set the current connection state information. 273 * Set the current connection state information.
...@@ -275,7 +275,7 @@ public interface BGPCfg { ...@@ -275,7 +275,7 @@ public interface BGPCfg {
275 * @param routerid router IP address in string format 275 * @param routerid router IP address in string format
276 * @param state state information 276 * @param state state information
277 */ 277 */
278 - void setPeerConnState(String routerid, BGPPeerCfg.State state); 278 + void setPeerConnState(String routerid, BgpPeerCfg.State state);
279 279
280 /** 280 /**
281 * Check if the peer can be connected or not. 281 * Check if the peer can be connected or not.
...@@ -293,5 +293,5 @@ public interface BGPCfg { ...@@ -293,5 +293,5 @@ public interface BGPCfg {
293 * 293 *
294 * @return state information 294 * @return state information
295 */ 295 */
296 - BGPPeerCfg.State getPeerConnState(String routerid); 296 + BgpPeerCfg.State getPeerConnState(String routerid);
297 } 297 }
......
...@@ -19,21 +19,21 @@ package org.onosproject.bgp.controller; ...@@ -19,21 +19,21 @@ package org.onosproject.bgp.controller;
19 import java.util.Map; 19 import java.util.Map;
20 import java.util.Set; 20 import java.util.Set;
21 21
22 -import org.onosproject.bgpio.exceptions.BGPParseException; 22 +import org.onosproject.bgpio.exceptions.BgpParseException;
23 -import org.onosproject.bgpio.protocol.BGPMessage; 23 +import org.onosproject.bgpio.protocol.BgpMessage;
24 24
25 /** 25 /**
26 * Abstraction of an BGP controller. Serves as a one stop shop for obtaining BGP devices and (un)register listeners on 26 * Abstraction of an BGP controller. Serves as a one stop shop for obtaining BGP devices and (un)register listeners on
27 * bgp events 27 * bgp events
28 */ 28 */
29 -public interface BGPController { 29 +public interface BgpController {
30 30
31 /** 31 /**
32 * Returns list of bgp peers connected to this BGP controller. 32 * Returns list of bgp peers connected to this BGP controller.
33 * 33 *
34 * @return Iterable of BGPPeer elements 34 * @return Iterable of BGPPeer elements
35 */ 35 */
36 - Iterable<BGPPeer> getPeers(); 36 + Iterable<BgpPeer> getPeers();
37 37
38 /** 38 /**
39 * Returns the actual bgp peer for the given ip address. 39 * Returns the actual bgp peer for the given ip address.
...@@ -41,7 +41,7 @@ public interface BGPController { ...@@ -41,7 +41,7 @@ public interface BGPController {
41 * @param bgpId the id of the bgp peer to fetch 41 * @param bgpId the id of the bgp peer to fetch
42 * @return the interface to this bgp peer 42 * @return the interface to this bgp peer
43 */ 43 */
44 - BGPPeer getPeer(BGPId bgpId); 44 + BgpPeer getPeer(BgpId bgpId);
45 45
46 /** 46 /**
47 * Register a listener for BGP message events. 47 * Register a listener for BGP message events.
...@@ -77,16 +77,16 @@ public interface BGPController { ...@@ -77,16 +77,16 @@ public interface BGPController {
77 * @param bgpId the id of the peer to send message. 77 * @param bgpId the id of the peer to send message.
78 * @param msg the message to send 78 * @param msg the message to send
79 */ 79 */
80 - void writeMsg(BGPId bgpId, BGPMessage msg); 80 + void writeMsg(BgpId bgpId, BgpMessage msg);
81 81
82 /** 82 /**
83 * Process a message and notify the appropriate listeners. 83 * Process a message and notify the appropriate listeners.
84 * 84 *
85 * @param bgpId id of the peer the message arrived on 85 * @param bgpId id of the peer the message arrived on
86 * @param msg the message to process. 86 * @param msg the message to process.
87 - * @throws BGPParseException on data processing error 87 + * @throws BgpParseException on data processing error
88 */ 88 */
89 - void processBGPPacket(BGPId bgpId, BGPMessage msg) throws BGPParseException; 89 + void processBGPPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException;
90 90
91 /** 91 /**
92 * Close all connected BGP peers. 92 * Close all connected BGP peers.
...@@ -99,7 +99,7 @@ public interface BGPController { ...@@ -99,7 +99,7 @@ public interface BGPController {
99 * 99 *
100 * @return configuration object 100 * @return configuration object
101 */ 101 */
102 - BGPCfg getConfig(); 102 + BgpCfg getConfig();
103 103
104 /** 104 /**
105 * Get the BGP connected peers to this controller. 105 * Get the BGP connected peers to this controller.
...@@ -120,7 +120,7 @@ public interface BGPController { ...@@ -120,7 +120,7 @@ public interface BGPController {
120 * 120 *
121 * @return connectedPeers connected peers 121 * @return connectedPeers connected peers
122 */ 122 */
123 - Map<BGPId, BGPPeer> connectedPeers(); 123 + Map<BgpId, BgpPeer> connectedPeers();
124 124
125 /** 125 /**
126 * Return BGP node listener. 126 * Return BGP node listener.
......
...@@ -18,9 +18,9 @@ import static com.google.common.base.Preconditions.checkArgument; ...@@ -18,9 +18,9 @@ import static com.google.common.base.Preconditions.checkArgument;
18 import java.net.URI; 18 import java.net.URI;
19 import java.net.URISyntaxException; 19 import java.net.URISyntaxException;
20 20
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 22 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
23 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 23 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
24 import org.slf4j.Logger; 24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory; 25 import org.slf4j.LoggerFactory;
26 26
...@@ -61,7 +61,7 @@ public final class BgpDpid { ...@@ -61,7 +61,7 @@ public final class BgpDpid {
61 } else if (nodeDescriptorType == NODE_DESCRIPTOR_REMOTE) { 61 } else if (nodeDescriptorType == NODE_DESCRIPTOR_REMOTE) {
62 add(linkNlri.remoteNodeDescriptors().toString()); 62 add(linkNlri.remoteNodeDescriptors().toString());
63 } 63 }
64 - } catch (BGPParseException e) { 64 + } catch (BgpParseException e) {
65 log.info("Exception BgpId string: " + e.toString()); 65 log.info("Exception BgpId string: " + e.toString());
66 } 66 }
67 67
...@@ -72,7 +72,7 @@ public final class BgpDpid { ...@@ -72,7 +72,7 @@ public final class BgpDpid {
72 * 72 *
73 * @param nodeNlri node Nlri. 73 * @param nodeNlri node Nlri.
74 */ 74 */
75 - public BgpDpid(final BGPNodeLSNlriVer4 nodeNlri) { 75 + public BgpDpid(final BgpNodeLSNlriVer4 nodeNlri) {
76 this.stringBuilder = new StringBuilder("bgpls://"); 76 this.stringBuilder = new StringBuilder("bgpls://");
77 77
78 if (nodeNlri.getRouteDistinguisher() != null) { 78 if (nodeNlri.getRouteDistinguisher() != null) {
...@@ -89,7 +89,7 @@ public final class BgpDpid { ...@@ -89,7 +89,7 @@ public final class BgpDpid {
89 89
90 add(nodeNlri.getLocalNodeDescriptors().toString()); 90 add(nodeNlri.getLocalNodeDescriptors().toString());
91 91
92 - } catch (BGPParseException e) { 92 + } catch (BgpParseException e) {
93 log.info("Exception node string: " + e.toString()); 93 log.info("Exception node string: " + e.toString());
94 } 94 }
95 } 95 }
......
...@@ -27,7 +27,7 @@ import static com.google.common.base.Preconditions.checkArgument; ...@@ -27,7 +27,7 @@ import static com.google.common.base.Preconditions.checkArgument;
27 * The class representing a network peer bgp ip. 27 * The class representing a network peer bgp ip.
28 * This class is immutable. 28 * This class is immutable.
29 */ 29 */
30 -public final class BGPId { 30 +public final class BgpId {
31 31
32 private static final String SCHEME = "bgp"; 32 private static final String SCHEME = "bgp";
33 private static final long UNKNOWN = 0; 33 private static final long UNKNOWN = 0;
...@@ -36,7 +36,7 @@ public final class BGPId { ...@@ -36,7 +36,7 @@ public final class BGPId {
36 /** 36 /**
37 * Private constructor. 37 * Private constructor.
38 */ 38 */
39 - private BGPId(IpAddress ipAddress) { 39 + private BgpId(IpAddress ipAddress) {
40 this.ipAddress = ipAddress; 40 this.ipAddress = ipAddress;
41 } 41 }
42 42
...@@ -46,8 +46,8 @@ public final class BGPId { ...@@ -46,8 +46,8 @@ public final class BGPId {
46 * @param ipAddress IP address 46 * @param ipAddress IP address
47 * @return object of BGPId 47 * @return object of BGPId
48 */ 48 */
49 - public static BGPId bgpId(IpAddress ipAddress) { 49 + public static BgpId bgpId(IpAddress ipAddress) {
50 - return new BGPId(ipAddress); 50 + return new BgpId(ipAddress);
51 } 51 }
52 52
53 /** 53 /**
...@@ -71,11 +71,11 @@ public final class BGPId { ...@@ -71,11 +71,11 @@ public final class BGPId {
71 71
72 @Override 72 @Override
73 public boolean equals(Object other) { 73 public boolean equals(Object other) {
74 - if (!(other instanceof BGPId)) { 74 + if (!(other instanceof BgpId)) {
75 return false; 75 return false;
76 } 76 }
77 77
78 - BGPId otherBGPid = (BGPId) other; 78 + BgpId otherBGPid = (BgpId) other;
79 return Objects.equals(ipAddress, otherBGPid.ipAddress); 79 return Objects.equals(ipAddress, otherBGPid.ipAddress);
80 } 80 }
81 81
...@@ -90,9 +90,9 @@ public final class BGPId { ...@@ -90,9 +90,9 @@ public final class BGPId {
90 * @param uri device URI 90 * @param uri device URI
91 * @return object of BGPId 91 * @return object of BGPId
92 */ 92 */
93 - public static BGPId bgpId(URI uri) { 93 + public static BgpId bgpId(URI uri) {
94 checkArgument(uri.getScheme().equals(SCHEME), "Unsupported URI scheme"); 94 checkArgument(uri.getScheme().equals(SCHEME), "Unsupported URI scheme");
95 - return new BGPId(IpAddress.valueOf(uri.getSchemeSpecificPart())); 95 + return new BgpId(IpAddress.valueOf(uri.getSchemeSpecificPart()));
96 } 96 }
97 97
98 /** 98 /**
...@@ -101,7 +101,7 @@ public final class BGPId { ...@@ -101,7 +101,7 @@ public final class BGPId {
101 * @param bgpId device bgpId 101 * @param bgpId device bgpId
102 * @return device URI 102 * @return device URI
103 */ 103 */
104 - public static URI uri(BGPId bgpId) { 104 + public static URI uri(BgpId bgpId) {
105 return uri(bgpId.ipAddress()); 105 return uri(bgpId.ipAddress());
106 } 106 }
107 107
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 13
14 package org.onosproject.bgp.controller; 14 package org.onosproject.bgp.controller;
15 15
16 -import org.onosproject.bgpio.protocol.BGPLSNlri; 16 +import org.onosproject.bgpio.protocol.BgpLSNlri;
17 import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; 17 import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
18 import org.onosproject.bgpio.types.RouteDistinguisher; 18 import org.onosproject.bgpio.types.RouteDistinguisher;
19 19
...@@ -29,14 +29,14 @@ public interface BgpLocalRib { ...@@ -29,14 +29,14 @@ public interface BgpLocalRib {
29 * @param nlri network layer reach info 29 * @param nlri network layer reach info
30 * @param details nlri details 30 * @param details nlri details
31 */ 31 */
32 - void add(BgpSessionInfo sessionInfo, BGPLSNlri nlri, PathAttrNlriDetails details); 32 + void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details);
33 33
34 /** 34 /**
35 * Removes NLRI identifier if it exists. 35 * Removes NLRI identifier if it exists.
36 * 36 *
37 * @param nlri info 37 * @param nlri info
38 */ 38 */
39 - void delete(BGPLSNlri nlri); 39 + void delete(BgpLSNlri nlri);
40 40
41 /** 41 /**
42 * Update NLRI identifier mapped with route distinguisher if it exists in tree otherwise add NLRI infomation mapped 42 * Update NLRI identifier mapped with route distinguisher if it exists in tree otherwise add NLRI infomation mapped
...@@ -47,7 +47,7 @@ public interface BgpLocalRib { ...@@ -47,7 +47,7 @@ public interface BgpLocalRib {
47 * @param details has pathattribute, protocol id and identifier 47 * @param details has pathattribute, protocol id and identifier
48 * @param routeDistinguisher unique for each VPN 48 * @param routeDistinguisher unique for each VPN
49 */ 49 */
50 - void add(BgpSessionInfo sessionInfo, BGPLSNlri nlri, PathAttrNlriDetails details, 50 + void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details,
51 RouteDistinguisher routeDistinguisher); 51 RouteDistinguisher routeDistinguisher);
52 52
53 /** 53 /**
...@@ -56,5 +56,5 @@ public interface BgpLocalRib { ...@@ -56,5 +56,5 @@ public interface BgpLocalRib {
56 * @param nlri info 56 * @param nlri info
57 * @param routeDistinguisher unique for each VPN 57 * @param routeDistinguisher unique for each VPN
58 */ 58 */
59 - void delete(BGPLSNlri nlri, RouteDistinguisher routeDistinguisher); 59 + void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher);
60 } 60 }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 */ 12 */
13 package org.onosproject.bgp.controller; 13 package org.onosproject.bgp.controller;
14 14
15 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 15 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
16 16
17 /** 17 /**
18 * Allows for providers interested in node events to be notified. 18 * Allows for providers interested in node events to be notified.
...@@ -24,12 +24,12 @@ public interface BgpNodeListener { ...@@ -24,12 +24,12 @@ public interface BgpNodeListener {
24 * 24 *
25 * @param nodeNlri node rechability info 25 * @param nodeNlri node rechability info
26 */ 26 */
27 - void addNode(BGPNodeLSNlriVer4 nodeNlri); 27 + void addNode(BgpNodeLSNlriVer4 nodeNlri);
28 28
29 /** 29 /**
30 * Notifies that the node was removed. 30 * Notifies that the node was removed.
31 * 31 *
32 * @param nodeNlri node rechability info 32 * @param nodeNlri node rechability info
33 */ 33 */
34 - void deleteNode(BGPNodeLSNlriVer4 nodeNlri); 34 + void deleteNode(BgpNodeLSNlriVer4 nodeNlri);
35 } 35 }
......
...@@ -21,7 +21,7 @@ package org.onosproject.bgp.controller; ...@@ -21,7 +21,7 @@ package org.onosproject.bgp.controller;
21 * to the event if blocked has been called. This packet context can be used to react to the packet in event with a 21 * to the event if blocked has been called. This packet context can be used to react to the packet in event with a
22 * packet out. 22 * packet out.
23 */ 23 */
24 -public interface BGPPacketStats { 24 +public interface BgpPacketStats {
25 /** 25 /**
26 * Returns the count for no of packets sent out. 26 * Returns the count for no of packets sent out.
27 * 27 *
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
16 package org.onosproject.bgp.controller; 16 package org.onosproject.bgp.controller;
17 import java.util.List; 17 import java.util.List;
18 import org.jboss.netty.channel.Channel; 18 import org.jboss.netty.channel.Channel;
19 -import org.onosproject.bgpio.protocol.BGPFactory; 19 +import org.onosproject.bgpio.protocol.BgpFactory;
20 -import org.onosproject.bgpio.protocol.BGPMessage; 20 +import org.onosproject.bgpio.protocol.BgpMessage;
21 21
22 /** 22 /**
23 * Represents the peer side of an BGP peer. 23 * Represents the peer side of an BGP peer.
24 * 24 *
25 */ 25 */
26 -public interface BGPPeer { 26 +public interface BgpPeer {
27 27
28 /** 28 /**
29 * Sets the associated Netty channel for this bgp peer. 29 * Sets the associated Netty channel for this bgp peer.
...@@ -58,21 +58,21 @@ public interface BGPPeer { ...@@ -58,21 +58,21 @@ public interface BGPPeer {
58 * 58 *
59 * @param msg the message to write 59 * @param msg the message to write
60 */ 60 */
61 - void sendMessage(BGPMessage msg); 61 + void sendMessage(BgpMessage msg);
62 62
63 /** 63 /**
64 * Writes the BGPMessage list to the peer. 64 * Writes the BGPMessage list to the peer.
65 * 65 *
66 * @param msgs the messages to be written 66 * @param msgs the messages to be written
67 */ 67 */
68 - void sendMessage(List<BGPMessage> msgs); 68 + void sendMessage(List<BgpMessage> msgs);
69 69
70 /** 70 /**
71 * Provides the factory for BGP version. 71 * Provides the factory for BGP version.
72 * 72 *
73 * @return BGP version specific factory. 73 * @return BGP version specific factory.
74 */ 74 */
75 - BGPFactory factory(); 75 + BgpFactory factory();
76 76
77 /** 77 /**
78 * Checks if the bgp peer is still connected. 78 * Checks if the bgp peer is still connected.
......
...@@ -18,7 +18,7 @@ package org.onosproject.bgp.controller; ...@@ -18,7 +18,7 @@ package org.onosproject.bgp.controller;
18 /** 18 /**
19 * BGP Peer configuration information. 19 * BGP Peer configuration information.
20 */ 20 */
21 -public interface BGPPeerCfg { 21 +public interface BgpPeerCfg {
22 22
23 enum State { 23 enum State {
24 24
......
...@@ -26,7 +26,7 @@ public interface BgpPeerManager { ...@@ -26,7 +26,7 @@ public interface BgpPeerManager {
26 * 26 *
27 * @return false if peer already exist, otherwise true 27 * @return false if peer already exist, otherwise true
28 */ 28 */
29 - public boolean addConnectedPeer(BGPId bgpId, BGPPeer bgpPeer); 29 + public boolean addConnectedPeer(BgpId bgpId, BgpPeer bgpPeer);
30 30
31 /** 31 /**
32 * Validate wheather peer is connected. 32 * Validate wheather peer is connected.
...@@ -35,14 +35,14 @@ public interface BgpPeerManager { ...@@ -35,14 +35,14 @@ public interface BgpPeerManager {
35 * 35 *
36 * @return true if peer exist, otherwise false 36 * @return true if peer exist, otherwise false
37 */ 37 */
38 - public boolean isPeerConnected(BGPId bgpId); 38 + public boolean isPeerConnected(BgpId bgpId);
39 39
40 /** 40 /**
41 * Remove connected peer. 41 * Remove connected peer.
42 * 42 *
43 * @param bgpId BGP ID 43 * @param bgpId BGP ID
44 */ 44 */
45 - public void removeConnectedPeer(BGPId bgpId); 45 + public void removeConnectedPeer(BgpId bgpId);
46 46
47 /** 47 /**
48 * Gets connected peer. 48 * Gets connected peer.
...@@ -50,5 +50,5 @@ public interface BgpPeerManager { ...@@ -50,5 +50,5 @@ public interface BgpPeerManager {
50 * @param bgpId BGP ID 50 * @param bgpId BGP ID
51 * @return BGPPeer the connected peer, otherwise null 51 * @return BGPPeer the connected peer, otherwise null
52 */ 52 */
53 - public BGPPeer getPeer(BGPId bgpId); 53 + public BgpPeer getPeer(BgpId bgpId);
54 } 54 }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 13
14 package org.onosproject.bgp.controller; 14 package org.onosproject.bgp.controller;
15 15
16 -import org.onosproject.bgpio.protocol.BGPVersion; 16 +import org.onosproject.bgpio.protocol.BgpVersion;
17 17
18 /** 18 /**
19 * Abstraction of an BGP session info. Maintian session parameters obtained during session creation. 19 * Abstraction of an BGP session info. Maintian session parameters obtained during session creation.
...@@ -38,14 +38,14 @@ public interface BgpSessionInfo { ...@@ -38,14 +38,14 @@ public interface BgpSessionInfo {
38 * 38 *
39 * @return bgp ID. 39 * @return bgp ID.
40 */ 40 */
41 - BGPId remoteBgpId(); 41 + BgpId remoteBgpId();
42 42
43 /** 43 /**
44 * Gets the BGP version of peer. 44 * Gets the BGP version of peer.
45 * 45 *
46 * @return bgp version. 46 * @return bgp version.
47 */ 47 */
48 - BGPVersion remoteBgpVersion(); 48 + BgpVersion remoteBgpVersion();
49 49
50 /** 50 /**
51 * Gets the BGP remote bgp AS number. 51 * Gets the BGP remote bgp AS number.
......
...@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
21 /** 21 /**
22 * Custom Exception for BGP IO. 22 * Custom Exception for BGP IO.
23 */ 23 */
24 -public class BGPParseException extends Exception { 24 +public class BgpParseException extends Exception {
25 25
26 private static final long serialVersionUID = 1L; 26 private static final long serialVersionUID = 1L;
27 private byte errorCode; 27 private byte errorCode;
...@@ -31,7 +31,7 @@ public class BGPParseException extends Exception { ...@@ -31,7 +31,7 @@ public class BGPParseException extends Exception {
31 /** 31 /**
32 * Default constructor to create a new exception. 32 * Default constructor to create a new exception.
33 */ 33 */
34 - public BGPParseException() { 34 + public BgpParseException() {
35 super(); 35 super();
36 } 36 }
37 37
...@@ -41,7 +41,7 @@ public class BGPParseException extends Exception { ...@@ -41,7 +41,7 @@ public class BGPParseException extends Exception {
41 * @param message the detail of exception in string 41 * @param message the detail of exception in string
42 * @param cause underlying cause of the error 42 * @param cause underlying cause of the error
43 */ 43 */
44 - public BGPParseException(final String message, final Throwable cause) { 44 + public BgpParseException(final String message, final Throwable cause) {
45 super(message, cause); 45 super(message, cause);
46 } 46 }
47 47
...@@ -50,7 +50,7 @@ public class BGPParseException extends Exception { ...@@ -50,7 +50,7 @@ public class BGPParseException extends Exception {
50 * 50 *
51 * @param message the detail of exception in string 51 * @param message the detail of exception in string
52 */ 52 */
53 - public BGPParseException(final String message) { 53 + public BgpParseException(final String message) {
54 super(message); 54 super(message);
55 } 55 }
56 56
...@@ -59,7 +59,7 @@ public class BGPParseException extends Exception { ...@@ -59,7 +59,7 @@ public class BGPParseException extends Exception {
59 * 59 *
60 * @param cause underlying cause of the error 60 * @param cause underlying cause of the error
61 */ 61 */
62 - public BGPParseException(final Throwable cause) { 62 + public BgpParseException(final Throwable cause) {
63 super(cause); 63 super(cause);
64 } 64 }
65 65
...@@ -70,7 +70,7 @@ public class BGPParseException extends Exception { ...@@ -70,7 +70,7 @@ public class BGPParseException extends Exception {
70 * @param errorSubCode error subcode of BGP message 70 * @param errorSubCode error subcode of BGP message
71 * @param data error data of BGP message 71 * @param data error data of BGP message
72 */ 72 */
73 - public BGPParseException(final byte errorCode, final byte errorSubCode, final ChannelBuffer data) { 73 + public BgpParseException(final byte errorCode, final byte errorSubCode, final ChannelBuffer data) {
74 super(); 74 super();
75 this.errorCode = errorCode; 75 this.errorCode = errorCode;
76 this.errorSubCode = errorSubCode; 76 this.errorSubCode = errorSubCode;
......
...@@ -17,22 +17,22 @@ ...@@ -17,22 +17,22 @@
17 package org.onosproject.bgpio.protocol; 17 package org.onosproject.bgpio.protocol;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.onosproject.bgpio.exceptions.BGPParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 -import org.onosproject.bgpio.protocol.ver4.BGPFactoryVer4; 21 +import org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4;
22 -import org.onosproject.bgpio.types.BGPHeader; 22 +import org.onosproject.bgpio.types.BgpHeader;
23 import org.slf4j.Logger; 23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
25 25
26 /** 26 /**
27 * Abstraction to provide the version for BGP. 27 * Abstraction to provide the version for BGP.
28 */ 28 */
29 -public final class BGPFactories { 29 +public final class BgpFactories {
30 30
31 - protected static final Logger log = LoggerFactory.getLogger(BGPFactories.class); 31 + protected static final Logger log = LoggerFactory.getLogger(BgpFactories.class);
32 32
33 private static final GenericReader GENERIC_READER = new GenericReader(); 33 private static final GenericReader GENERIC_READER = new GenericReader();
34 34
35 - private BGPFactories() { 35 + private BgpFactories() {
36 } 36 }
37 37
38 /** 38 /**
...@@ -41,12 +41,12 @@ public final class BGPFactories { ...@@ -41,12 +41,12 @@ public final class BGPFactories {
41 * @param version BGP version 41 * @param version BGP version
42 * @return BGP version 42 * @return BGP version
43 */ 43 */
44 - public static BGPFactory getFactory(BGPVersion version) { 44 + public static BgpFactory getFactory(BgpVersion version) {
45 switch (version) { 45 switch (version) {
46 case BGP_4: 46 case BGP_4:
47 - return BGPFactoryVer4.INSTANCE; 47 + return BgpFactoryVer4.INSTANCE;
48 default: 48 default:
49 - throw new IllegalArgumentException("[BGPFactory:]Unknown version: " + version); 49 + throw new IllegalArgumentException("[BgpFactory:]Unknown version: " + version);
50 } 50 }
51 } 51 }
52 52
...@@ -54,19 +54,19 @@ public final class BGPFactories { ...@@ -54,19 +54,19 @@ public final class BGPFactories {
54 * Reader class for reading BGP messages from channel buffer. 54 * Reader class for reading BGP messages from channel buffer.
55 * 55 *
56 */ 56 */
57 - private static class GenericReader implements BGPMessageReader<BGPMessage> { 57 + private static class GenericReader implements BgpMessageReader<BgpMessage> {
58 58
59 @Override 59 @Override
60 - public BGPMessage readFrom(ChannelBuffer bb, BGPHeader bgpHeader) 60 + public BgpMessage readFrom(ChannelBuffer bb, BgpHeader bgpHeader)
61 - throws BGPParseException { 61 + throws BgpParseException {
62 - BGPFactory factory; 62 + BgpFactory factory;
63 63
64 if (!bb.readable()) { 64 if (!bb.readable()) {
65 log.error("Empty message received"); 65 log.error("Empty message received");
66 - throw new BGPParseException("Empty message received"); 66 + throw new BgpParseException("Empty message received");
67 } 67 }
68 // TODO: Currently only BGP version 4 is supported 68 // TODO: Currently only BGP version 4 is supported
69 - factory = org.onosproject.bgpio.protocol.ver4.BGPFactoryVer4.INSTANCE; 69 + factory = org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4.INSTANCE;
70 return factory.getReader().readFrom(bb, bgpHeader); 70 return factory.getReader().readFrom(bb, bgpHeader);
71 } 71 }
72 } 72 }
...@@ -76,7 +76,7 @@ public final class BGPFactories { ...@@ -76,7 +76,7 @@ public final class BGPFactories {
76 * 76 *
77 * @return bgp message generic reader 77 * @return bgp message generic reader
78 */ 78 */
79 - public static BGPMessageReader<BGPMessage> getGenericReader() { 79 + public static BgpMessageReader<BgpMessage> getGenericReader() {
80 return GENERIC_READER; 80 return GENERIC_READER;
81 } 81 }
82 } 82 }
......
...@@ -21,40 +21,40 @@ package org.onosproject.bgpio.protocol; ...@@ -21,40 +21,40 @@ package org.onosproject.bgpio.protocol;
21 * and objects. 21 * and objects.
22 * 22 *
23 */ 23 */
24 -public interface BGPFactory { 24 +public interface BgpFactory {
25 25
26 /** 26 /**
27 * Gets the builder object for a open message. 27 * Gets the builder object for a open message.
28 * 28 *
29 * @return builder object for open message 29 * @return builder object for open message
30 */ 30 */
31 - BGPOpenMsg.Builder openMessageBuilder(); 31 + BgpOpenMsg.Builder openMessageBuilder();
32 32
33 /** 33 /**
34 * Gets the builder object for a keepalive message. 34 * Gets the builder object for a keepalive message.
35 * 35 *
36 * @return builder object for keepalive message 36 * @return builder object for keepalive message
37 */ 37 */
38 - BGPKeepaliveMsg.Builder keepaliveMessageBuilder(); 38 + BgpKeepaliveMsg.Builder keepaliveMessageBuilder();
39 39
40 /** 40 /**
41 * Gets the builder object for a notification message. 41 * Gets the builder object for a notification message.
42 * 42 *
43 * @return builder object for notification message. 43 * @return builder object for notification message.
44 */ 44 */
45 - BGPNotificationMsg.Builder notificationMessageBuilder(); 45 + BgpNotificationMsg.Builder notificationMessageBuilder();
46 46
47 /** 47 /**
48 * Gets the BGP message reader. 48 * Gets the BGP message reader.
49 * 49 *
50 * @return BGP message reader 50 * @return BGP message reader
51 */ 51 */
52 - BGPMessageReader<BGPMessage> getReader(); 52 + BgpMessageReader<BgpMessage> getReader();
53 53
54 /** 54 /**
55 * Returns BGP version. 55 * Returns BGP version.
56 * 56 *
57 * @return BGP version 57 * @return BGP version
58 */ 58 */
59 - BGPVersion getVersion(); 59 + BgpVersion getVersion();
60 } 60 }
......
...@@ -16,33 +16,33 @@ ...@@ -16,33 +16,33 @@
16 package org.onosproject.bgpio.protocol; 16 package org.onosproject.bgpio.protocol;
17 17
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 -import org.onosproject.bgpio.types.BGPHeader; 19 +import org.onosproject.bgpio.types.BgpHeader;
20 20
21 /** 21 /**
22 * Abstraction of an entity providing BGP Keepalive Message. 22 * Abstraction of an entity providing BGP Keepalive Message.
23 */ 23 */
24 -public interface BGPKeepaliveMsg extends BGPMessage { 24 +public interface BgpKeepaliveMsg extends BgpMessage {
25 25
26 @Override 26 @Override
27 - BGPVersion getVersion(); 27 + BgpVersion getVersion();
28 28
29 @Override 29 @Override
30 - BGPType getType(); 30 + BgpType getType();
31 31
32 @Override 32 @Override
33 void writeTo(ChannelBuffer channelBuffer); 33 void writeTo(ChannelBuffer channelBuffer);
34 34
35 @Override 35 @Override
36 - BGPHeader getHeader(); 36 + BgpHeader getHeader();
37 37
38 /** 38 /**
39 * Builder interface with get and set functions to build Keepalive message. 39 * Builder interface with get and set functions to build Keepalive message.
40 */ 40 */
41 - interface Builder extends BGPMessage.Builder { 41 + interface Builder extends BgpMessage.Builder {
42 @Override 42 @Override
43 - BGPKeepaliveMsg build(); 43 + BgpKeepaliveMsg build();
44 44
45 @Override 45 @Override
46 - Builder setHeader(BGPHeader bgpMsgHeader); 46 + Builder setHeader(BgpHeader bgpMsgHeader);
47 } 47 }
48 } 48 }
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
15 */ 15 */
16 package org.onosproject.bgpio.protocol; 16 package org.onosproject.bgpio.protocol;
17 17
18 -import org.onosproject.bgpio.exceptions.BGPParseException; 18 +import org.onosproject.bgpio.exceptions.BgpParseException;
19 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; 19 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4.ProtocolType;
20 import org.onosproject.bgpio.types.RouteDistinguisher; 20 import org.onosproject.bgpio.types.RouteDistinguisher;
21 21
22 /** 22 /**
23 * Abstraction of an entity providing BGP-LS NLRI. 23 * Abstraction of an entity providing BGP-LS NLRI.
24 */ 24 */
25 -public interface BGPLSNlri { 25 +public interface BgpLSNlri {
26 /** 26 /**
27 * Returns NlriType of BGP-LS NLRI. 27 * Returns NlriType of BGP-LS NLRI.
28 * 28 *
...@@ -41,9 +41,9 @@ public interface BGPLSNlri { ...@@ -41,9 +41,9 @@ public interface BGPLSNlri {
41 * Returns Protocol Id in Nlri. 41 * Returns Protocol Id in Nlri.
42 * 42 *
43 * @return Protocol Id in Nlri 43 * @return Protocol Id in Nlri
44 - * @throws BGPParseException while getting protocol ID 44 + * @throws BgpParseException while getting protocol ID
45 */ 45 */
46 - ProtocolType getProtocolId() throws BGPParseException; 46 + ProtocolType getProtocolId() throws BgpParseException;
47 47
48 /** 48 /**
49 * Returns Route distinguisher in Nlri. 49 * Returns Route distinguisher in Nlri.
......
...@@ -17,13 +17,13 @@ package org.onosproject.bgpio.protocol; ...@@ -17,13 +17,13 @@ package org.onosproject.bgpio.protocol;
17 17
18 import java.util.List; 18 import java.util.List;
19 19
20 -import org.onosproject.bgpio.types.BGPValueType; 20 +import org.onosproject.bgpio.types.BgpValueType;
21 import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors; 21 import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors;
22 22
23 /** 23 /**
24 * Abstraction of an entity providing BGP-LS Link NLRI. 24 * Abstraction of an entity providing BGP-LS Link NLRI.
25 */ 25 */
26 -public interface BgpLinkLsNlri extends BGPLSNlri { 26 +public interface BgpLinkLsNlri extends BgpLSNlri {
27 /** 27 /**
28 * Returns local node descriptors. 28 * Returns local node descriptors.
29 * 29 *
...@@ -43,5 +43,5 @@ public interface BgpLinkLsNlri extends BGPLSNlri { ...@@ -43,5 +43,5 @@ public interface BgpLinkLsNlri extends BGPLSNlri {
43 * 43 *
44 * @return link descriptors 44 * @return link descriptors
45 */ 45 */
46 - List<BGPValueType> linkDescriptors(); 46 + List<BgpValueType> linkDescriptors();
47 } 47 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17,36 +17,36 @@ ...@@ -17,36 +17,36 @@
17 package org.onosproject.bgpio.protocol; 17 package org.onosproject.bgpio.protocol;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.onosproject.bgpio.exceptions.BGPParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 -import org.onosproject.bgpio.types.BGPHeader; 21 +import org.onosproject.bgpio.types.BgpHeader;
22 22
23 /** 23 /**
24 * Abstraction of an entity providing BGP Messages. 24 * Abstraction of an entity providing BGP Messages.
25 */ 25 */
26 -public interface BGPMessage extends Writeable { 26 +public interface BgpMessage extends Writeable {
27 /** 27 /**
28 * Returns BGP Header of BGP Message. 28 * Returns BGP Header of BGP Message.
29 * 29 *
30 * @return BGP Header of BGP Message 30 * @return BGP Header of BGP Message
31 */ 31 */
32 - BGPHeader getHeader(); 32 + BgpHeader getHeader();
33 33
34 /** 34 /**
35 * Returns version of BGP Message. 35 * Returns version of BGP Message.
36 * 36 *
37 * @return version of BGP Message 37 * @return version of BGP Message
38 */ 38 */
39 - BGPVersion getVersion(); 39 + BgpVersion getVersion();
40 40
41 /** 41 /**
42 * Returns BGP Type of BGP Message. 42 * Returns BGP Type of BGP Message.
43 * 43 *
44 * @return BGP Type of BGP Message 44 * @return BGP Type of BGP Message
45 */ 45 */
46 - BGPType getType(); 46 + BgpType getType();
47 47
48 @Override 48 @Override
49 - void writeTo(ChannelBuffer cb) throws BGPParseException; 49 + void writeTo(ChannelBuffer cb) throws BgpParseException;
50 50
51 /** 51 /**
52 * Builder interface with get and set functions to build BGP Message. 52 * Builder interface with get and set functions to build BGP Message.
...@@ -56,9 +56,9 @@ public interface BGPMessage extends Writeable { ...@@ -56,9 +56,9 @@ public interface BGPMessage extends Writeable {
56 * Builds BGP Message. 56 * Builds BGP Message.
57 * 57 *
58 * @return BGP Message 58 * @return BGP Message
59 - * @throws BGPParseException while building bgp message 59 + * @throws BgpParseException while building bgp message
60 */ 60 */
61 - BGPMessage build() throws BGPParseException; 61 + BgpMessage build() throws BgpParseException;
62 62
63 /** 63 /**
64 * Sets BgpHeader and return its builder. 64 * Sets BgpHeader and return its builder.
...@@ -66,6 +66,6 @@ public interface BGPMessage extends Writeable { ...@@ -66,6 +66,6 @@ public interface BGPMessage extends Writeable {
66 * @param bgpMsgHeader BGP Message Header 66 * @param bgpMsgHeader BGP Message Header
67 * @return builder by setting BGP message header 67 * @return builder by setting BGP message header
68 */ 68 */
69 - Builder setHeader(BGPHeader bgpMsgHeader); 69 + Builder setHeader(BgpHeader bgpMsgHeader);
70 } 70 }
71 } 71 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
16 package org.onosproject.bgpio.protocol; 16 package org.onosproject.bgpio.protocol;
17 17
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 -import org.onosproject.bgpio.exceptions.BGPParseException; 19 +import org.onosproject.bgpio.exceptions.BgpParseException;
20 -import org.onosproject.bgpio.types.BGPHeader; 20 +import org.onosproject.bgpio.types.BgpHeader;
21 21
22 /** 22 /**
23 * Abstraction of an entity providing BGP Message Reader. 23 * Abstraction of an entity providing BGP Message Reader.
24 */ 24 */
25 -public interface BGPMessageReader<T> { 25 +public interface BgpMessageReader<T> {
26 26
27 /** 27 /**
28 * Reads the Objects in the BGP Message and Returns BGP Message. 28 * Reads the Objects in the BGP Message and Returns BGP Message.
...@@ -30,7 +30,7 @@ public interface BGPMessageReader<T> { ...@@ -30,7 +30,7 @@ public interface BGPMessageReader<T> {
30 * @param cb Channel Buffer 30 * @param cb Channel Buffer
31 * @param bgpHeader BGP message header 31 * @param bgpHeader BGP message header
32 * @return BGP Message 32 * @return BGP Message
33 - * @throws BGPParseException while parsing BGP message. 33 + * @throws BgpParseException while parsing BGP message.
34 */ 34 */
35 - T readFrom(ChannelBuffer cb, BGPHeader bgpHeader) throws BGPParseException; 35 + T readFrom(ChannelBuffer cb, BgpHeader bgpHeader) throws BgpParseException;
36 } 36 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17,20 +17,20 @@ ...@@ -17,20 +17,20 @@
17 package org.onosproject.bgpio.protocol; 17 package org.onosproject.bgpio.protocol;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.onosproject.bgpio.exceptions.BGPParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 21
22 /** 22 /**
23 * Abstraction of an entity providing BGP Message Writer. 23 * Abstraction of an entity providing BGP Message Writer.
24 */ 24 */
25 -public interface BGPMessageWriter<T> { 25 +public interface BgpMessageWriter<T> {
26 26
27 /** 27 /**
28 * Writes the Objects of the BGP Message into Channel Buffer. 28 * Writes the Objects of the BGP Message into Channel Buffer.
29 * 29 *
30 * @param cb Channel Buffer 30 * @param cb Channel Buffer
31 * @param message BGP Message 31 * @param message BGP Message
32 - * @throws BGPParseException 32 + * @throws BgpParseException
33 * While writing message 33 * While writing message
34 */ 34 */
35 - void write(ChannelBuffer cb, T message) throws BGPParseException; 35 + void write(ChannelBuffer cb, T message) throws BgpParseException;
36 } 36 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
15 */ 15 */
16 package org.onosproject.bgpio.protocol; 16 package org.onosproject.bgpio.protocol;
17 17
18 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSIdentifier; 18 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier;
19 19
20 /** 20 /**
21 * Abstraction of an entity providing BGP-LS Node NLRI. 21 * Abstraction of an entity providing BGP-LS Node NLRI.
22 */ 22 */
23 -public interface BGPNodeLSNlri extends BGPLSNlri { 23 +public interface BgpNodeLSNlri extends BgpLSNlri {
24 /** 24 /**
25 * Returns local node descriptors. 25 * Returns local node descriptors.
26 * 26 *
27 * @return local node descriptors 27 * @return local node descriptors
28 */ 28 */
29 - BGPNodeLSIdentifier getLocalNodeDescriptors(); 29 + BgpNodeLSIdentifier getLocalNodeDescriptors();
30 } 30 }
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
15 */ 15 */
16 package org.onosproject.bgpio.protocol; 16 package org.onosproject.bgpio.protocol;
17 17
18 -import org.onosproject.bgpio.exceptions.BGPParseException; 18 +import org.onosproject.bgpio.exceptions.BgpParseException;
19 19
20 /** 20 /**
21 * Abstraction of an entity providing BGP notification message. 21 * Abstraction of an entity providing BGP notification message.
22 */ 22 */
23 -public interface BGPNotificationMsg extends BGPMessage { 23 +public interface BgpNotificationMsg extends BgpMessage {
24 /** 24 /**
25 * Returns errorCode in notification message. 25 * Returns errorCode in notification message.
26 * 26 *
...@@ -45,10 +45,10 @@ public interface BGPNotificationMsg extends BGPMessage { ...@@ -45,10 +45,10 @@ public interface BGPNotificationMsg extends BGPMessage {
45 /** 45 /**
46 * Builder interface with get and set functions to build notification message. 46 * Builder interface with get and set functions to build notification message.
47 */ 47 */
48 - public interface Builder extends BGPMessage.Builder { 48 + public interface Builder extends BgpMessage.Builder {
49 49
50 @Override 50 @Override
51 - BGPNotificationMsg build() throws BGPParseException; 51 + BgpNotificationMsg build() throws BgpParseException;
52 52
53 /** 53 /**
54 * Sets errorCode in notification message and return its builder. 54 * Sets errorCode in notification message and return its builder.
......
...@@ -17,23 +17,23 @@ package org.onosproject.bgpio.protocol; ...@@ -17,23 +17,23 @@ package org.onosproject.bgpio.protocol;
17 17
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 19
20 -import org.onosproject.bgpio.exceptions.BGPParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 -import org.onosproject.bgpio.types.BGPHeader; 21 +import org.onosproject.bgpio.types.BgpHeader;
22 -import org.onosproject.bgpio.types.BGPValueType; 22 +import org.onosproject.bgpio.types.BgpValueType;
23 23
24 /** 24 /**
25 * Abstraction of an entity providing BGP Open Message. 25 * Abstraction of an entity providing BGP Open Message.
26 */ 26 */
27 -public interface BGPOpenMsg extends BGPMessage { 27 +public interface BgpOpenMsg extends BgpMessage {
28 28
29 @Override 29 @Override
30 - BGPHeader getHeader(); 30 + BgpHeader getHeader();
31 31
32 @Override 32 @Override
33 - BGPVersion getVersion(); 33 + BgpVersion getVersion();
34 34
35 @Override 35 @Override
36 - BGPType getType(); 36 + BgpType getType();
37 37
38 /** 38 /**
39 * Returns hold time of Open Message. 39 * Returns hold time of Open Message.
...@@ -61,15 +61,15 @@ public interface BGPOpenMsg extends BGPMessage { ...@@ -61,15 +61,15 @@ public interface BGPOpenMsg extends BGPMessage {
61 * 61 *
62 * @return capabilities of Open Message 62 * @return capabilities of Open Message
63 */ 63 */
64 - LinkedList<BGPValueType> getCapabilityTlv(); 64 + LinkedList<BgpValueType> getCapabilityTlv();
65 65
66 /** 66 /**
67 * Builder interface with get and set functions to build Open message. 67 * Builder interface with get and set functions to build Open message.
68 */ 68 */
69 - interface Builder extends BGPMessage.Builder { 69 + interface Builder extends BgpMessage.Builder {
70 70
71 @Override 71 @Override
72 - BGPOpenMsg build() throws BGPParseException; 72 + BgpOpenMsg build() throws BgpParseException;
73 73
74 /** 74 /**
75 * Sets hold time in Open Message and return its builder. 75 * Sets hold time in Open Message and return its builder.
...@@ -101,7 +101,7 @@ public interface BGPOpenMsg extends BGPMessage { ...@@ -101,7 +101,7 @@ public interface BGPOpenMsg extends BGPMessage {
101 * @param capabilityTlv capabilities in open message 101 * @param capabilityTlv capabilities in open message
102 * @return builder by setting capabilities 102 * @return builder by setting capabilities
103 */ 103 */
104 - Builder setCapabilityTlv(LinkedList<BGPValueType> capabilityTlv); 104 + Builder setCapabilityTlv(LinkedList<BgpValueType> capabilityTlv);
105 105
106 /** 106 /**
107 * Sets isLargeAsCapabilityTlvSet and return its builder. 107 * Sets isLargeAsCapabilityTlvSet and return its builder.
...@@ -122,6 +122,6 @@ public interface BGPOpenMsg extends BGPMessage { ...@@ -122,6 +122,6 @@ public interface BGPOpenMsg extends BGPMessage {
122 Builder setLsCapabilityTlv(boolean isLsCapabilitySet); 122 Builder setLsCapabilityTlv(boolean isLsCapabilitySet);
123 123
124 @Override 124 @Override
125 - Builder setHeader(BGPHeader bgpMsgHeader); 125 + Builder setHeader(BgpHeader bgpMsgHeader);
126 } 126 }
127 } 127 }
......
...@@ -17,13 +17,13 @@ package org.onosproject.bgpio.protocol; ...@@ -17,13 +17,13 @@ package org.onosproject.bgpio.protocol;
17 17
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 19
20 -import org.onosproject.bgpio.types.BGPValueType; 20 +import org.onosproject.bgpio.types.BgpValueType;
21 import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors; 21 import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors;
22 22
23 /** 23 /**
24 * Abstraction of an entity providing BGP-LS Prefix NLRI. 24 * Abstraction of an entity providing BGP-LS Prefix NLRI.
25 */ 25 */
26 -public interface BGPPrefixLSNlri extends BGPLSNlri { 26 +public interface BgpPrefixLSNlri extends BgpLSNlri {
27 /** 27 /**
28 * Returns local node descriptors. 28 * Returns local node descriptors.
29 * 29 *
...@@ -36,5 +36,5 @@ public interface BGPPrefixLSNlri extends BGPLSNlri { ...@@ -36,5 +36,5 @@ public interface BGPPrefixLSNlri extends BGPLSNlri {
36 * 36 *
37 * @return list of Prefix descriptor 37 * @return list of Prefix descriptor
38 */ 38 */
39 - LinkedList<BGPValueType> getPrefixdescriptor(); 39 + LinkedList<BgpValueType> getPrefixdescriptor();
40 } 40 }
......
...@@ -19,7 +19,7 @@ package org.onosproject.bgpio.protocol; ...@@ -19,7 +19,7 @@ package org.onosproject.bgpio.protocol;
19 /** 19 /**
20 * Enum to Provide the Different types of BGP messages. 20 * Enum to Provide the Different types of BGP messages.
21 */ 21 */
22 -public enum BGPType { 22 +public enum BgpType {
23 23
24 NONE(0), OPEN(1), UPDATE(2), NOTIFICATION(3), KEEP_ALIVE(4); 24 NONE(0), OPEN(1), UPDATE(2), NOTIFICATION(3), KEEP_ALIVE(4);
25 25
...@@ -30,7 +30,7 @@ public enum BGPType { ...@@ -30,7 +30,7 @@ public enum BGPType {
30 * 30 *
31 * @param val type of BGP message 31 * @param val type of BGP message
32 */ 32 */
33 - BGPType(int val) { 33 + BgpType(int val) {
34 value = val; 34 value = val;
35 } 35 }
36 36
......
...@@ -24,7 +24,7 @@ import org.onosproject.bgpio.protocol.ver4.BgpPathAttributes; ...@@ -24,7 +24,7 @@ import org.onosproject.bgpio.protocol.ver4.BgpPathAttributes;
24 /** 24 /**
25 * Abstraction of an entity providing BGP Update Message. 25 * Abstraction of an entity providing BGP Update Message.
26 */ 26 */
27 -public interface BgpUpdateMsg extends BGPMessage { 27 +public interface BgpUpdateMsg extends BgpMessage {
28 /** 28 /**
29 * Returns path attributes in BGP Update Message. 29 * Returns path attributes in BGP Update Message.
30 * 30 *
......
...@@ -19,7 +19,7 @@ package org.onosproject.bgpio.protocol; ...@@ -19,7 +19,7 @@ package org.onosproject.bgpio.protocol;
19 /** 19 /**
20 * Enum to provide BGP Message Version. 20 * Enum to provide BGP Message Version.
21 */ 21 */
22 -public enum BGPVersion { 22 +public enum BgpVersion {
23 23
24 BGP_4(4); 24 BGP_4(4);
25 25
...@@ -30,7 +30,7 @@ public enum BGPVersion { ...@@ -30,7 +30,7 @@ public enum BGPVersion {
30 * 30 *
31 * @param packetVersion version of BGP 31 * @param packetVersion version of BGP
32 */ 32 */
33 - BGPVersion(final int packetVersion) { 33 + BgpVersion(final int packetVersion) {
34 this.packetVersion = packetVersion; 34 this.packetVersion = packetVersion;
35 } 35 }
36 36
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 package org.onosproject.bgpio.protocol; 17 package org.onosproject.bgpio.protocol;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.onosproject.bgpio.exceptions.BGPParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 21
22 /** 22 /**
23 * Abstraction of an entity providing functionality to write byte streams of 23 * Abstraction of an entity providing functionality to write byte streams of
...@@ -29,7 +29,7 @@ public interface Writeable { ...@@ -29,7 +29,7 @@ public interface Writeable {
29 * Writes byte streams of messages to channel buffer. 29 * Writes byte streams of messages to channel buffer.
30 * 30 *
31 * @param cb channelBuffer 31 * @param cb channelBuffer
32 - * @throws BGPParseException when error occurs while writing BGP message to channel buffer 32 + * @throws BgpParseException when error occurs while writing BGP message to channel buffer
33 */ 33 */
34 - void writeTo(ChannelBuffer cb) throws BGPParseException; 34 + void writeTo(ChannelBuffer cb) throws BgpParseException;
35 } 35 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -21,9 +21,9 @@ import java.util.List; ...@@ -21,9 +21,9 @@ import java.util.List;
21 import java.util.Objects; 21 import java.util.Objects;
22 22
23 import org.jboss.netty.buffer.ChannelBuffer; 23 import org.jboss.netty.buffer.ChannelBuffer;
24 -import org.onosproject.bgpio.exceptions.BGPParseException; 24 +import org.onosproject.bgpio.exceptions.BgpParseException;
25 -import org.onosproject.bgpio.types.BGPErrorType; 25 +import org.onosproject.bgpio.types.BgpErrorType;
26 -import org.onosproject.bgpio.types.BGPValueType; 26 +import org.onosproject.bgpio.types.BgpValueType;
27 import org.onosproject.bgpio.types.IPv4AddressTlv; 27 import org.onosproject.bgpio.types.IPv4AddressTlv;
28 import org.onosproject.bgpio.types.IPv6AddressTlv; 28 import org.onosproject.bgpio.types.IPv6AddressTlv;
29 import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv; 29 import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv;
...@@ -38,8 +38,8 @@ import com.google.common.base.Preconditions; ...@@ -38,8 +38,8 @@ import com.google.common.base.Preconditions;
38 /** 38 /**
39 * Implementation of local node descriptors, remote node descriptors and link descriptors. 39 * Implementation of local node descriptors, remote node descriptors and link descriptors.
40 */ 40 */
41 -public class BGPLinkLSIdentifier { 41 +public class BgpLinkLSIdentifier {
42 - private static final Logger log = LoggerFactory.getLogger(BGPLinkLSIdentifier.class); 42 + private static final Logger log = LoggerFactory.getLogger(BgpLinkLSIdentifier.class);
43 public static final short IPV4_INTERFACE_ADDRESS_TYPE = 259; 43 public static final short IPV4_INTERFACE_ADDRESS_TYPE = 259;
44 public static final short IPV4_NEIGHBOR_ADDRESS_TYPE = 260; 44 public static final short IPV4_NEIGHBOR_ADDRESS_TYPE = 260;
45 public static final short IPV6_INTERFACE_ADDRESS_TYPE = 261; 45 public static final short IPV6_INTERFACE_ADDRESS_TYPE = 261;
...@@ -48,12 +48,12 @@ public class BGPLinkLSIdentifier { ...@@ -48,12 +48,12 @@ public class BGPLinkLSIdentifier {
48 48
49 private NodeDescriptors localNodeDescriptors; 49 private NodeDescriptors localNodeDescriptors;
50 private NodeDescriptors remoteNodeDescriptors; 50 private NodeDescriptors remoteNodeDescriptors;
51 - private List<BGPValueType> linkDescriptor; 51 + private List<BgpValueType> linkDescriptor;
52 52
53 /** 53 /**
54 * Initialize fields. 54 * Initialize fields.
55 */ 55 */
56 - public BGPLinkLSIdentifier() { 56 + public BgpLinkLSIdentifier() {
57 this.localNodeDescriptors = null; 57 this.localNodeDescriptors = null;
58 this.remoteNodeDescriptors = null; 58 this.remoteNodeDescriptors = null;
59 this.linkDescriptor = null; 59 this.linkDescriptor = null;
...@@ -66,8 +66,8 @@ public class BGPLinkLSIdentifier { ...@@ -66,8 +66,8 @@ public class BGPLinkLSIdentifier {
66 * @param remoteNodeDescriptors remote node descriptors 66 * @param remoteNodeDescriptors remote node descriptors
67 * @param linkDescriptor link descriptors 67 * @param linkDescriptor link descriptors
68 */ 68 */
69 - public BGPLinkLSIdentifier(NodeDescriptors localNodeDescriptors, NodeDescriptors remoteNodeDescriptors, 69 + public BgpLinkLSIdentifier(NodeDescriptors localNodeDescriptors, NodeDescriptors remoteNodeDescriptors,
70 - LinkedList<BGPValueType> linkDescriptor) { 70 + LinkedList<BgpValueType> linkDescriptor) {
71 this.localNodeDescriptors = Preconditions.checkNotNull(localNodeDescriptors); 71 this.localNodeDescriptors = Preconditions.checkNotNull(localNodeDescriptors);
72 this.remoteNodeDescriptors = Preconditions.checkNotNull(remoteNodeDescriptors); 72 this.remoteNodeDescriptors = Preconditions.checkNotNull(remoteNodeDescriptors);
73 this.linkDescriptor = Preconditions.checkNotNull(linkDescriptor); 73 this.linkDescriptor = Preconditions.checkNotNull(linkDescriptor);
...@@ -79,9 +79,9 @@ public class BGPLinkLSIdentifier { ...@@ -79,9 +79,9 @@ public class BGPLinkLSIdentifier {
79 * @param cb ChannelBuffer 79 * @param cb ChannelBuffer
80 * @param protocolId in linkstate nlri 80 * @param protocolId in linkstate nlri
81 * @return object of BGPLinkLSIdentifier 81 * @return object of BGPLinkLSIdentifier
82 - * @throws BGPParseException while parsing link identifier 82 + * @throws BgpParseException while parsing link identifier
83 */ 83 */
84 - public static BGPLinkLSIdentifier parseLinkIdendifier(ChannelBuffer cb, byte protocolId) throws BGPParseException { 84 + public static BgpLinkLSIdentifier parseLinkIdendifier(ChannelBuffer cb, byte protocolId) throws BgpParseException {
85 //Parse local node descriptor 85 //Parse local node descriptor
86 NodeDescriptors localNodeDescriptors = new NodeDescriptors(); 86 NodeDescriptors localNodeDescriptors = new NodeDescriptors();
87 localNodeDescriptors = parseNodeDescriptors(cb, NodeDescriptors.LOCAL_NODE_DES_TYPE, protocolId); 87 localNodeDescriptors = parseNodeDescriptors(cb, NodeDescriptors.LOCAL_NODE_DES_TYPE, protocolId);
...@@ -91,9 +91,9 @@ public class BGPLinkLSIdentifier { ...@@ -91,9 +91,9 @@ public class BGPLinkLSIdentifier {
91 remoteNodeDescriptors = parseNodeDescriptors(cb, NodeDescriptors.REMOTE_NODE_DES_TYPE, protocolId); 91 remoteNodeDescriptors = parseNodeDescriptors(cb, NodeDescriptors.REMOTE_NODE_DES_TYPE, protocolId);
92 92
93 //Parse link descriptor 93 //Parse link descriptor
94 - LinkedList<BGPValueType> linkDescriptor = new LinkedList<>(); 94 + LinkedList<BgpValueType> linkDescriptor = new LinkedList<>();
95 linkDescriptor = parseLinkDescriptors(cb); 95 linkDescriptor = parseLinkDescriptors(cb);
96 - return new BGPLinkLSIdentifier(localNodeDescriptors, remoteNodeDescriptors, linkDescriptor); 96 + return new BgpLinkLSIdentifier(localNodeDescriptors, remoteNodeDescriptors, linkDescriptor);
97 } 97 }
98 98
99 /** 99 /**
...@@ -103,15 +103,15 @@ public class BGPLinkLSIdentifier { ...@@ -103,15 +103,15 @@ public class BGPLinkLSIdentifier {
103 * @param desType descriptor type 103 * @param desType descriptor type
104 * @param protocolId protocol identifier 104 * @param protocolId protocol identifier
105 * @return object of NodeDescriptors 105 * @return object of NodeDescriptors
106 - * @throws BGPParseException while parsing Local/Remote node descriptors 106 + * @throws BgpParseException while parsing Local/Remote node descriptors
107 */ 107 */
108 public static NodeDescriptors parseNodeDescriptors(ChannelBuffer cb, short desType, byte protocolId) 108 public static NodeDescriptors parseNodeDescriptors(ChannelBuffer cb, short desType, byte protocolId)
109 - throws BGPParseException { 109 + throws BgpParseException {
110 ChannelBuffer tempBuf = cb; 110 ChannelBuffer tempBuf = cb;
111 short type = cb.readShort(); 111 short type = cb.readShort();
112 short length = cb.readShort(); 112 short length = cb.readShort();
113 if (cb.readableBytes() < length) { 113 if (cb.readableBytes() < length) {
114 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 114 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
115 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN)); 115 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
116 } 116 }
117 NodeDescriptors nodeIdentifier = new NodeDescriptors(); 117 NodeDescriptors nodeIdentifier = new NodeDescriptors();
...@@ -120,7 +120,7 @@ public class BGPLinkLSIdentifier { ...@@ -120,7 +120,7 @@ public class BGPLinkLSIdentifier {
120 if (type == desType) { 120 if (type == desType) {
121 nodeIdentifier = NodeDescriptors.read(tempCb, length, desType, protocolId); 121 nodeIdentifier = NodeDescriptors.read(tempCb, length, desType, protocolId);
122 } else { 122 } else {
123 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); 123 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null);
124 } 124 }
125 return nodeIdentifier; 125 return nodeIdentifier;
126 } 126 }
...@@ -130,11 +130,11 @@ public class BGPLinkLSIdentifier { ...@@ -130,11 +130,11 @@ public class BGPLinkLSIdentifier {
130 * 130 *
131 * @param cb ChannelBuffer 131 * @param cb ChannelBuffer
132 * @return list of link descriptors 132 * @return list of link descriptors
133 - * @throws BGPParseException while parsing link descriptors 133 + * @throws BgpParseException while parsing link descriptors
134 */ 134 */
135 - public static LinkedList<BGPValueType> parseLinkDescriptors(ChannelBuffer cb) throws BGPParseException { 135 + public static LinkedList<BgpValueType> parseLinkDescriptors(ChannelBuffer cb) throws BgpParseException {
136 - LinkedList<BGPValueType> linkDescriptor = new LinkedList<>(); 136 + LinkedList<BgpValueType> linkDescriptor = new LinkedList<>();
137 - BGPValueType tlv = null; 137 + BgpValueType tlv = null;
138 int count = 0; 138 int count = 0;
139 139
140 while (cb.readableBytes() > 0) { 140 while (cb.readableBytes() > 0) {
...@@ -142,7 +142,7 @@ public class BGPLinkLSIdentifier { ...@@ -142,7 +142,7 @@ public class BGPLinkLSIdentifier {
142 short type = cb.readShort(); 142 short type = cb.readShort();
143 short length = cb.readShort(); 143 short length = cb.readShort();
144 if (cb.readableBytes() < length) { 144 if (cb.readableBytes() < length) {
145 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 145 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
146 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN)); 146 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
147 } 147 }
148 ChannelBuffer tempCb = cb.readBytes(length); 148 ChannelBuffer tempCb = cb.readBytes(length);
...@@ -168,8 +168,8 @@ public class BGPLinkLSIdentifier { ...@@ -168,8 +168,8 @@ public class BGPLinkLSIdentifier {
168 //MultiTopologyId TLV cannot repeat more than once 168 //MultiTopologyId TLV cannot repeat more than once
169 if (count > 1) { 169 if (count > 1) {
170 //length + 4 implies data contains type, length and value 170 //length + 4 implies data contains type, length and value
171 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 171 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
172 - BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, tempBuf.readBytes(length 172 + BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR, tempBuf.readBytes(length
173 + TYPE_AND_LEN)); 173 + TYPE_AND_LEN));
174 } 174 }
175 break; 175 break;
...@@ -204,7 +204,7 @@ public class BGPLinkLSIdentifier { ...@@ -204,7 +204,7 @@ public class BGPLinkLSIdentifier {
204 * 204 *
205 * @return link descriptors 205 * @return link descriptors
206 */ 206 */
207 - public List<BGPValueType> linkDescriptors() { 207 + public List<BgpValueType> linkDescriptors() {
208 return this.linkDescriptor; 208 return this.linkDescriptor;
209 } 209 }
210 210
...@@ -218,19 +218,19 @@ public class BGPLinkLSIdentifier { ...@@ -218,19 +218,19 @@ public class BGPLinkLSIdentifier {
218 if (this == obj) { 218 if (this == obj) {
219 return true; 219 return true;
220 } 220 }
221 - if (obj instanceof BGPLinkLSIdentifier) { 221 + if (obj instanceof BgpLinkLSIdentifier) {
222 int countObjSubTlv = 0; 222 int countObjSubTlv = 0;
223 int countOtherSubTlv = 0; 223 int countOtherSubTlv = 0;
224 boolean isCommonSubTlv = true; 224 boolean isCommonSubTlv = true;
225 - BGPLinkLSIdentifier other = (BGPLinkLSIdentifier) obj; 225 + BgpLinkLSIdentifier other = (BgpLinkLSIdentifier) obj;
226 - Iterator<BGPValueType> objListIterator = other.linkDescriptor.iterator(); 226 + Iterator<BgpValueType> objListIterator = other.linkDescriptor.iterator();
227 countOtherSubTlv = other.linkDescriptor.size(); 227 countOtherSubTlv = other.linkDescriptor.size();
228 countObjSubTlv = linkDescriptor.size(); 228 countObjSubTlv = linkDescriptor.size();
229 if (countObjSubTlv != countOtherSubTlv) { 229 if (countObjSubTlv != countOtherSubTlv) {
230 return false; 230 return false;
231 } else { 231 } else {
232 while (objListIterator.hasNext() && isCommonSubTlv) { 232 while (objListIterator.hasNext() && isCommonSubTlv) {
233 - BGPValueType subTlv = objListIterator.next(); 233 + BgpValueType subTlv = objListIterator.next();
234 isCommonSubTlv = Objects.equals(linkDescriptor.contains(subTlv), 234 isCommonSubTlv = Objects.equals(linkDescriptor.contains(subTlv),
235 other.linkDescriptor.contains(subTlv)); 235 other.linkDescriptor.contains(subTlv));
236 } 236 }
......
...@@ -18,12 +18,12 @@ package org.onosproject.bgpio.protocol.linkstate; ...@@ -18,12 +18,12 @@ package org.onosproject.bgpio.protocol.linkstate;
18 import java.util.List; 18 import java.util.List;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 import org.onosproject.bgpio.protocol.BgpLinkLsNlri; 22 import org.onosproject.bgpio.protocol.BgpLinkLsNlri;
23 import org.onosproject.bgpio.protocol.NlriType; 23 import org.onosproject.bgpio.protocol.NlriType;
24 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; 24 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4.ProtocolType;
25 -import org.onosproject.bgpio.types.BGPErrorType; 25 +import org.onosproject.bgpio.types.BgpErrorType;
26 -import org.onosproject.bgpio.types.BGPValueType; 26 +import org.onosproject.bgpio.types.BgpValueType;
27 import org.onosproject.bgpio.types.RouteDistinguisher; 27 import org.onosproject.bgpio.types.RouteDistinguisher;
28 import org.onosproject.bgpio.util.Constants; 28 import org.onosproject.bgpio.util.Constants;
29 import org.slf4j.Logger; 29 import org.slf4j.Logger;
...@@ -58,7 +58,7 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -58,7 +58,7 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
58 private static final Logger log = LoggerFactory.getLogger(BgpLinkLsNlriVer4.class); 58 private static final Logger log = LoggerFactory.getLogger(BgpLinkLsNlriVer4.class);
59 public static final int LINK_NLRITYPE = 2; 59 public static final int LINK_NLRITYPE = 2;
60 60
61 - private BGPLinkLSIdentifier linkLSIdentifier; 61 + private BgpLinkLSIdentifier linkLSIdentifier;
62 private byte protocolId; 62 private byte protocolId;
63 private long identifier; 63 private long identifier;
64 private RouteDistinguisher routeDistinguisher; 64 private RouteDistinguisher routeDistinguisher;
...@@ -84,7 +84,7 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -84,7 +84,7 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
84 * @param routeDistinguisher route distinguisher from message 84 * @param routeDistinguisher route distinguisher from message
85 * @param isVpn vpn info availability in message 85 * @param isVpn vpn info availability in message
86 */ 86 */
87 - public BgpLinkLsNlriVer4(byte protocolId, long identifier, BGPLinkLSIdentifier linkLSIdentifier, 87 + public BgpLinkLsNlriVer4(byte protocolId, long identifier, BgpLinkLSIdentifier linkLSIdentifier,
88 RouteDistinguisher routeDistinguisher, boolean isVpn) { 88 RouteDistinguisher routeDistinguisher, boolean isVpn) {
89 this.protocolId = protocolId; 89 this.protocolId = protocolId;
90 this.identifier = identifier; 90 this.identifier = identifier;
...@@ -100,9 +100,9 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -100,9 +100,9 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
100 * @param afi Address Family Identifier 100 * @param afi Address Family Identifier
101 * @param safi Subsequent Address Family Identifier 101 * @param safi Subsequent Address Family Identifier
102 * @return object of this class 102 * @return object of this class
103 - * @throws BGPParseException while parsing Link LS NLRI 103 + * @throws BgpParseException while parsing Link LS NLRI
104 */ 104 */
105 - public static BgpLinkLsNlriVer4 read(ChannelBuffer cb, short afi, byte safi) throws BGPParseException { 105 + public static BgpLinkLsNlriVer4 read(ChannelBuffer cb, short afi, byte safi) throws BgpParseException {
106 boolean isVpn = false; 106 boolean isVpn = false;
107 RouteDistinguisher routeDistinguisher = null; 107 RouteDistinguisher routeDistinguisher = null;
108 if ((afi == Constants.AFI_VALUE) && (safi == Constants.VPN_SAFI_VALUE)) { 108 if ((afi == Constants.AFI_VALUE) && (safi == Constants.VPN_SAFI_VALUE)) {
...@@ -115,8 +115,8 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -115,8 +115,8 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
115 byte protocolId = cb.readByte(); 115 byte protocolId = cb.readByte();
116 long identifier = cb.readLong(); 116 long identifier = cb.readLong();
117 117
118 - BGPLinkLSIdentifier linkLSIdentifier = new BGPLinkLSIdentifier(); 118 + BgpLinkLSIdentifier linkLSIdentifier = new BgpLinkLSIdentifier();
119 - linkLSIdentifier = BGPLinkLSIdentifier.parseLinkIdendifier(cb, protocolId); 119 + linkLSIdentifier = BgpLinkLSIdentifier.parseLinkIdendifier(cb, protocolId);
120 return new BgpLinkLsNlriVer4(protocolId, identifier, linkLSIdentifier, routeDistinguisher, isVpn); 120 return new BgpLinkLsNlriVer4(protocolId, identifier, linkLSIdentifier, routeDistinguisher, isVpn);
121 } 121 }
122 122
...@@ -135,12 +135,12 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -135,12 +135,12 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
135 * 135 *
136 * @param linkLSIdentifier link LS identifier to set 136 * @param linkLSIdentifier link LS identifier to set
137 */ 137 */
138 - public void setLinkLSIdentifier(BGPLinkLSIdentifier linkLSIdentifier) { 138 + public void setLinkLSIdentifier(BgpLinkLSIdentifier linkLSIdentifier) {
139 this.linkLSIdentifier = linkLSIdentifier; 139 this.linkLSIdentifier = linkLSIdentifier;
140 } 140 }
141 141
142 @Override 142 @Override
143 - public ProtocolType getProtocolId() throws BGPParseException { 143 + public ProtocolType getProtocolId() throws BgpParseException {
144 switch (protocolId) { 144 switch (protocolId) {
145 case Constants.ISIS_LEVELONE: 145 case Constants.ISIS_LEVELONE:
146 return ProtocolType.ISIS_LEVEL_ONE; 146 return ProtocolType.ISIS_LEVEL_ONE;
...@@ -155,7 +155,7 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -155,7 +155,7 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
155 case Constants.OSPFV3: 155 case Constants.OSPFV3:
156 return ProtocolType.OSPF_V3; 156 return ProtocolType.OSPF_V3;
157 default: 157 default:
158 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); 158 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
159 } 159 }
160 } 160 }
161 161
...@@ -188,12 +188,12 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { ...@@ -188,12 +188,12 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
188 * 188 *
189 * @return link identifier 189 * @return link identifier
190 */ 190 */
191 - public BGPLinkLSIdentifier getLinkIdentifier() { 191 + public BgpLinkLSIdentifier getLinkIdentifier() {
192 return this.linkLSIdentifier; 192 return this.linkLSIdentifier;
193 } 193 }
194 194
195 @Override 195 @Override
196 - public List<BGPValueType> linkDescriptors() { 196 + public List<BgpValueType> linkDescriptors() {
197 return this.linkLSIdentifier.linkDescriptors(); 197 return this.linkLSIdentifier.linkDescriptors();
198 } 198 }
199 199
......
...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol.linkstate; ...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol.linkstate;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 import org.onosproject.bgpio.util.Constants; 23 import org.onosproject.bgpio.util.Constants;
24 import org.slf4j.Logger; 24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory; 25 import org.slf4j.LoggerFactory;
...@@ -29,15 +29,15 @@ import com.google.common.base.MoreObjects; ...@@ -29,15 +29,15 @@ import com.google.common.base.MoreObjects;
29 /** 29 /**
30 * Implementation of Node Identifier which includes local node descriptor/remote node descriptors. 30 * Implementation of Node Identifier which includes local node descriptor/remote node descriptors.
31 */ 31 */
32 -public class BGPNodeLSIdentifier { 32 +public class BgpNodeLSIdentifier {
33 33
34 - protected static final Logger log = LoggerFactory.getLogger(BGPNodeLSIdentifier.class); 34 + protected static final Logger log = LoggerFactory.getLogger(BgpNodeLSIdentifier.class);
35 private NodeDescriptors nodeDescriptors; 35 private NodeDescriptors nodeDescriptors;
36 36
37 /** 37 /**
38 * Resets fields. 38 * Resets fields.
39 */ 39 */
40 - public BGPNodeLSIdentifier() { 40 + public BgpNodeLSIdentifier() {
41 this.nodeDescriptors = null; 41 this.nodeDescriptors = null;
42 } 42 }
43 43
...@@ -46,7 +46,7 @@ public class BGPNodeLSIdentifier { ...@@ -46,7 +46,7 @@ public class BGPNodeLSIdentifier {
46 * 46 *
47 * @param nodeDescriptors local/remote node descriptor 47 * @param nodeDescriptors local/remote node descriptor
48 */ 48 */
49 - public BGPNodeLSIdentifier(NodeDescriptors nodeDescriptors) { 49 + public BgpNodeLSIdentifier(NodeDescriptors nodeDescriptors) {
50 this.nodeDescriptors = nodeDescriptors; 50 this.nodeDescriptors = nodeDescriptors;
51 } 51 }
52 52
...@@ -56,15 +56,15 @@ public class BGPNodeLSIdentifier { ...@@ -56,15 +56,15 @@ public class BGPNodeLSIdentifier {
56 * @param cb ChannelBuffer 56 * @param cb ChannelBuffer
57 * @param protocolId protocol identifier 57 * @param protocolId protocol identifier
58 * @return object of this BGPNodeLSIdentifier 58 * @return object of this BGPNodeLSIdentifier
59 - * @throws BGPParseException while parsing local node descriptors 59 + * @throws BgpParseException while parsing local node descriptors
60 */ 60 */
61 - public static BGPNodeLSIdentifier parseLocalNodeDescriptors(ChannelBuffer cb, byte protocolId) 61 + public static BgpNodeLSIdentifier parseLocalNodeDescriptors(ChannelBuffer cb, byte protocolId)
62 - throws BGPParseException { 62 + throws BgpParseException {
63 ChannelBuffer tempBuf = cb; 63 ChannelBuffer tempBuf = cb;
64 short type = cb.readShort(); 64 short type = cb.readShort();
65 short length = cb.readShort(); 65 short length = cb.readShort();
66 if (cb.readableBytes() < length) { 66 if (cb.readableBytes() < length) {
67 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 67 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
68 tempBuf.readBytes(cb.readableBytes() + Constants.TYPE_AND_LEN)); 68 tempBuf.readBytes(cb.readableBytes() + Constants.TYPE_AND_LEN));
69 } 69 }
70 NodeDescriptors nodeDescriptors = new NodeDescriptors(); 70 NodeDescriptors nodeDescriptors = new NodeDescriptors();
...@@ -73,9 +73,9 @@ public class BGPNodeLSIdentifier { ...@@ -73,9 +73,9 @@ public class BGPNodeLSIdentifier {
73 if (type == NodeDescriptors.LOCAL_NODE_DES_TYPE) { 73 if (type == NodeDescriptors.LOCAL_NODE_DES_TYPE) {
74 nodeDescriptors = NodeDescriptors.read(tempCb, length, type, protocolId); 74 nodeDescriptors = NodeDescriptors.read(tempCb, length, type, protocolId);
75 } else { 75 } else {
76 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); 76 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null);
77 } 77 }
78 - return new BGPNodeLSIdentifier(nodeDescriptors); 78 + return new BgpNodeLSIdentifier(nodeDescriptors);
79 } 79 }
80 80
81 /** 81 /**
...@@ -92,8 +92,8 @@ public class BGPNodeLSIdentifier { ...@@ -92,8 +92,8 @@ public class BGPNodeLSIdentifier {
92 if (this == obj) { 92 if (this == obj) {
93 return true; 93 return true;
94 } 94 }
95 - if (obj instanceof BGPNodeLSIdentifier) { 95 + if (obj instanceof BgpNodeLSIdentifier) {
96 - BGPNodeLSIdentifier other = (BGPNodeLSIdentifier) obj; 96 + BgpNodeLSIdentifier other = (BgpNodeLSIdentifier) obj;
97 return Objects.equals(nodeDescriptors, other.nodeDescriptors); 97 return Objects.equals(nodeDescriptors, other.nodeDescriptors);
98 } 98 }
99 return false; 99 return false;
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
16 package org.onosproject.bgpio.protocol.linkstate; 16 package org.onosproject.bgpio.protocol.linkstate;
17 17
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 -import org.onosproject.bgpio.exceptions.BGPParseException; 19 +import org.onosproject.bgpio.exceptions.BgpParseException;
20 -import org.onosproject.bgpio.protocol.BGPNodeLSNlri; 20 +import org.onosproject.bgpio.protocol.BgpNodeLSNlri;
21 import org.onosproject.bgpio.protocol.NlriType; 21 import org.onosproject.bgpio.protocol.NlriType;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 import org.onosproject.bgpio.types.RouteDistinguisher; 23 import org.onosproject.bgpio.types.RouteDistinguisher;
24 import org.onosproject.bgpio.util.Constants; 24 import org.onosproject.bgpio.util.Constants;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implementation of Node LS NLRI. 31 * Implementation of Node LS NLRI.
32 */ 32 */
33 -public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { 33 +public class BgpNodeLSNlriVer4 implements BgpNodeLSNlri {
34 34
35 /* 35 /*
36 *REFERENCE : draft-ietf-idr-ls-distribution-11 36 *REFERENCE : draft-ietf-idr-ls-distribution-11
...@@ -48,13 +48,13 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -48,13 +48,13 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
48 Figure : The Node NLRI format 48 Figure : The Node NLRI format
49 */ 49 */
50 50
51 - protected static final Logger log = LoggerFactory.getLogger(BGPNodeLSNlriVer4.class); 51 + protected static final Logger log = LoggerFactory.getLogger(BgpNodeLSNlriVer4.class);
52 52
53 public static final int NODE_NLRITYPE = 1; 53 public static final int NODE_NLRITYPE = 1;
54 public static final int IDENTIFIER_LENGTH = 16; 54 public static final int IDENTIFIER_LENGTH = 16;
55 private long identifier; 55 private long identifier;
56 private byte protocolId; 56 private byte protocolId;
57 - private BGPNodeLSIdentifier localNodeDescriptors; 57 + private BgpNodeLSIdentifier localNodeDescriptors;
58 private RouteDistinguisher routeDistinguisher; 58 private RouteDistinguisher routeDistinguisher;
59 private boolean isVpn; 59 private boolean isVpn;
60 60
...@@ -87,7 +87,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -87,7 +87,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
87 /** 87 /**
88 * Reset fields. 88 * Reset fields.
89 */ 89 */
90 - public BGPNodeLSNlriVer4() { 90 + public BgpNodeLSNlriVer4() {
91 this.identifier = 0; 91 this.identifier = 0;
92 this.protocolId = 0; 92 this.protocolId = 0;
93 this.localNodeDescriptors = null; 93 this.localNodeDescriptors = null;
...@@ -104,7 +104,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -104,7 +104,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
104 * @param isVpn true if VPN info is present 104 * @param isVpn true if VPN info is present
105 * @param routeDistinguisher unique for each VPN 105 * @param routeDistinguisher unique for each VPN
106 */ 106 */
107 - public BGPNodeLSNlriVer4(long identifier, byte protocolId, BGPNodeLSIdentifier localNodeDescriptors, boolean isVpn, 107 + public BgpNodeLSNlriVer4(long identifier, byte protocolId, BgpNodeLSIdentifier localNodeDescriptors, boolean isVpn,
108 RouteDistinguisher routeDistinguisher) { 108 RouteDistinguisher routeDistinguisher) {
109 this.identifier = identifier; 109 this.identifier = identifier;
110 this.protocolId = protocolId; 110 this.protocolId = protocolId;
...@@ -120,9 +120,9 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -120,9 +120,9 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
120 * @param afi Address Family Identifier 120 * @param afi Address Family Identifier
121 * @param safi Subsequent Address Family Identifier 121 * @param safi Subsequent Address Family Identifier
122 * @return object of this class 122 * @return object of this class
123 - * @throws BGPParseException while parsing node descriptors 123 + * @throws BgpParseException while parsing node descriptors
124 */ 124 */
125 - public static BGPNodeLSNlriVer4 read(ChannelBuffer cb, short afi, byte safi) throws BGPParseException { 125 + public static BgpNodeLSNlriVer4 read(ChannelBuffer cb, short afi, byte safi) throws BgpParseException {
126 boolean isVpn = false; 126 boolean isVpn = false;
127 RouteDistinguisher routeDistinguisher = null; 127 RouteDistinguisher routeDistinguisher = null;
128 if ((afi == Constants.AFI_VALUE) && (safi == Constants.VPN_SAFI_VALUE)) { 128 if ((afi == Constants.AFI_VALUE) && (safi == Constants.VPN_SAFI_VALUE)) {
...@@ -136,9 +136,9 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -136,9 +136,9 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
136 long identifier = cb.readLong(); 136 long identifier = cb.readLong();
137 137
138 // Parse Local Node Descriptors 138 // Parse Local Node Descriptors
139 - BGPNodeLSIdentifier localNodeDescriptors = new BGPNodeLSIdentifier(); 139 + BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier();
140 - localNodeDescriptors = BGPNodeLSIdentifier.parseLocalNodeDescriptors(cb, protocolId); 140 + localNodeDescriptors = BgpNodeLSIdentifier.parseLocalNodeDescriptors(cb, protocolId);
141 - return new BGPNodeLSNlriVer4(identifier, protocolId, localNodeDescriptors, isVpn, routeDistinguisher); 141 + return new BgpNodeLSNlriVer4(identifier, protocolId, localNodeDescriptors, isVpn, routeDistinguisher);
142 } 142 }
143 143
144 @Override 144 @Override
...@@ -147,7 +147,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -147,7 +147,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
147 } 147 }
148 148
149 @Override 149 @Override
150 - public BGPNodeLSIdentifier getLocalNodeDescriptors() { 150 + public BgpNodeLSIdentifier getLocalNodeDescriptors() {
151 return this.localNodeDescriptors; 151 return this.localNodeDescriptors;
152 } 152 }
153 153
...@@ -175,12 +175,12 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -175,12 +175,12 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
175 * 175 *
176 * @param localNodeDescriptors node LS identifier to set 176 * @param localNodeDescriptors node LS identifier to set
177 */ 177 */
178 - public void setNodeLSIdentifier(BGPNodeLSIdentifier localNodeDescriptors) { 178 + public void setNodeLSIdentifier(BgpNodeLSIdentifier localNodeDescriptors) {
179 this.localNodeDescriptors = localNodeDescriptors; 179 this.localNodeDescriptors = localNodeDescriptors;
180 } 180 }
181 181
182 @Override 182 @Override
183 - public ProtocolType getProtocolId() throws BGPParseException { 183 + public ProtocolType getProtocolId() throws BgpParseException {
184 switch (protocolId) { 184 switch (protocolId) {
185 case Constants.ISIS_LEVELONE: 185 case Constants.ISIS_LEVELONE:
186 return ProtocolType.ISIS_LEVEL_ONE; 186 return ProtocolType.ISIS_LEVEL_ONE;
...@@ -195,7 +195,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { ...@@ -195,7 +195,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
195 case Constants.OSPFV3: 195 case Constants.OSPFV3:
196 return ProtocolType.OSPF_V3; 196 return ProtocolType.OSPF_V3;
197 default: 197 default:
198 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); 198 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
199 } 199 }
200 } 200 }
201 201
......
...@@ -18,11 +18,11 @@ package org.onosproject.bgpio.protocol.linkstate; ...@@ -18,11 +18,11 @@ package org.onosproject.bgpio.protocol.linkstate;
18 import java.util.LinkedList; 18 import java.util.LinkedList;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.protocol.BGPPrefixLSNlri; 22 +import org.onosproject.bgpio.protocol.BgpPrefixLSNlri;
23 import org.onosproject.bgpio.protocol.NlriType; 23 import org.onosproject.bgpio.protocol.NlriType;
24 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; 24 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4.ProtocolType;
25 -import org.onosproject.bgpio.types.BGPValueType; 25 +import org.onosproject.bgpio.types.BgpValueType;
26 import org.onosproject.bgpio.types.RouteDistinguisher; 26 import org.onosproject.bgpio.types.RouteDistinguisher;
27 import org.onosproject.bgpio.util.Constants; 27 import org.onosproject.bgpio.util.Constants;
28 import org.slf4j.Logger; 28 import org.slf4j.Logger;
...@@ -33,7 +33,7 @@ import com.google.common.base.MoreObjects; ...@@ -33,7 +33,7 @@ import com.google.common.base.MoreObjects;
33 /** 33 /**
34 * Implementation of Prefix IPV4 LS NLRI. 34 * Implementation of Prefix IPV4 LS NLRI.
35 */ 35 */
36 -public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { 36 +public class BgpPrefixIPv4LSNlriVer4 implements BgpPrefixLSNlri {
37 37
38 /* 38 /*
39 * REFERENCE : draft-ietf-idr-ls-distribution-11 39 * REFERENCE : draft-ietf-idr-ls-distribution-11
...@@ -53,7 +53,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -53,7 +53,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
53 Figure : The IPv4/IPv6 Topology Prefix NLRI format 53 Figure : The IPv4/IPv6 Topology Prefix NLRI format
54 */ 54 */
55 55
56 - protected static final Logger log = LoggerFactory.getLogger(BGPPrefixIPv4LSNlriVer4.class); 56 + protected static final Logger log = LoggerFactory.getLogger(BgpPrefixIPv4LSNlriVer4.class);
57 57
58 public static final int PREFIX_IPV4_NLRITYPE = 3; 58 public static final int PREFIX_IPV4_NLRITYPE = 3;
59 public static final int IDENTIFIER_LENGTH = 16; 59 public static final int IDENTIFIER_LENGTH = 16;
...@@ -61,12 +61,12 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -61,12 +61,12 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
61 private byte protocolId; 61 private byte protocolId;
62 private RouteDistinguisher routeDistinguisher; 62 private RouteDistinguisher routeDistinguisher;
63 private boolean isVpn; 63 private boolean isVpn;
64 - private BGPPrefixLSIdentifier bgpPrefixLSIdentifier; 64 + private BgpPrefixLSIdentifier bgpPrefixLSIdentifier;
65 65
66 /** 66 /**
67 * Resets parameters. 67 * Resets parameters.
68 */ 68 */
69 - public BGPPrefixIPv4LSNlriVer4() { 69 + public BgpPrefixIPv4LSNlriVer4() {
70 this.identifier = 0; 70 this.identifier = 0;
71 this.protocolId = 0; 71 this.protocolId = 0;
72 this.bgpPrefixLSIdentifier = null; 72 this.bgpPrefixLSIdentifier = null;
...@@ -83,7 +83,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -83,7 +83,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
83 * @param routeDistinguisher RouteDistinguisher 83 * @param routeDistinguisher RouteDistinguisher
84 * @param isVpn vpn availability in message 84 * @param isVpn vpn availability in message
85 */ 85 */
86 - public BGPPrefixIPv4LSNlriVer4(long identifier, byte protocolId, BGPPrefixLSIdentifier bgpPrefixLSIdentifier, 86 + public BgpPrefixIPv4LSNlriVer4(long identifier, byte protocolId, BgpPrefixLSIdentifier bgpPrefixLSIdentifier,
87 RouteDistinguisher routeDistinguisher, boolean isVpn) { 87 RouteDistinguisher routeDistinguisher, boolean isVpn) {
88 this.identifier = identifier; 88 this.identifier = identifier;
89 this.protocolId = protocolId; 89 this.protocolId = protocolId;
...@@ -99,9 +99,9 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -99,9 +99,9 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
99 * @param afi Address family identifier 99 * @param afi Address family identifier
100 * @param safi Subsequent address family identifier 100 * @param safi Subsequent address family identifier
101 * @return object of BGPPrefixIPv4LSNlriVer4 101 * @return object of BGPPrefixIPv4LSNlriVer4
102 - * @throws BGPParseException while parsing Prefix LS Nlri 102 + * @throws BgpParseException while parsing Prefix LS Nlri
103 */ 103 */
104 - public static BGPPrefixIPv4LSNlriVer4 read(ChannelBuffer cb, short afi, byte safi) throws BGPParseException { 104 + public static BgpPrefixIPv4LSNlriVer4 read(ChannelBuffer cb, short afi, byte safi) throws BgpParseException {
105 105
106 boolean isVpn = false; 106 boolean isVpn = false;
107 RouteDistinguisher routeDistinguisher = null; 107 RouteDistinguisher routeDistinguisher = null;
...@@ -115,9 +115,9 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -115,9 +115,9 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
115 byte protocolId = cb.readByte(); 115 byte protocolId = cb.readByte();
116 long identifier = cb.readLong(); 116 long identifier = cb.readLong();
117 117
118 - BGPPrefixLSIdentifier bgpPrefixLSIdentifier = new BGPPrefixLSIdentifier(); 118 + BgpPrefixLSIdentifier bgpPrefixLSIdentifier = new BgpPrefixLSIdentifier();
119 - bgpPrefixLSIdentifier = BGPPrefixLSIdentifier.parsePrefixIdendifier(cb, protocolId); 119 + bgpPrefixLSIdentifier = BgpPrefixLSIdentifier.parsePrefixIdendifier(cb, protocolId);
120 - return new BGPPrefixIPv4LSNlriVer4(identifier, protocolId, bgpPrefixLSIdentifier, routeDistinguisher, isVpn); 120 + return new BgpPrefixIPv4LSNlriVer4(identifier, protocolId, bgpPrefixLSIdentifier, routeDistinguisher, isVpn);
121 } 121 }
122 122
123 @Override 123 @Override
...@@ -140,12 +140,12 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -140,12 +140,12 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
140 * 140 *
141 * @param bgpPrefixLSIdentifier prefix identifier to set 141 * @param bgpPrefixLSIdentifier prefix identifier to set
142 */ 142 */
143 - public void setPrefixLSIdentifier(BGPPrefixLSIdentifier bgpPrefixLSIdentifier) { 143 + public void setPrefixLSIdentifier(BgpPrefixLSIdentifier bgpPrefixLSIdentifier) {
144 this.bgpPrefixLSIdentifier = bgpPrefixLSIdentifier; 144 this.bgpPrefixLSIdentifier = bgpPrefixLSIdentifier;
145 } 145 }
146 146
147 @Override 147 @Override
148 - public ProtocolType getProtocolId() throws BGPParseException { 148 + public ProtocolType getProtocolId() throws BgpParseException {
149 switch (protocolId) { 149 switch (protocolId) {
150 case Constants.ISIS_LEVELONE: 150 case Constants.ISIS_LEVELONE:
151 return ProtocolType.ISIS_LEVEL_ONE; 151 return ProtocolType.ISIS_LEVEL_ONE;
...@@ -160,7 +160,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -160,7 +160,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
160 case Constants.OSPFV3: 160 case Constants.OSPFV3:
161 return ProtocolType.OSPF_V3; 161 return ProtocolType.OSPF_V3;
162 default: 162 default:
163 - throw new BGPParseException("protocol id not valid"); 163 + throw new BgpParseException("protocol id not valid");
164 } 164 }
165 } 165 }
166 166
...@@ -178,7 +178,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -178,7 +178,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
178 * 178 *
179 * @return Prefix Identifier 179 * @return Prefix Identifier
180 */ 180 */
181 - public BGPPrefixLSIdentifier getPrefixIdentifier() { 181 + public BgpPrefixLSIdentifier getPrefixIdentifier() {
182 return this.bgpPrefixLSIdentifier; 182 return this.bgpPrefixLSIdentifier;
183 } 183 }
184 184
...@@ -188,7 +188,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { ...@@ -188,7 +188,7 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
188 } 188 }
189 189
190 @Override 190 @Override
191 - public LinkedList<BGPValueType> getPrefixdescriptor() { 191 + public LinkedList<BgpValueType> getPrefixdescriptor() {
192 return this.bgpPrefixLSIdentifier.getPrefixdescriptor(); 192 return this.bgpPrefixLSIdentifier.getPrefixdescriptor();
193 } 193 }
194 194
......
...@@ -21,9 +21,9 @@ import java.util.LinkedList; ...@@ -21,9 +21,9 @@ import java.util.LinkedList;
21 import java.util.Objects; 21 import java.util.Objects;
22 22
23 import org.jboss.netty.buffer.ChannelBuffer; 23 import org.jboss.netty.buffer.ChannelBuffer;
24 -import org.onosproject.bgpio.exceptions.BGPParseException; 24 +import org.onosproject.bgpio.exceptions.BgpParseException;
25 -import org.onosproject.bgpio.types.BGPErrorType; 25 +import org.onosproject.bgpio.types.BgpErrorType;
26 -import org.onosproject.bgpio.types.BGPValueType; 26 +import org.onosproject.bgpio.types.BgpValueType;
27 import org.onosproject.bgpio.types.IPReachabilityInformationTlv; 27 import org.onosproject.bgpio.types.IPReachabilityInformationTlv;
28 import org.onosproject.bgpio.types.OSPFRouteTypeTlv; 28 import org.onosproject.bgpio.types.OSPFRouteTypeTlv;
29 import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId; 29 import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId;
...@@ -36,17 +36,17 @@ import com.google.common.base.MoreObjects; ...@@ -36,17 +36,17 @@ import com.google.common.base.MoreObjects;
36 /** 36 /**
37 * Provides Implementation of Local node descriptors and prefix descriptors. 37 * Provides Implementation of Local node descriptors and prefix descriptors.
38 */ 38 */
39 -public class BGPPrefixLSIdentifier { 39 +public class BgpPrefixLSIdentifier {
40 40
41 - protected static final Logger log = LoggerFactory.getLogger(BGPPrefixLSIdentifier.class); 41 + protected static final Logger log = LoggerFactory.getLogger(BgpPrefixLSIdentifier.class);
42 public static final int TYPE_AND_LEN = 4; 42 public static final int TYPE_AND_LEN = 4;
43 private NodeDescriptors localNodeDescriptors; 43 private NodeDescriptors localNodeDescriptors;
44 - private LinkedList<BGPValueType> prefixDescriptor; 44 + private LinkedList<BgpValueType> prefixDescriptor;
45 45
46 /** 46 /**
47 * Resets parameters. 47 * Resets parameters.
48 */ 48 */
49 - public BGPPrefixLSIdentifier() { 49 + public BgpPrefixLSIdentifier() {
50 this.localNodeDescriptors = null; 50 this.localNodeDescriptors = null;
51 this.prefixDescriptor = null; 51 this.prefixDescriptor = null;
52 } 52 }
...@@ -57,7 +57,7 @@ public class BGPPrefixLSIdentifier { ...@@ -57,7 +57,7 @@ public class BGPPrefixLSIdentifier {
57 * @param localNodeDescriptors Local node descriptors 57 * @param localNodeDescriptors Local node descriptors
58 * @param prefixDescriptor Prefix Descriptors 58 * @param prefixDescriptor Prefix Descriptors
59 */ 59 */
60 - public BGPPrefixLSIdentifier(NodeDescriptors localNodeDescriptors, LinkedList<BGPValueType> prefixDescriptor) { 60 + public BgpPrefixLSIdentifier(NodeDescriptors localNodeDescriptors, LinkedList<BgpValueType> prefixDescriptor) {
61 this.localNodeDescriptors = localNodeDescriptors; 61 this.localNodeDescriptors = localNodeDescriptors;
62 this.prefixDescriptor = prefixDescriptor; 62 this.prefixDescriptor = prefixDescriptor;
63 } 63 }
...@@ -68,18 +68,18 @@ public class BGPPrefixLSIdentifier { ...@@ -68,18 +68,18 @@ public class BGPPrefixLSIdentifier {
68 * @param cb ChannelBuffer 68 * @param cb ChannelBuffer
69 * @param protocolId protocol ID 69 * @param protocolId protocol ID
70 * @return object of this class 70 * @return object of this class
71 - * @throws BGPParseException while parsing Prefix Identifier 71 + * @throws BgpParseException while parsing Prefix Identifier
72 */ 72 */
73 - public static BGPPrefixLSIdentifier parsePrefixIdendifier(ChannelBuffer cb, byte protocolId) 73 + public static BgpPrefixLSIdentifier parsePrefixIdendifier(ChannelBuffer cb, byte protocolId)
74 - throws BGPParseException { 74 + throws BgpParseException {
75 //Parse Local Node descriptor 75 //Parse Local Node descriptor
76 NodeDescriptors localNodeDescriptors = new NodeDescriptors(); 76 NodeDescriptors localNodeDescriptors = new NodeDescriptors();
77 localNodeDescriptors = parseLocalNodeDescriptors(cb, protocolId); 77 localNodeDescriptors = parseLocalNodeDescriptors(cb, protocolId);
78 78
79 //Parse Prefix descriptor 79 //Parse Prefix descriptor
80 - LinkedList<BGPValueType> prefixDescriptor = new LinkedList<>(); 80 + LinkedList<BgpValueType> prefixDescriptor = new LinkedList<>();
81 prefixDescriptor = parsePrefixDescriptors(cb); 81 prefixDescriptor = parsePrefixDescriptors(cb);
82 - return new BGPPrefixLSIdentifier(localNodeDescriptors, prefixDescriptor); 82 + return new BgpPrefixLSIdentifier(localNodeDescriptors, prefixDescriptor);
83 } 83 }
84 84
85 /** 85 /**
...@@ -88,16 +88,16 @@ public class BGPPrefixLSIdentifier { ...@@ -88,16 +88,16 @@ public class BGPPrefixLSIdentifier {
88 * @param cb ChannelBuffer 88 * @param cb ChannelBuffer
89 * @param protocolId protocol identifier 89 * @param protocolId protocol identifier
90 * @return LocalNodeDescriptors 90 * @return LocalNodeDescriptors
91 - * @throws BGPParseException while parsing local node descriptors 91 + * @throws BgpParseException while parsing local node descriptors
92 */ 92 */
93 public static NodeDescriptors parseLocalNodeDescriptors(ChannelBuffer cb, byte protocolId) 93 public static NodeDescriptors parseLocalNodeDescriptors(ChannelBuffer cb, byte protocolId)
94 - throws BGPParseException { 94 + throws BgpParseException {
95 ChannelBuffer tempBuf = cb; 95 ChannelBuffer tempBuf = cb;
96 short type = cb.readShort(); 96 short type = cb.readShort();
97 short length = cb.readShort(); 97 short length = cb.readShort();
98 if (cb.readableBytes() < length) { 98 if (cb.readableBytes() < length) {
99 //length + 4 implies data contains type, length and value 99 //length + 4 implies data contains type, length and value
100 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 100 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
101 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN)); 101 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
102 } 102 }
103 NodeDescriptors localNodeDescriptors = new NodeDescriptors(); 103 NodeDescriptors localNodeDescriptors = new NodeDescriptors();
...@@ -106,8 +106,8 @@ public class BGPPrefixLSIdentifier { ...@@ -106,8 +106,8 @@ public class BGPPrefixLSIdentifier {
106 if (type == NodeDescriptors.LOCAL_NODE_DES_TYPE) { 106 if (type == NodeDescriptors.LOCAL_NODE_DES_TYPE) {
107 localNodeDescriptors = NodeDescriptors.read(tempCb, length, type, protocolId); 107 localNodeDescriptors = NodeDescriptors.read(tempCb, length, type, protocolId);
108 } else { 108 } else {
109 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 109 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
110 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); 110 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null);
111 } 111 }
112 return localNodeDescriptors; 112 return localNodeDescriptors;
113 } 113 }
...@@ -117,11 +117,11 @@ public class BGPPrefixLSIdentifier { ...@@ -117,11 +117,11 @@ public class BGPPrefixLSIdentifier {
117 * 117 *
118 * @param cb ChannelBuffer 118 * @param cb ChannelBuffer
119 * @return list of prefix descriptors 119 * @return list of prefix descriptors
120 - * @throws BGPParseException while parsing list of prefix descriptors 120 + * @throws BgpParseException while parsing list of prefix descriptors
121 */ 121 */
122 - public static LinkedList<BGPValueType> parsePrefixDescriptors(ChannelBuffer cb) throws BGPParseException { 122 + public static LinkedList<BgpValueType> parsePrefixDescriptors(ChannelBuffer cb) throws BgpParseException {
123 - LinkedList<BGPValueType> prefixDescriptor = new LinkedList<>(); 123 + LinkedList<BgpValueType> prefixDescriptor = new LinkedList<>();
124 - BGPValueType tlv = null; 124 + BgpValueType tlv = null;
125 boolean isIpReachInfo = false; 125 boolean isIpReachInfo = false;
126 ChannelBuffer tempCb; 126 ChannelBuffer tempCb;
127 int count = 0; 127 int count = 0;
...@@ -132,7 +132,7 @@ public class BGPPrefixLSIdentifier { ...@@ -132,7 +132,7 @@ public class BGPPrefixLSIdentifier {
132 short length = cb.readShort(); 132 short length = cb.readShort();
133 if (cb.readableBytes() < length) { 133 if (cb.readableBytes() < length) {
134 //length + 4 implies data contains type, length and value 134 //length + 4 implies data contains type, length and value
135 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 135 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
136 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN)); 136 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
137 } 137 }
138 tempCb = cb.readBytes(length); 138 tempCb = cb.readBytes(length);
...@@ -149,8 +149,8 @@ public class BGPPrefixLSIdentifier { ...@@ -149,8 +149,8 @@ public class BGPPrefixLSIdentifier {
149 count = count + 1; 149 count = count + 1;
150 if (count > 1) { 150 if (count > 1) {
151 //length + 4 implies data contains type, length and value 151 //length + 4 implies data contains type, length and value
152 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 152 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
153 - BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, tempBuf.readBytes(length + TYPE_AND_LEN)); 153 + BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR, tempBuf.readBytes(length + TYPE_AND_LEN));
154 } 154 }
155 break; 155 break;
156 default: 156 default:
...@@ -160,7 +160,7 @@ public class BGPPrefixLSIdentifier { ...@@ -160,7 +160,7 @@ public class BGPPrefixLSIdentifier {
160 } 160 }
161 161
162 if (!isIpReachInfo) { 162 if (!isIpReachInfo) {
163 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 163 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
164 null); 164 null);
165 } 165 }
166 return prefixDescriptor; 166 return prefixDescriptor;
...@@ -180,7 +180,7 @@ public class BGPPrefixLSIdentifier { ...@@ -180,7 +180,7 @@ public class BGPPrefixLSIdentifier {
180 * 180 *
181 * @return Prefix descriptors 181 * @return Prefix descriptors
182 */ 182 */
183 - public LinkedList<BGPValueType> getPrefixdescriptor() { 183 + public LinkedList<BgpValueType> getPrefixdescriptor() {
184 return this.prefixDescriptor; 184 return this.prefixDescriptor;
185 } 185 }
186 186
...@@ -195,20 +195,20 @@ public class BGPPrefixLSIdentifier { ...@@ -195,20 +195,20 @@ public class BGPPrefixLSIdentifier {
195 return true; 195 return true;
196 } 196 }
197 197
198 - if (obj instanceof BGPPrefixLSIdentifier) { 198 + if (obj instanceof BgpPrefixLSIdentifier) {
199 int countObjSubTlv = 0; 199 int countObjSubTlv = 0;
200 int countOtherSubTlv = 0; 200 int countOtherSubTlv = 0;
201 boolean isCommonSubTlv = true; 201 boolean isCommonSubTlv = true;
202 - BGPPrefixLSIdentifier other = (BGPPrefixLSIdentifier) obj; 202 + BgpPrefixLSIdentifier other = (BgpPrefixLSIdentifier) obj;
203 203
204 - Iterator<BGPValueType> objListIterator = other.prefixDescriptor.iterator(); 204 + Iterator<BgpValueType> objListIterator = other.prefixDescriptor.iterator();
205 countOtherSubTlv = other.prefixDescriptor.size(); 205 countOtherSubTlv = other.prefixDescriptor.size();
206 countObjSubTlv = prefixDescriptor.size(); 206 countObjSubTlv = prefixDescriptor.size();
207 if (countObjSubTlv != countOtherSubTlv) { 207 if (countObjSubTlv != countOtherSubTlv) {
208 return false; 208 return false;
209 } else { 209 } else {
210 while (objListIterator.hasNext() && isCommonSubTlv) { 210 while (objListIterator.hasNext() && isCommonSubTlv) {
211 - BGPValueType subTlv = objListIterator.next(); 211 + BgpValueType subTlv = objListIterator.next();
212 isCommonSubTlv = Objects.equals(prefixDescriptor.contains(subTlv), 212 isCommonSubTlv = Objects.equals(prefixDescriptor.contains(subTlv),
213 other.prefixDescriptor.contains(subTlv)); 213 other.prefixDescriptor.contains(subTlv));
214 } 214 }
......
...@@ -21,12 +21,12 @@ import java.util.LinkedList; ...@@ -21,12 +21,12 @@ import java.util.LinkedList;
21 import java.util.Objects; 21 import java.util.Objects;
22 22
23 import org.jboss.netty.buffer.ChannelBuffer; 23 import org.jboss.netty.buffer.ChannelBuffer;
24 -import org.onosproject.bgpio.exceptions.BGPParseException; 24 +import org.onosproject.bgpio.exceptions.BgpParseException;
25 import org.onosproject.bgpio.types.AreaIDTlv; 25 import org.onosproject.bgpio.types.AreaIDTlv;
26 import org.onosproject.bgpio.types.AutonomousSystemTlv; 26 import org.onosproject.bgpio.types.AutonomousSystemTlv;
27 -import org.onosproject.bgpio.types.BGPErrorType; 27 +import org.onosproject.bgpio.types.BgpErrorType;
28 -import org.onosproject.bgpio.types.BGPLSIdentifierTlv; 28 +import org.onosproject.bgpio.types.BgpLSIdentifierTlv;
29 -import org.onosproject.bgpio.types.BGPValueType; 29 +import org.onosproject.bgpio.types.BgpValueType;
30 import org.onosproject.bgpio.types.IsIsNonPseudonode; 30 import org.onosproject.bgpio.types.IsIsNonPseudonode;
31 import org.onosproject.bgpio.types.IsIsPseudonode; 31 import org.onosproject.bgpio.types.IsIsPseudonode;
32 import org.onosproject.bgpio.types.OSPFNonPseudonode; 32 import org.onosproject.bgpio.types.OSPFNonPseudonode;
...@@ -71,7 +71,7 @@ public class NodeDescriptors { ...@@ -71,7 +71,7 @@ public class NodeDescriptors {
71 public static final int ISISPSEUDONODE_LEN = 7; 71 public static final int ISISPSEUDONODE_LEN = 7;
72 public static final int OSPFNONPSEUDONODE_LEN = 4; 72 public static final int OSPFNONPSEUDONODE_LEN = 4;
73 public static final int OSPFPSEUDONODE_LEN = 8; 73 public static final int OSPFPSEUDONODE_LEN = 8;
74 - private LinkedList<BGPValueType> subTlvs; 74 + private LinkedList<BgpValueType> subTlvs;
75 private short deslength; 75 private short deslength;
76 private short desType; 76 private short desType;
77 77
...@@ -91,7 +91,7 @@ public class NodeDescriptors { ...@@ -91,7 +91,7 @@ public class NodeDescriptors {
91 * @param deslength Descriptors length 91 * @param deslength Descriptors length
92 * @param desType local node descriptor or remote node descriptor type 92 * @param desType local node descriptor or remote node descriptor type
93 */ 93 */
94 - public NodeDescriptors(LinkedList<BGPValueType> subTlvs, short deslength, short desType) { 94 + public NodeDescriptors(LinkedList<BgpValueType> subTlvs, short deslength, short desType) {
95 this.subTlvs = subTlvs; 95 this.subTlvs = subTlvs;
96 this.deslength = deslength; 96 this.deslength = deslength;
97 this.desType = desType; 97 this.desType = desType;
...@@ -102,7 +102,7 @@ public class NodeDescriptors { ...@@ -102,7 +102,7 @@ public class NodeDescriptors {
102 * 102 *
103 * @return subTlvs list of subTlvs 103 * @return subTlvs list of subTlvs
104 */ 104 */
105 - public LinkedList<BGPValueType> getSubTlvs() { 105 + public LinkedList<BgpValueType> getSubTlvs() {
106 return subTlvs; 106 return subTlvs;
107 } 107 }
108 108
...@@ -122,14 +122,14 @@ public class NodeDescriptors { ...@@ -122,14 +122,14 @@ public class NodeDescriptors {
122 int countOtherSubTlv = 0; 122 int countOtherSubTlv = 0;
123 boolean isCommonSubTlv = true; 123 boolean isCommonSubTlv = true;
124 NodeDescriptors other = (NodeDescriptors) obj; 124 NodeDescriptors other = (NodeDescriptors) obj;
125 - Iterator<BGPValueType> objListIterator = other.subTlvs.iterator(); 125 + Iterator<BgpValueType> objListIterator = other.subTlvs.iterator();
126 countOtherSubTlv = other.subTlvs.size(); 126 countOtherSubTlv = other.subTlvs.size();
127 countObjSubTlv = subTlvs.size(); 127 countObjSubTlv = subTlvs.size();
128 if (countObjSubTlv != countOtherSubTlv) { 128 if (countObjSubTlv != countOtherSubTlv) {
129 return false; 129 return false;
130 } else { 130 } else {
131 while (objListIterator.hasNext() && isCommonSubTlv) { 131 while (objListIterator.hasNext() && isCommonSubTlv) {
132 - BGPValueType subTlv = objListIterator.next(); 132 + BgpValueType subTlv = objListIterator.next();
133 isCommonSubTlv = Objects.equals(subTlvs.contains(subTlv), other.subTlvs.contains(subTlv)); 133 isCommonSubTlv = Objects.equals(subTlvs.contains(subTlv), other.subTlvs.contains(subTlv));
134 } 134 }
135 return isCommonSubTlv; 135 return isCommonSubTlv;
...@@ -146,20 +146,20 @@ public class NodeDescriptors { ...@@ -146,20 +146,20 @@ public class NodeDescriptors {
146 * @param desType local node descriptor or remote node descriptor type 146 * @param desType local node descriptor or remote node descriptor type
147 * @param protocolId protocol ID 147 * @param protocolId protocol ID
148 * @return object of NodeDescriptors 148 * @return object of NodeDescriptors
149 - * @throws BGPParseException while parsing node descriptors 149 + * @throws BgpParseException while parsing node descriptors
150 */ 150 */
151 public static NodeDescriptors read(ChannelBuffer cb, short desLength, short desType, byte protocolId) 151 public static NodeDescriptors read(ChannelBuffer cb, short desLength, short desType, byte protocolId)
152 - throws BGPParseException { 152 + throws BgpParseException {
153 - LinkedList<BGPValueType> subTlvs; 153 + LinkedList<BgpValueType> subTlvs;
154 subTlvs = new LinkedList<>(); 154 subTlvs = new LinkedList<>();
155 - BGPValueType tlv = null; 155 + BgpValueType tlv = null;
156 156
157 while (cb.readableBytes() > 0) { 157 while (cb.readableBytes() > 0) {
158 ChannelBuffer tempBuf = cb; 158 ChannelBuffer tempBuf = cb;
159 short type = cb.readShort(); 159 short type = cb.readShort();
160 short length = cb.readShort(); 160 short length = cb.readShort();
161 if (cb.readableBytes() < length) { 161 if (cb.readableBytes() < length) {
162 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.OPTIONAL_ATTRIBUTE_ERROR, 162 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
163 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN)); 163 tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
164 } 164 }
165 ChannelBuffer tempCb = cb.readBytes(length); 165 ChannelBuffer tempCb = cb.readBytes(length);
...@@ -167,8 +167,8 @@ public class NodeDescriptors { ...@@ -167,8 +167,8 @@ public class NodeDescriptors {
167 case AutonomousSystemTlv.TYPE: 167 case AutonomousSystemTlv.TYPE:
168 tlv = AutonomousSystemTlv.read(tempCb); 168 tlv = AutonomousSystemTlv.read(tempCb);
169 break; 169 break;
170 - case BGPLSIdentifierTlv.TYPE: 170 + case BgpLSIdentifierTlv.TYPE:
171 - tlv = BGPLSIdentifierTlv.read(tempCb); 171 + tlv = BgpLSIdentifierTlv.read(tempCb);
172 break; 172 break;
173 case AreaIDTlv.TYPE: 173 case AreaIDTlv.TYPE:
174 tlv = AreaIDTlv.read(tempCb); 174 tlv = AreaIDTlv.read(tempCb);
......
...@@ -19,8 +19,8 @@ import java.util.Iterator; ...@@ -19,8 +19,8 @@ import java.util.Iterator;
19 import java.util.List; 19 import java.util.List;
20 import java.util.Objects; 20 import java.util.Objects;
21 21
22 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; 22 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4.ProtocolType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 24
25 import com.google.common.base.MoreObjects; 25 import com.google.common.base.MoreObjects;
26 26
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects;
28 * This Class stores path Attributes, protocol ID and Identifier of LinkState NLRI. 28 * This Class stores path Attributes, protocol ID and Identifier of LinkState NLRI.
29 */ 29 */
30 public class PathAttrNlriDetails { 30 public class PathAttrNlriDetails {
31 - private List<BGPValueType> pathAttributes; 31 + private List<BgpValueType> pathAttributes;
32 private ProtocolType protocolID; 32 private ProtocolType protocolID;
33 private long identifier; 33 private long identifier;
34 34
...@@ -37,7 +37,7 @@ public class PathAttrNlriDetails { ...@@ -37,7 +37,7 @@ public class PathAttrNlriDetails {
37 * 37 *
38 * @param pathAttributes in update message 38 * @param pathAttributes in update message
39 */ 39 */
40 - public void setPathAttribute(List<BGPValueType> pathAttributes) { 40 + public void setPathAttribute(List<BgpValueType> pathAttributes) {
41 this.pathAttributes = pathAttributes; 41 this.pathAttributes = pathAttributes;
42 } 42 }
43 43
...@@ -46,7 +46,7 @@ public class PathAttrNlriDetails { ...@@ -46,7 +46,7 @@ public class PathAttrNlriDetails {
46 * 46 *
47 * @return path attributes 47 * @return path attributes
48 */ 48 */
49 - public List<BGPValueType> pathAttributes() { 49 + public List<BgpValueType> pathAttributes() {
50 return this.pathAttributes; 50 return this.pathAttributes;
51 } 51 }
52 52
...@@ -102,14 +102,14 @@ public class PathAttrNlriDetails { ...@@ -102,14 +102,14 @@ public class PathAttrNlriDetails {
102 int countOtherSubTlv = 0; 102 int countOtherSubTlv = 0;
103 boolean isCommonSubTlv = true; 103 boolean isCommonSubTlv = true;
104 PathAttrNlriDetails other = (PathAttrNlriDetails) obj; 104 PathAttrNlriDetails other = (PathAttrNlriDetails) obj;
105 - Iterator<BGPValueType> objListIterator = other.pathAttributes.iterator(); 105 + Iterator<BgpValueType> objListIterator = other.pathAttributes.iterator();
106 countOtherSubTlv = other.pathAttributes.size(); 106 countOtherSubTlv = other.pathAttributes.size();
107 countObjSubTlv = pathAttributes.size(); 107 countObjSubTlv = pathAttributes.size();
108 if (countObjSubTlv != countOtherSubTlv) { 108 if (countObjSubTlv != countOtherSubTlv) {
109 return false; 109 return false;
110 } else { 110 } else {
111 while (objListIterator.hasNext() && isCommonSubTlv) { 111 while (objListIterator.hasNext() && isCommonSubTlv) {
112 - BGPValueType subTlv = objListIterator.next(); 112 + BgpValueType subTlv = objListIterator.next();
113 if (pathAttributes.contains(subTlv) && other.pathAttributes.contains(subTlv)) { 113 if (pathAttributes.contains(subTlv) && other.pathAttributes.contains(subTlv)) {
114 isCommonSubTlv = Objects.equals(pathAttributes.get(pathAttributes.indexOf(subTlv)), 114 isCommonSubTlv = Objects.equals(pathAttributes.get(pathAttributes.indexOf(subTlv)),
115 other.pathAttributes.get(other.pathAttributes.indexOf(subTlv))); 115 other.pathAttributes.get(other.pathAttributes.indexOf(subTlv)));
......
...@@ -16,43 +16,43 @@ ...@@ -16,43 +16,43 @@
16 16
17 package org.onosproject.bgpio.protocol.ver4; 17 package org.onosproject.bgpio.protocol.ver4;
18 18
19 -import org.onosproject.bgpio.protocol.BGPFactory; 19 +import org.onosproject.bgpio.protocol.BgpFactory;
20 -import org.onosproject.bgpio.protocol.BGPKeepaliveMsg; 20 +import org.onosproject.bgpio.protocol.BgpKeepaliveMsg;
21 -import org.onosproject.bgpio.protocol.BGPMessage; 21 +import org.onosproject.bgpio.protocol.BgpMessage;
22 -import org.onosproject.bgpio.protocol.BGPMessageReader; 22 +import org.onosproject.bgpio.protocol.BgpMessageReader;
23 -import org.onosproject.bgpio.protocol.BGPNotificationMsg; 23 +import org.onosproject.bgpio.protocol.BgpNotificationMsg;
24 -import org.onosproject.bgpio.protocol.BGPOpenMsg; 24 +import org.onosproject.bgpio.protocol.BgpOpenMsg;
25 -import org.onosproject.bgpio.protocol.BGPVersion; 25 +import org.onosproject.bgpio.protocol.BgpVersion;
26 26
27 /** 27 /**
28 * Provides BGP Factory and returns builder classes for all objects and messages. 28 * Provides BGP Factory and returns builder classes for all objects and messages.
29 */ 29 */
30 -public class BGPFactoryVer4 implements BGPFactory { 30 +public class BgpFactoryVer4 implements BgpFactory {
31 31
32 - public static final BGPFactoryVer4 INSTANCE = new BGPFactoryVer4(); 32 + public static final BgpFactoryVer4 INSTANCE = new BgpFactoryVer4();
33 33
34 @Override 34 @Override
35 - public BGPOpenMsg.Builder openMessageBuilder() { 35 + public BgpOpenMsg.Builder openMessageBuilder() {
36 - return new BGPOpenMsgVer4.Builder(); 36 + return new BgpOpenMsgVer4.Builder();
37 } 37 }
38 38
39 @Override 39 @Override
40 - public BGPKeepaliveMsg.Builder keepaliveMessageBuilder() { 40 + public BgpKeepaliveMsg.Builder keepaliveMessageBuilder() {
41 - return new BGPKeepaliveMsgVer4.Builder(); 41 + return new BgpKeepaliveMsgVer4.Builder();
42 } 42 }
43 43
44 @Override 44 @Override
45 - public BGPNotificationMsg.Builder notificationMessageBuilder() { 45 + public BgpNotificationMsg.Builder notificationMessageBuilder() {
46 - return new BGPNotificationMsgVer4.Builder(); 46 + return new BgpNotificationMsgVer4.Builder();
47 } 47 }
48 48
49 @Override 49 @Override
50 - public BGPMessageReader<BGPMessage> getReader() { 50 + public BgpMessageReader<BgpMessage> getReader() {
51 - return BGPMessageVer4.READER; 51 + return BgpMessageVer4.READER;
52 } 52 }
53 53
54 @Override 54 @Override
55 - public BGPVersion getVersion() { 55 + public BgpVersion getVersion() {
56 - return BGPVersion.BGP_4; 56 + return BgpVersion.BGP_4;
57 } 57 }
58 } 58 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
16 package org.onosproject.bgpio.protocol.ver4; 16 package org.onosproject.bgpio.protocol.ver4;
17 17
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 -import org.onosproject.bgpio.exceptions.BGPParseException; 19 +import org.onosproject.bgpio.exceptions.BgpParseException;
20 -import org.onosproject.bgpio.protocol.BGPKeepaliveMsg; 20 +import org.onosproject.bgpio.protocol.BgpKeepaliveMsg;
21 -import org.onosproject.bgpio.protocol.BGPMessageReader; 21 +import org.onosproject.bgpio.protocol.BgpMessageReader;
22 -import org.onosproject.bgpio.protocol.BGPMessageWriter; 22 +import org.onosproject.bgpio.protocol.BgpMessageWriter;
23 -import org.onosproject.bgpio.types.BGPHeader; 23 +import org.onosproject.bgpio.types.BgpHeader;
24 -import org.onosproject.bgpio.protocol.BGPType; 24 +import org.onosproject.bgpio.protocol.BgpType;
25 -import org.onosproject.bgpio.protocol.BGPVersion; 25 +import org.onosproject.bgpio.protocol.BgpVersion;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 27 import org.slf4j.LoggerFactory;
28 28
...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects; ...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects;
31 /** 31 /**
32 * Provides BGP keep alive message. 32 * Provides BGP keep alive message.
33 */ 33 */
34 -public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg { 34 +public class BgpKeepaliveMsgVer4 implements BgpKeepaliveMsg {
35 35
36 /* 36 /*
37 <Keepalive Message>::= <Common Header> 37 <Keepalive Message>::= <Common Header>
...@@ -56,56 +56,56 @@ public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg { ...@@ -56,56 +56,56 @@ public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg {
56 */ 56 */
57 57
58 protected static final Logger log = LoggerFactory 58 protected static final Logger log = LoggerFactory
59 - .getLogger(BGPKeepaliveMsgVer4.class); 59 + .getLogger(BgpKeepaliveMsgVer4.class);
60 60
61 - private BGPHeader bgpMsgHeader; 61 + private BgpHeader bgpMsgHeader;
62 public static final byte PACKET_VERSION = 4; 62 public static final byte PACKET_VERSION = 4;
63 public static final int PACKET_MINIMUM_LENGTH = 19; 63 public static final int PACKET_MINIMUM_LENGTH = 19;
64 public static final int MARKER_LENGTH = 16; 64 public static final int MARKER_LENGTH = 16;
65 - public static final BGPType MSG_TYPE = BGPType.KEEP_ALIVE; 65 + public static final BgpType MSG_TYPE = BgpType.KEEP_ALIVE;
66 public static byte[] marker = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 66 public static byte[] marker = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
67 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 67 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
68 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 68 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
69 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}; 69 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff};
70 70
71 - public static final BGPKeepaliveMsgVer4.Reader READER = new Reader(); 71 + public static final BgpKeepaliveMsgVer4.Reader READER = new Reader();
72 72
73 /** 73 /**
74 * Reader class for reading BGP keepalive message from channel buffer. 74 * Reader class for reading BGP keepalive message from channel buffer.
75 */ 75 */
76 - static class Reader implements BGPMessageReader<BGPKeepaliveMsg> { 76 + static class Reader implements BgpMessageReader<BgpKeepaliveMsg> {
77 77
78 @Override 78 @Override
79 - public BGPKeepaliveMsg readFrom(ChannelBuffer cb, BGPHeader bgpHeader) 79 + public BgpKeepaliveMsg readFrom(ChannelBuffer cb, BgpHeader bgpHeader)
80 - throws BGPParseException { 80 + throws BgpParseException {
81 81
82 /* bgpHeader is not required in case of keepalive message and 82 /* bgpHeader is not required in case of keepalive message and
83 Header is already read and no other fields except header in keepalive message.*/ 83 Header is already read and no other fields except header in keepalive message.*/
84 - return new BGPKeepaliveMsgVer4(); 84 + return new BgpKeepaliveMsgVer4();
85 } 85 }
86 } 86 }
87 87
88 /** 88 /**
89 * Default constructor. 89 * Default constructor.
90 */ 90 */
91 - public BGPKeepaliveMsgVer4() { 91 + public BgpKeepaliveMsgVer4() {
92 } 92 }
93 93
94 /** 94 /**
95 * Builder class for BGP keepalive message. 95 * Builder class for BGP keepalive message.
96 */ 96 */
97 - static class Builder implements BGPKeepaliveMsg.Builder { 97 + static class Builder implements BgpKeepaliveMsg.Builder {
98 - BGPHeader bgpMsgHeader; 98 + BgpHeader bgpMsgHeader;
99 99
100 @Override 100 @Override
101 - public Builder setHeader(BGPHeader bgpMsgHeader) { 101 + public Builder setHeader(BgpHeader bgpMsgHeader) {
102 this.bgpMsgHeader = bgpMsgHeader; 102 this.bgpMsgHeader = bgpMsgHeader;
103 return this; 103 return this;
104 } 104 }
105 105
106 @Override 106 @Override
107 - public BGPKeepaliveMsg build() { 107 + public BgpKeepaliveMsg build() {
108 - return new BGPKeepaliveMsgVer4(); 108 + return new BgpKeepaliveMsgVer4();
109 } 109 }
110 } 110 }
111 111
...@@ -119,10 +119,10 @@ public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg { ...@@ -119,10 +119,10 @@ public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg {
119 /** 119 /**
120 * Writer class for writing the BGP keepalive message to channel buffer. 120 * Writer class for writing the BGP keepalive message to channel buffer.
121 */ 121 */
122 - static class Writer implements BGPMessageWriter<BGPKeepaliveMsgVer4> { 122 + static class Writer implements BgpMessageWriter<BgpKeepaliveMsgVer4> {
123 123
124 @Override 124 @Override
125 - public void write(ChannelBuffer cb, BGPKeepaliveMsgVer4 message) { 125 + public void write(ChannelBuffer cb, BgpKeepaliveMsgVer4 message) {
126 126
127 // write marker 127 // write marker
128 cb.writeBytes(marker, 0, MARKER_LENGTH); 128 cb.writeBytes(marker, 0, MARKER_LENGTH);
...@@ -136,17 +136,17 @@ public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg { ...@@ -136,17 +136,17 @@ public class BGPKeepaliveMsgVer4 implements BGPKeepaliveMsg {
136 } 136 }
137 137
138 @Override 138 @Override
139 - public BGPVersion getVersion() { 139 + public BgpVersion getVersion() {
140 - return BGPVersion.BGP_4; 140 + return BgpVersion.BGP_4;
141 } 141 }
142 142
143 @Override 143 @Override
144 - public BGPType getType() { 144 + public BgpType getType() {
145 return MSG_TYPE; 145 return MSG_TYPE;
146 } 146 }
147 147
148 @Override 148 @Override
149 - public BGPHeader getHeader() { 149 + public BgpHeader getHeader() {
150 return this.bgpMsgHeader; 150 return this.bgpMsgHeader;
151 } 151 }
152 152
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
17 package org.onosproject.bgpio.protocol.ver4; 17 package org.onosproject.bgpio.protocol.ver4;
18 18
19 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.onosproject.bgpio.exceptions.BGPParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 -import org.onosproject.bgpio.protocol.BGPFactories; 21 +import org.onosproject.bgpio.protocol.BgpFactories;
22 -import org.onosproject.bgpio.protocol.BGPMessage; 22 +import org.onosproject.bgpio.protocol.BgpMessage;
23 -import org.onosproject.bgpio.protocol.BGPMessageReader; 23 +import org.onosproject.bgpio.protocol.BgpMessageReader;
24 -import org.onosproject.bgpio.types.BGPErrorType; 24 +import org.onosproject.bgpio.types.BgpErrorType;
25 -import org.onosproject.bgpio.types.BGPHeader; 25 +import org.onosproject.bgpio.types.BgpHeader;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
...@@ -30,9 +30,9 @@ import org.slf4j.LoggerFactory; ...@@ -30,9 +30,9 @@ import org.slf4j.LoggerFactory;
30 /** 30 /**
31 * Provides BGP messages. 31 * Provides BGP messages.
32 */ 32 */
33 -public abstract class BGPMessageVer4 { 33 +public abstract class BgpMessageVer4 {
34 34
35 - protected static final Logger log = LoggerFactory.getLogger(BGPFactories.class); 35 + protected static final Logger log = LoggerFactory.getLogger(BgpFactories.class);
36 36
37 static final byte OPEN_MSG_TYPE = 0x1; 37 static final byte OPEN_MSG_TYPE = 0x1;
38 static final byte KEEPALIVE_MSG_TYPE = 0x4; 38 static final byte KEEPALIVE_MSG_TYPE = 0x4;
...@@ -42,42 +42,42 @@ public abstract class BGPMessageVer4 { ...@@ -42,42 +42,42 @@ public abstract class BGPMessageVer4 {
42 static final int HEADER_AND_MSG_LEN = 18; 42 static final int HEADER_AND_MSG_LEN = 18;
43 static final int MAXIMUM_PACKET_LENGTH = 4096; 43 static final int MAXIMUM_PACKET_LENGTH = 4096;
44 44
45 - public static final BGPMessageVer4.Reader READER = new Reader(); 45 + public static final BgpMessageVer4.Reader READER = new Reader();
46 46
47 /** 47 /**
48 * Reader class for reading BGP messages from channel buffer. 48 * Reader class for reading BGP messages from channel buffer.
49 * 49 *
50 */ 50 */
51 - static class Reader implements BGPMessageReader<BGPMessage> { 51 + static class Reader implements BgpMessageReader<BgpMessage> {
52 @Override 52 @Override
53 - public BGPMessage readFrom(ChannelBuffer cb, BGPHeader bgpHeader) 53 + public BgpMessage readFrom(ChannelBuffer cb, BgpHeader bgpHeader)
54 - throws BGPParseException { 54 + throws BgpParseException {
55 55
56 if (cb.readableBytes() < MINIMUM_COMMON_HEADER_LENGTH) { 56 if (cb.readableBytes() < MINIMUM_COMMON_HEADER_LENGTH) {
57 log.error("Packet should have minimum length."); 57 log.error("Packet should have minimum length.");
58 - Validation.validateLen(BGPErrorType.MESSAGE_HEADER_ERROR, BGPErrorType.BAD_MESSAGE_LENGTH, 58 + Validation.validateLen(BgpErrorType.MESSAGE_HEADER_ERROR, BgpErrorType.BAD_MESSAGE_LENGTH,
59 cb.readableBytes()); 59 cb.readableBytes());
60 } 60 }
61 if (cb.readableBytes() > MAXIMUM_PACKET_LENGTH) { 61 if (cb.readableBytes() > MAXIMUM_PACKET_LENGTH) {
62 log.error("Packet length should not exceed {}.", MAXIMUM_PACKET_LENGTH); 62 log.error("Packet length should not exceed {}.", MAXIMUM_PACKET_LENGTH);
63 - Validation.validateLen(BGPErrorType.MESSAGE_HEADER_ERROR, BGPErrorType.BAD_MESSAGE_LENGTH, 63 + Validation.validateLen(BgpErrorType.MESSAGE_HEADER_ERROR, BgpErrorType.BAD_MESSAGE_LENGTH,
64 cb.readableBytes()); 64 cb.readableBytes());
65 } 65 }
66 try { 66 try {
67 // fixed value property version == 4 67 // fixed value property version == 4
68 - byte[] marker = new byte[BGPHeader.MARKER_LENGTH]; 68 + byte[] marker = new byte[BgpHeader.MARKER_LENGTH];
69 - cb.readBytes(marker, 0, BGPHeader.MARKER_LENGTH); 69 + cb.readBytes(marker, 0, BgpHeader.MARKER_LENGTH);
70 bgpHeader.setMarker(marker); 70 bgpHeader.setMarker(marker);
71 - for (int i = 0; i < BGPHeader.MARKER_LENGTH; i++) { 71 + for (int i = 0; i < BgpHeader.MARKER_LENGTH; i++) {
72 if (marker[i] != (byte) 0xff) { 72 if (marker[i] != (byte) 0xff) {
73 - throw new BGPParseException(BGPErrorType.MESSAGE_HEADER_ERROR, 73 + throw new BgpParseException(BgpErrorType.MESSAGE_HEADER_ERROR,
74 - BGPErrorType.CONNECTION_NOT_SYNCHRONIZED, null); 74 + BgpErrorType.CONNECTION_NOT_SYNCHRONIZED, null);
75 } 75 }
76 } 76 }
77 short length = cb.readShort(); 77 short length = cb.readShort();
78 if (length > cb.readableBytes() + HEADER_AND_MSG_LEN) { 78 if (length > cb.readableBytes() + HEADER_AND_MSG_LEN) {
79 - Validation.validateLen(BGPErrorType.MESSAGE_HEADER_ERROR, 79 + Validation.validateLen(BgpErrorType.MESSAGE_HEADER_ERROR,
80 - BGPErrorType.BAD_MESSAGE_LENGTH, length); 80 + BgpErrorType.BAD_MESSAGE_LENGTH, length);
81 } 81 }
82 bgpHeader.setLength(length); 82 bgpHeader.setLength(length);
83 byte type = cb.readByte(); 83 byte type = cb.readByte();
...@@ -88,23 +88,23 @@ public abstract class BGPMessageVer4 { ...@@ -88,23 +88,23 @@ public abstract class BGPMessageVer4 {
88 switch (type) { 88 switch (type) {
89 case OPEN_MSG_TYPE: 89 case OPEN_MSG_TYPE:
90 log.debug("OPEN MESSAGE is received"); 90 log.debug("OPEN MESSAGE is received");
91 - return BGPOpenMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader); 91 + return BgpOpenMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader);
92 case KEEPALIVE_MSG_TYPE: 92 case KEEPALIVE_MSG_TYPE:
93 log.debug("KEEPALIVE MESSAGE is received"); 93 log.debug("KEEPALIVE MESSAGE is received");
94 - return BGPKeepaliveMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader); 94 + return BgpKeepaliveMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader);
95 case UPDATE_MSG_TYPE: 95 case UPDATE_MSG_TYPE:
96 log.debug("UPDATE MESSAGE is received"); 96 log.debug("UPDATE MESSAGE is received");
97 return BgpUpdateMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader); 97 return BgpUpdateMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader);
98 case NOTIFICATION_MSG_TYPE: 98 case NOTIFICATION_MSG_TYPE:
99 log.debug("NOTIFICATION MESSAGE is received"); 99 log.debug("NOTIFICATION MESSAGE is received");
100 - return BGPNotificationMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader); 100 + return BgpNotificationMsgVer4.READER.readFrom(cb.readBytes(len), bgpHeader);
101 default: 101 default:
102 - Validation.validateType(BGPErrorType.MESSAGE_HEADER_ERROR, BGPErrorType.BAD_MESSAGE_TYPE, type); 102 + Validation.validateType(BgpErrorType.MESSAGE_HEADER_ERROR, BgpErrorType.BAD_MESSAGE_TYPE, type);
103 return null; 103 return null;
104 } 104 }
105 } catch (IndexOutOfBoundsException e) { 105 } catch (IndexOutOfBoundsException e) {
106 - throw new BGPParseException(BGPErrorType.MESSAGE_HEADER_ERROR, 106 + throw new BgpParseException(BgpErrorType.MESSAGE_HEADER_ERROR,
107 - BGPErrorType.BAD_MESSAGE_LENGTH, null); 107 + BgpErrorType.BAD_MESSAGE_LENGTH, null);
108 } 108 }
109 } 109 }
110 } 110 }
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
16 package org.onosproject.bgpio.protocol.ver4; 16 package org.onosproject.bgpio.protocol.ver4;
17 17
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 -import org.onosproject.bgpio.exceptions.BGPParseException; 19 +import org.onosproject.bgpio.exceptions.BgpParseException;
20 -import org.onosproject.bgpio.protocol.BGPMessageReader; 20 +import org.onosproject.bgpio.protocol.BgpMessageReader;
21 -import org.onosproject.bgpio.protocol.BGPMessageWriter; 21 +import org.onosproject.bgpio.protocol.BgpMessageWriter;
22 -import org.onosproject.bgpio.protocol.BGPNotificationMsg; 22 +import org.onosproject.bgpio.protocol.BgpNotificationMsg;
23 -import org.onosproject.bgpio.protocol.BGPType; 23 +import org.onosproject.bgpio.protocol.BgpType;
24 -import org.onosproject.bgpio.protocol.BGPVersion; 24 +import org.onosproject.bgpio.protocol.BgpVersion;
25 -import org.onosproject.bgpio.types.BGPErrorType; 25 +import org.onosproject.bgpio.types.BgpErrorType;
26 -import org.onosproject.bgpio.types.BGPHeader; 26 +import org.onosproject.bgpio.types.BgpHeader;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
29 29
...@@ -33,7 +33,7 @@ import com.google.common.base.MoreObjects; ...@@ -33,7 +33,7 @@ import com.google.common.base.MoreObjects;
33 * A NOTIFICATION message is sent when an error condition is detected. The BGP connection is closed immediately after it 33 * A NOTIFICATION message is sent when an error condition is detected. The BGP connection is closed immediately after it
34 * is sent. 34 * is sent.
35 */ 35 */
36 -class BGPNotificationMsgVer4 implements BGPNotificationMsg { 36 +class BgpNotificationMsgVer4 implements BgpNotificationMsg {
37 37
38 /* 38 /*
39 0 1 2 3 39 0 1 2 3
...@@ -44,32 +44,32 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -44,32 +44,32 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
44 REFERENCE : RFC 4271 44 REFERENCE : RFC 4271
45 */ 45 */
46 46
47 - private static final Logger log = LoggerFactory.getLogger(BGPNotificationMsgVer4.class); 47 + private static final Logger log = LoggerFactory.getLogger(BgpNotificationMsgVer4.class);
48 48
49 static final byte PACKET_VERSION = 4; 49 static final byte PACKET_VERSION = 4;
50 //BGPHeader(19) + Error code(1) + Error subcode(1) 50 //BGPHeader(19) + Error code(1) + Error subcode(1)
51 static final int TOTAL_MESSAGE_MIN_LENGTH = 21; 51 static final int TOTAL_MESSAGE_MIN_LENGTH = 21;
52 static final int PACKET_MINIMUM_LENGTH = 2; 52 static final int PACKET_MINIMUM_LENGTH = 2;
53 - static final BGPType MSG_TYPE = BGPType.NOTIFICATION; 53 + static final BgpType MSG_TYPE = BgpType.NOTIFICATION;
54 static final byte DEFAULT_ERRORSUBCODE = 0; 54 static final byte DEFAULT_ERRORSUBCODE = 0;
55 static final byte[] MARKER = {(byte) 0xff, (byte) 0xff, (byte) 0xff, 55 static final byte[] MARKER = {(byte) 0xff, (byte) 0xff, (byte) 0xff,
56 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 56 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
57 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 57 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
58 (byte) 0xff, (byte) 0xff, (byte) 0xff }; 58 (byte) 0xff, (byte) 0xff, (byte) 0xff };
59 static final byte MESSAGE_TYPE = 3; 59 static final byte MESSAGE_TYPE = 3;
60 - static final BGPHeader DEFAULT_MESSAGE_HEADER = new BGPHeader(MARKER, BGPHeader.DEFAULT_HEADER_LENGTH, 60 + static final BgpHeader DEFAULT_MESSAGE_HEADER = new BgpHeader(MARKER, BgpHeader.DEFAULT_HEADER_LENGTH,
61 MESSAGE_TYPE); 61 MESSAGE_TYPE);
62 62
63 private byte errorCode; 63 private byte errorCode;
64 private byte errorSubCode; 64 private byte errorSubCode;
65 private byte[] data; 65 private byte[] data;
66 - private BGPHeader bgpHeader; 66 + private BgpHeader bgpHeader;
67 - public static final BGPNotificationMsgVer4.Reader READER = new Reader(); 67 + public static final BgpNotificationMsgVer4.Reader READER = new Reader();
68 68
69 /** 69 /**
70 * Initialize fields. 70 * Initialize fields.
71 */ 71 */
72 - public BGPNotificationMsgVer4() { 72 + public BgpNotificationMsgVer4() {
73 this.bgpHeader = null; 73 this.bgpHeader = null;
74 this.data = null; 74 this.data = null;
75 this.errorCode = 0; 75 this.errorCode = 0;
...@@ -84,7 +84,7 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -84,7 +84,7 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
84 * @param errorSubCode error subcode 84 * @param errorSubCode error subcode
85 * @param data field 85 * @param data field
86 */ 86 */
87 - public BGPNotificationMsgVer4(BGPHeader bgpHeader, byte errorCode, byte errorSubCode, byte[] data) { 87 + public BgpNotificationMsgVer4(BgpHeader bgpHeader, byte errorCode, byte errorSubCode, byte[] data) {
88 this.bgpHeader = bgpHeader; 88 this.bgpHeader = bgpHeader;
89 this.data = data; 89 this.data = data;
90 this.errorCode = errorCode; 90 this.errorCode = errorCode;
...@@ -94,13 +94,13 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -94,13 +94,13 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
94 /** 94 /**
95 * Reader reads BGP Notification Message from the channel buffer. 95 * Reader reads BGP Notification Message from the channel buffer.
96 */ 96 */
97 - static class Reader implements BGPMessageReader<BGPNotificationMsg> { 97 + static class Reader implements BgpMessageReader<BgpNotificationMsg> {
98 @Override 98 @Override
99 - public BGPNotificationMsg readFrom(ChannelBuffer cb, BGPHeader bgpHeader) throws BGPParseException { 99 + public BgpNotificationMsg readFrom(ChannelBuffer cb, BgpHeader bgpHeader) throws BgpParseException {
100 byte errorCode; 100 byte errorCode;
101 byte errorSubCode; 101 byte errorSubCode;
102 if (cb.readableBytes() < PACKET_MINIMUM_LENGTH) { 102 if (cb.readableBytes() < PACKET_MINIMUM_LENGTH) {
103 - throw new BGPParseException("Not enough readable bytes"); 103 + throw new BgpParseException("Not enough readable bytes");
104 } 104 }
105 errorCode = cb.readByte(); 105 errorCode = cb.readByte();
106 errorSubCode = cb.readByte(); 106 errorSubCode = cb.readByte();
...@@ -108,31 +108,31 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -108,31 +108,31 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
108 int dataLength = bgpHeader.getLength() - TOTAL_MESSAGE_MIN_LENGTH; 108 int dataLength = bgpHeader.getLength() - TOTAL_MESSAGE_MIN_LENGTH;
109 byte[] data = new byte[dataLength]; 109 byte[] data = new byte[dataLength];
110 cb.readBytes(data, 0, dataLength); 110 cb.readBytes(data, 0, dataLength);
111 - return new BGPNotificationMsgVer4(bgpHeader, errorCode, errorSubCode, data); 111 + return new BgpNotificationMsgVer4(bgpHeader, errorCode, errorSubCode, data);
112 } 112 }
113 } 113 }
114 114
115 /** 115 /**
116 * Builder class for BGP notification message. 116 * Builder class for BGP notification message.
117 */ 117 */
118 - static class Builder implements BGPNotificationMsg.Builder { 118 + static class Builder implements BgpNotificationMsg.Builder {
119 private byte errorCode; 119 private byte errorCode;
120 private byte errorSubCode; 120 private byte errorSubCode;
121 private byte[] data; 121 private byte[] data;
122 - private BGPHeader bgpHeader; 122 + private BgpHeader bgpHeader;
123 private boolean isErrorCodeSet = false; 123 private boolean isErrorCodeSet = false;
124 private boolean isErrorSubCodeSet = false; 124 private boolean isErrorSubCodeSet = false;
125 private boolean isBGPHeaderSet = false; 125 private boolean isBGPHeaderSet = false;
126 126
127 @Override 127 @Override
128 - public BGPNotificationMsg build() throws BGPParseException { 128 + public BgpNotificationMsg build() throws BgpParseException {
129 - BGPHeader bgpHeader = this.isBGPHeaderSet ? this.bgpHeader : DEFAULT_MESSAGE_HEADER; 129 + BgpHeader bgpHeader = this.isBGPHeaderSet ? this.bgpHeader : DEFAULT_MESSAGE_HEADER;
130 if (!this.isErrorCodeSet) { 130 if (!this.isErrorCodeSet) {
131 - throw new BGPParseException("Error code must be present"); 131 + throw new BgpParseException("Error code must be present");
132 } 132 }
133 133
134 byte errorSubCode = this.isErrorSubCodeSet ? this.errorSubCode : DEFAULT_ERRORSUBCODE; 134 byte errorSubCode = this.isErrorSubCodeSet ? this.errorSubCode : DEFAULT_ERRORSUBCODE;
135 - return new BGPNotificationMsgVer4(bgpHeader, this.errorCode, errorSubCode, this.data); 135 + return new BgpNotificationMsgVer4(bgpHeader, this.errorCode, errorSubCode, this.data);
136 } 136 }
137 137
138 @Override 138 @Override
...@@ -158,24 +158,24 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -158,24 +158,24 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
158 } 158 }
159 159
160 @Override 160 @Override
161 - public Builder setHeader(BGPHeader bgpMsgHeader) { 161 + public Builder setHeader(BgpHeader bgpMsgHeader) {
162 this.bgpHeader = bgpMsgHeader; 162 this.bgpHeader = bgpMsgHeader;
163 return this; 163 return this;
164 } 164 }
165 } 165 }
166 166
167 @Override 167 @Override
168 - public BGPVersion getVersion() { 168 + public BgpVersion getVersion() {
169 - return BGPVersion.BGP_4; 169 + return BgpVersion.BGP_4;
170 } 170 }
171 171
172 @Override 172 @Override
173 - public BGPType getType() { 173 + public BgpType getType() {
174 - return BGPType.NOTIFICATION; 174 + return BgpType.NOTIFICATION;
175 } 175 }
176 176
177 @Override 177 @Override
178 - public void writeTo(ChannelBuffer cb) throws BGPParseException { 178 + public void writeTo(ChannelBuffer cb) throws BgpParseException {
179 WRITER.write(cb, this); 179 WRITER.write(cb, this);
180 } 180 }
181 181
...@@ -184,13 +184,13 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -184,13 +184,13 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
184 /** 184 /**
185 * Writer writes BGP notification message to channel buffer. 185 * Writer writes BGP notification message to channel buffer.
186 */ 186 */
187 - static class Writer implements BGPMessageWriter<BGPNotificationMsgVer4> { 187 + static class Writer implements BgpMessageWriter<BgpNotificationMsgVer4> {
188 @Override 188 @Override
189 - public void write(ChannelBuffer cb, BGPNotificationMsgVer4 message) throws BGPParseException { 189 + public void write(ChannelBuffer cb, BgpNotificationMsgVer4 message) throws BgpParseException {
190 int msgStartIndex = cb.writerIndex(); 190 int msgStartIndex = cb.writerIndex();
191 int headerLenIndex = message.bgpHeader.write(cb); 191 int headerLenIndex = message.bgpHeader.write(cb);
192 if (headerLenIndex <= 0) { 192 if (headerLenIndex <= 0) {
193 - throw new BGPParseException(BGPErrorType.MESSAGE_HEADER_ERROR, (byte) 0, null); 193 + throw new BgpParseException(BgpErrorType.MESSAGE_HEADER_ERROR, (byte) 0, null);
194 } 194 }
195 cb.writeByte(message.errorCode); 195 cb.writeByte(message.errorCode);
196 cb.writeByte(message.errorSubCode); 196 cb.writeByte(message.errorSubCode);
...@@ -246,7 +246,7 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg { ...@@ -246,7 +246,7 @@ class BGPNotificationMsgVer4 implements BGPNotificationMsg {
246 } 246 }
247 247
248 @Override 248 @Override
249 - public BGPHeader getHeader() { 249 + public BgpHeader getHeader() {
250 return this.bgpHeader; 250 return this.bgpHeader;
251 } 251 }
252 252
......
...@@ -19,15 +19,15 @@ import java.util.LinkedList; ...@@ -19,15 +19,15 @@ import java.util.LinkedList;
19 import java.util.ListIterator; 19 import java.util.ListIterator;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 -import org.onosproject.bgpio.exceptions.BGPParseException; 22 +import org.onosproject.bgpio.exceptions.BgpParseException;
23 -import org.onosproject.bgpio.protocol.BGPMessageReader; 23 +import org.onosproject.bgpio.protocol.BgpMessageReader;
24 -import org.onosproject.bgpio.protocol.BGPMessageWriter; 24 +import org.onosproject.bgpio.protocol.BgpMessageWriter;
25 -import org.onosproject.bgpio.protocol.BGPOpenMsg; 25 +import org.onosproject.bgpio.protocol.BgpOpenMsg;
26 -import org.onosproject.bgpio.protocol.BGPType; 26 +import org.onosproject.bgpio.protocol.BgpType;
27 -import org.onosproject.bgpio.protocol.BGPVersion; 27 +import org.onosproject.bgpio.protocol.BgpVersion;
28 -import org.onosproject.bgpio.types.BGPErrorType; 28 +import org.onosproject.bgpio.types.BgpErrorType;
29 -import org.onosproject.bgpio.types.BGPHeader; 29 +import org.onosproject.bgpio.types.BgpHeader;
30 -import org.onosproject.bgpio.types.BGPValueType; 30 +import org.onosproject.bgpio.types.BgpValueType;
31 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv; 31 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv;
32 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv; 32 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv;
33 import org.onosproject.bgpio.util.Validation; 33 import org.onosproject.bgpio.util.Validation;
...@@ -39,7 +39,7 @@ import com.google.common.base.MoreObjects; ...@@ -39,7 +39,7 @@ import com.google.common.base.MoreObjects;
39 /** 39 /**
40 * Provides BGP open message. 40 * Provides BGP open message.
41 */ 41 */
42 -public class BGPOpenMsgVer4 implements BGPOpenMsg { 42 +public class BgpOpenMsgVer4 implements BgpOpenMsg {
43 43
44 /* 44 /*
45 0 1 2 3 45 0 1 2 3
...@@ -61,7 +61,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -61,7 +61,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
61 REFERENCE : RFC 4271 61 REFERENCE : RFC 4271
62 */ 62 */
63 63
64 - protected static final Logger log = LoggerFactory.getLogger(BGPOpenMsgVer4.class); 64 + protected static final Logger log = LoggerFactory.getLogger(BgpOpenMsgVer4.class);
65 65
66 public static final byte PACKET_VERSION = 4; 66 public static final byte PACKET_VERSION = 4;
67 public static final int OPEN_MSG_MINIMUM_LENGTH = 10; 67 public static final int OPEN_MSG_MINIMUM_LENGTH = 10;
...@@ -70,7 +70,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -70,7 +70,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
70 public static final int DEFAULT_HOLD_TIME = 120; 70 public static final int DEFAULT_HOLD_TIME = 120;
71 public static final short AS_TRANS = 23456; 71 public static final short AS_TRANS = 23456;
72 public static final int OPT_PARA_TYPE_CAPABILITY = 2; 72 public static final int OPT_PARA_TYPE_CAPABILITY = 2;
73 - public static final BGPType MSG_TYPE = BGPType.OPEN; 73 + public static final BgpType MSG_TYPE = BgpType.OPEN;
74 public static final short AFI = 16388; 74 public static final short AFI = 16388;
75 public static final byte SAFI = 71; 75 public static final byte SAFI = 71;
76 public static final byte RES = 0; 76 public static final byte RES = 0;
...@@ -78,22 +78,22 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -78,22 +78,22 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
78 public static final byte[] MARKER = new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 78 public static final byte[] MARKER = new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
79 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 79 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
80 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}; 80 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff};
81 - public static final BGPHeader DEFAULT_OPEN_HEADER = new BGPHeader(MARKER, 81 + public static final BgpHeader DEFAULT_OPEN_HEADER = new BgpHeader(MARKER,
82 (short) OPEN_MSG_MINIMUM_LENGTH, (byte) 0X01); 82 (short) OPEN_MSG_MINIMUM_LENGTH, (byte) 0X01);
83 - private BGPHeader bgpMsgHeader; 83 + private BgpHeader bgpMsgHeader;
84 private byte version; 84 private byte version;
85 private short asNumber; 85 private short asNumber;
86 private short holdTime; 86 private short holdTime;
87 private int bgpId; 87 private int bgpId;
88 private boolean isLargeAsCapabilitySet; 88 private boolean isLargeAsCapabilitySet;
89 - private LinkedList<BGPValueType> capabilityTlv; 89 + private LinkedList<BgpValueType> capabilityTlv;
90 90
91 - public static final BGPOpenMsgVer4.Reader READER = new Reader(); 91 + public static final BgpOpenMsgVer4.Reader READER = new Reader();
92 92
93 /** 93 /**
94 * reset variables. 94 * reset variables.
95 */ 95 */
96 - public BGPOpenMsgVer4() { 96 + public BgpOpenMsgVer4() {
97 this.bgpMsgHeader = null; 97 this.bgpMsgHeader = null;
98 this.version = 0; 98 this.version = 0;
99 this.holdTime = 0; 99 this.holdTime = 0;
...@@ -112,8 +112,8 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -112,8 +112,8 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
112 * @param bgpId BGP identifier in open message 112 * @param bgpId BGP identifier in open message
113 * @param capabilityTlv capabilities in open message 113 * @param capabilityTlv capabilities in open message
114 */ 114 */
115 - public BGPOpenMsgVer4(BGPHeader bgpMsgHeader, byte version, short asNumber, short holdTime, 115 + public BgpOpenMsgVer4(BgpHeader bgpMsgHeader, byte version, short asNumber, short holdTime,
116 - int bgpId, LinkedList<BGPValueType> capabilityTlv) { 116 + int bgpId, LinkedList<BgpValueType> capabilityTlv) {
117 this.bgpMsgHeader = bgpMsgHeader; 117 this.bgpMsgHeader = bgpMsgHeader;
118 this.version = version; 118 this.version = version;
119 this.asNumber = asNumber; 119 this.asNumber = asNumber;
...@@ -123,17 +123,17 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -123,17 +123,17 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
123 } 123 }
124 124
125 @Override 125 @Override
126 - public BGPHeader getHeader() { 126 + public BgpHeader getHeader() {
127 return this.bgpMsgHeader; 127 return this.bgpMsgHeader;
128 } 128 }
129 129
130 @Override 130 @Override
131 - public BGPVersion getVersion() { 131 + public BgpVersion getVersion() {
132 - return BGPVersion.BGP_4; 132 + return BgpVersion.BGP_4;
133 } 133 }
134 134
135 @Override 135 @Override
136 - public BGPType getType() { 136 + public BgpType getType() {
137 return MSG_TYPE; 137 return MSG_TYPE;
138 } 138 }
139 139
...@@ -153,17 +153,17 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -153,17 +153,17 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
153 } 153 }
154 154
155 @Override 155 @Override
156 - public LinkedList<BGPValueType> getCapabilityTlv() { 156 + public LinkedList<BgpValueType> getCapabilityTlv() {
157 return this.capabilityTlv; 157 return this.capabilityTlv;
158 } 158 }
159 159
160 /** 160 /**
161 * Reader class for reading BGP open message from channel buffer. 161 * Reader class for reading BGP open message from channel buffer.
162 */ 162 */
163 - public static class Reader implements BGPMessageReader<BGPOpenMsg> { 163 + public static class Reader implements BgpMessageReader<BgpOpenMsg> {
164 164
165 @Override 165 @Override
166 - public BGPOpenMsg readFrom(ChannelBuffer cb, BGPHeader bgpHeader) throws BGPParseException { 166 + public BgpOpenMsg readFrom(ChannelBuffer cb, BgpHeader bgpHeader) throws BgpParseException {
167 167
168 byte version; 168 byte version;
169 short holdTime; 169 short holdTime;
...@@ -172,11 +172,11 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -172,11 +172,11 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
172 byte optParaLen = 0; 172 byte optParaLen = 0;
173 byte optParaType; 173 byte optParaType;
174 byte capParaLen = 0; 174 byte capParaLen = 0;
175 - LinkedList<BGPValueType> capabilityTlv = new LinkedList<>(); 175 + LinkedList<BgpValueType> capabilityTlv = new LinkedList<>();
176 176
177 if (cb.readableBytes() < OPEN_MSG_MINIMUM_LENGTH) { 177 if (cb.readableBytes() < OPEN_MSG_MINIMUM_LENGTH) {
178 log.error("[readFrom] Invalid length: Packet size is less than the minimum length "); 178 log.error("[readFrom] Invalid length: Packet size is less than the minimum length ");
179 - Validation.validateLen(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.BAD_MESSAGE_LENGTH, 179 + Validation.validateLen(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.BAD_MESSAGE_LENGTH,
180 cb.readableBytes()); 180 cb.readableBytes());
181 } 181 }
182 182
...@@ -184,8 +184,8 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -184,8 +184,8 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
184 version = cb.readByte(); 184 version = cb.readByte();
185 if (version != PACKET_VERSION) { 185 if (version != PACKET_VERSION) {
186 log.error("[readFrom] Invalid version: " + version); 186 log.error("[readFrom] Invalid version: " + version);
187 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, 187 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR,
188 - BGPErrorType.UNSUPPORTED_VERSION_NUMBER, null); 188 + BgpErrorType.UNSUPPORTED_VERSION_NUMBER, null);
189 } 189 }
190 190
191 // Read AS number 191 // Read AS number
...@@ -209,7 +209,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -209,7 +209,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
209 capParaLen = cb.readByte(); 209 capParaLen = cb.readByte();
210 210
211 if (cb.readableBytes() < capParaLen) { 211 if (cb.readableBytes() < capParaLen) {
212 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, (byte) 0, null); 212 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, (byte) 0, null);
213 } 213 }
214 214
215 ChannelBuffer capaCb = cb.readBytes(capParaLen); 215 ChannelBuffer capaCb = cb.readBytes(capParaLen);
...@@ -218,11 +218,11 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -218,11 +218,11 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
218 if ((optParaType == OPT_PARA_TYPE_CAPABILITY) && (capParaLen != 0)) { 218 if ((optParaType == OPT_PARA_TYPE_CAPABILITY) && (capParaLen != 0)) {
219 capabilityTlv = parseCapabilityTlv(capaCb); 219 capabilityTlv = parseCapabilityTlv(capaCb);
220 } else { 220 } else {
221 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, 221 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR,
222 - BGPErrorType.UNSUPPORTED_OPTIONAL_PARAMETER, null); 222 + BgpErrorType.UNSUPPORTED_OPTIONAL_PARAMETER, null);
223 } 223 }
224 } 224 }
225 - return new BGPOpenMsgVer4(bgpHeader, version, asNumber, holdTime, bgpId, capabilityTlv); 225 + return new BgpOpenMsgVer4(bgpHeader, version, asNumber, holdTime, bgpId, capabilityTlv);
226 } 226 }
227 } 227 }
228 228
...@@ -231,14 +231,14 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -231,14 +231,14 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
231 * 231 *
232 * @param cb of type channel buffer 232 * @param cb of type channel buffer
233 * @return capabilityTlv of open message 233 * @return capabilityTlv of open message
234 - * @throws BGPParseException while parsing capabilities 234 + * @throws BgpParseException while parsing capabilities
235 */ 235 */
236 - protected static LinkedList<BGPValueType> parseCapabilityTlv(ChannelBuffer cb) throws BGPParseException { 236 + protected static LinkedList<BgpValueType> parseCapabilityTlv(ChannelBuffer cb) throws BgpParseException {
237 237
238 - LinkedList<BGPValueType> capabilityTlv = new LinkedList<>(); 238 + LinkedList<BgpValueType> capabilityTlv = new LinkedList<>();
239 239
240 while (cb.readableBytes() > 0) { 240 while (cb.readableBytes() > 0) {
241 - BGPValueType tlv; 241 + BgpValueType tlv;
242 short type = cb.readByte(); 242 short type = cb.readByte();
243 short length = cb.readByte(); 243 short length = cb.readByte();
244 244
...@@ -246,10 +246,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -246,10 +246,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
246 case FourOctetAsNumCapabilityTlv.TYPE: 246 case FourOctetAsNumCapabilityTlv.TYPE:
247 log.debug("FourOctetAsNumCapabilityTlv"); 247 log.debug("FourOctetAsNumCapabilityTlv");
248 if (FourOctetAsNumCapabilityTlv.LENGTH != length) { 248 if (FourOctetAsNumCapabilityTlv.LENGTH != length) {
249 - throw new BGPParseException("Invalid length received for FourOctetAsNumCapabilityTlv."); 249 + throw new BgpParseException("Invalid length received for FourOctetAsNumCapabilityTlv.");
250 } 250 }
251 if (length > cb.readableBytes()) { 251 if (length > cb.readableBytes()) {
252 - throw new BGPParseException("Four octet as num tlv length" 252 + throw new BgpParseException("Four octet as num tlv length"
253 + " is more than readableBytes."); 253 + " is more than readableBytes.");
254 } 254 }
255 int as4Num = cb.readInt(); 255 int as4Num = cb.readInt();
...@@ -258,10 +258,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -258,10 +258,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
258 case MultiProtocolExtnCapabilityTlv.TYPE: 258 case MultiProtocolExtnCapabilityTlv.TYPE:
259 log.debug("MultiProtocolExtnCapabilityTlv"); 259 log.debug("MultiProtocolExtnCapabilityTlv");
260 if (MultiProtocolExtnCapabilityTlv.LENGTH != length) { 260 if (MultiProtocolExtnCapabilityTlv.LENGTH != length) {
261 - throw new BGPParseException("Invalid length received for MultiProtocolExtnCapabilityTlv."); 261 + throw new BgpParseException("Invalid length received for MultiProtocolExtnCapabilityTlv.");
262 } 262 }
263 if (length > cb.readableBytes()) { 263 if (length > cb.readableBytes()) {
264 - throw new BGPParseException("BGP LS tlv length is more than readableBytes."); 264 + throw new BgpParseException("BGP LS tlv length is more than readableBytes.");
265 } 265 }
266 short afi = cb.readShort(); 266 short afi = cb.readShort();
267 byte res = cb.readByte(); 267 byte res = cb.readByte();
...@@ -281,10 +281,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -281,10 +281,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
281 /** 281 /**
282 * Builder class for BGP open message. 282 * Builder class for BGP open message.
283 */ 283 */
284 - static class Builder implements BGPOpenMsg.Builder { 284 + static class Builder implements BgpOpenMsg.Builder {
285 285
286 private boolean isHeaderSet = false; 286 private boolean isHeaderSet = false;
287 - private BGPHeader bgpMsgHeader; 287 + private BgpHeader bgpMsgHeader;
288 private boolean isHoldTimeSet = false; 288 private boolean isHoldTimeSet = false;
289 private short holdTime; 289 private short holdTime;
290 private boolean isAsNumSet = false; 290 private boolean isAsNumSet = false;
...@@ -294,40 +294,40 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -294,40 +294,40 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
294 private boolean isLargeAsCapabilityTlvSet = false; 294 private boolean isLargeAsCapabilityTlvSet = false;
295 private boolean isLsCapabilityTlvSet = false; 295 private boolean isLsCapabilityTlvSet = false;
296 296
297 - LinkedList<BGPValueType> capabilityTlv = new LinkedList<>(); 297 + LinkedList<BgpValueType> capabilityTlv = new LinkedList<>();
298 298
299 @Override 299 @Override
300 - public BGPOpenMsg build() throws BGPParseException { 300 + public BgpOpenMsg build() throws BgpParseException {
301 - BGPHeader bgpMsgHeader = this.isHeaderSet ? this.bgpMsgHeader : DEFAULT_OPEN_HEADER; 301 + BgpHeader bgpMsgHeader = this.isHeaderSet ? this.bgpMsgHeader : DEFAULT_OPEN_HEADER;
302 short holdTime = this.isHoldTimeSet ? this.holdTime : DEFAULT_HOLD_TIME; 302 short holdTime = this.isHoldTimeSet ? this.holdTime : DEFAULT_HOLD_TIME;
303 303
304 if (!this.isAsNumSet) { 304 if (!this.isAsNumSet) {
305 - throw new BGPParseException("BGP AS number is not set (mandatory)"); 305 + throw new BgpParseException("BGP AS number is not set (mandatory)");
306 } 306 }
307 307
308 if (!this.isBgpIdSet) { 308 if (!this.isBgpIdSet) {
309 - throw new BGPParseException("BGPID is not set (mandatory)"); 309 + throw new BgpParseException("BGPID is not set (mandatory)");
310 } 310 }
311 311
312 if (this.isLargeAsCapabilityTlvSet) { 312 if (this.isLargeAsCapabilityTlvSet) {
313 - BGPValueType tlv; 313 + BgpValueType tlv;
314 int value = this.asNumber; 314 int value = this.asNumber;
315 tlv = new FourOctetAsNumCapabilityTlv(value); 315 tlv = new FourOctetAsNumCapabilityTlv(value);
316 this.capabilityTlv.add(tlv); 316 this.capabilityTlv.add(tlv);
317 } 317 }
318 318
319 if (this.isLsCapabilityTlvSet) { 319 if (this.isLsCapabilityTlvSet) {
320 - BGPValueType tlv; 320 + BgpValueType tlv;
321 tlv = new MultiProtocolExtnCapabilityTlv(AFI, RES, SAFI); 321 tlv = new MultiProtocolExtnCapabilityTlv(AFI, RES, SAFI);
322 this.capabilityTlv.add(tlv); 322 this.capabilityTlv.add(tlv);
323 } 323 }
324 324
325 - return new BGPOpenMsgVer4(bgpMsgHeader, PACKET_VERSION, this.asNumber, holdTime, this.bgpId, 325 + return new BgpOpenMsgVer4(bgpMsgHeader, PACKET_VERSION, this.asNumber, holdTime, this.bgpId,
326 this.capabilityTlv); 326 this.capabilityTlv);
327 } 327 }
328 328
329 @Override 329 @Override
330 - public Builder setHeader(BGPHeader bgpMsgHeader) { 330 + public Builder setHeader(BgpHeader bgpMsgHeader) {
331 this.bgpMsgHeader = bgpMsgHeader; 331 this.bgpMsgHeader = bgpMsgHeader;
332 return this; 332 return this;
333 } 333 }
...@@ -354,7 +354,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -354,7 +354,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
354 } 354 }
355 355
356 @Override 356 @Override
357 - public Builder setCapabilityTlv(LinkedList<BGPValueType> capabilityTlv) { 357 + public Builder setCapabilityTlv(LinkedList<BgpValueType> capabilityTlv) {
358 this.capabilityTlv = capabilityTlv; 358 this.capabilityTlv = capabilityTlv;
359 return this; 359 return this;
360 } 360 }
...@@ -376,7 +376,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -376,7 +376,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
376 public void writeTo(ChannelBuffer cb) { 376 public void writeTo(ChannelBuffer cb) {
377 try { 377 try {
378 WRITER.write(cb, this); 378 WRITER.write(cb, this);
379 - } catch (BGPParseException e) { 379 + } catch (BgpParseException e) {
380 log.debug("[writeTo] Error: " + e.toString()); 380 log.debug("[writeTo] Error: " + e.toString());
381 } 381 }
382 } 382 }
...@@ -386,10 +386,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -386,10 +386,10 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
386 /** 386 /**
387 * Writer class for writing BGP open message to channel buffer. 387 * Writer class for writing BGP open message to channel buffer.
388 */ 388 */
389 - public static class Writer implements BGPMessageWriter<BGPOpenMsgVer4> { 389 + public static class Writer implements BgpMessageWriter<BgpOpenMsgVer4> {
390 390
391 @Override 391 @Override
392 - public void write(ChannelBuffer cb, BGPOpenMsgVer4 message) throws BGPParseException { 392 + public void write(ChannelBuffer cb, BgpOpenMsgVer4 message) throws BgpParseException {
393 393
394 int optParaLen = 0; 394 int optParaLen = 0;
395 int as4num = 0; 395 int as4num = 0;
...@@ -400,7 +400,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -400,7 +400,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
400 int msgLenIndex = message.bgpMsgHeader.write(cb); 400 int msgLenIndex = message.bgpMsgHeader.write(cb);
401 401
402 if (msgLenIndex <= 0) { 402 if (msgLenIndex <= 0) {
403 - throw new BGPParseException("Unable to write message header."); 403 + throw new BgpParseException("Unable to write message header.");
404 } 404 }
405 405
406 // write version in 1-octet 406 // write version in 1-octet
...@@ -408,13 +408,13 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -408,13 +408,13 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
408 408
409 // get as4num if LS Capability is set 409 // get as4num if LS Capability is set
410 if (message.isLargeAsCapabilitySet) { 410 if (message.isLargeAsCapabilitySet) {
411 - LinkedList<BGPValueType> capabilityTlv = message 411 + LinkedList<BgpValueType> capabilityTlv = message
412 .getCapabilityTlv(); 412 .getCapabilityTlv();
413 - ListIterator<BGPValueType> listIterator = capabilityTlv 413 + ListIterator<BgpValueType> listIterator = capabilityTlv
414 .listIterator(); 414 .listIterator();
415 415
416 while (listIterator.hasNext()) { 416 while (listIterator.hasNext()) {
417 - BGPValueType tlv = listIterator.next(); 417 + BgpValueType tlv = listIterator.next();
418 if (tlv.getType() == FOUR_OCTET_AS_NUM_CAPA_TYPE) { 418 if (tlv.getType() == FOUR_OCTET_AS_NUM_CAPA_TYPE) {
419 as4num = ((FourOctetAsNumCapabilityTlv) tlv).getInt(); 419 as4num = ((FourOctetAsNumCapabilityTlv) tlv).getInt();
420 break; 420 break;
...@@ -464,13 +464,13 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -464,13 +464,13 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
464 * @param message of type BGPOpenMsgVer4 464 * @param message of type BGPOpenMsgVer4
465 * @return capParaLen of open message 465 * @return capParaLen of open message
466 */ 466 */
467 - protected int packCapabilityTlv(ChannelBuffer cb, BGPOpenMsgVer4 message) { 467 + protected int packCapabilityTlv(ChannelBuffer cb, BgpOpenMsgVer4 message) {
468 int startIndex = cb.writerIndex(); 468 int startIndex = cb.writerIndex();
469 int capParaLen = 0; 469 int capParaLen = 0;
470 int capParaLenIndex = 0; 470 int capParaLenIndex = 0;
471 471
472 - LinkedList<BGPValueType> capabilityTlv = message.capabilityTlv; 472 + LinkedList<BgpValueType> capabilityTlv = message.capabilityTlv;
473 - ListIterator<BGPValueType> listIterator = capabilityTlv.listIterator(); 473 + ListIterator<BgpValueType> listIterator = capabilityTlv.listIterator();
474 474
475 if (listIterator.hasNext()) { 475 if (listIterator.hasNext()) {
476 // Set optional parameter type as 2 476 // Set optional parameter type as 2
...@@ -487,7 +487,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg { ...@@ -487,7 +487,7 @@ public class BGPOpenMsgVer4 implements BGPOpenMsg {
487 } 487 }
488 488
489 while (listIterator.hasNext()) { 489 while (listIterator.hasNext()) {
490 - BGPValueType tlv = listIterator.next(); 490 + BgpValueType tlv = listIterator.next();
491 if (tlv == null) { 491 if (tlv == null) {
492 log.debug("Warning: tlv is null from CapabilityTlv list"); 492 log.debug("Warning: tlv is null from CapabilityTlv list");
493 continue; 493 continue;
......
...@@ -19,11 +19,11 @@ import java.util.LinkedList; ...@@ -19,11 +19,11 @@ import java.util.LinkedList;
19 import java.util.List; 19 import java.util.List;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 -import org.onosproject.bgpio.exceptions.BGPParseException; 22 +import org.onosproject.bgpio.exceptions.BgpParseException;
23 import org.onosproject.bgpio.types.As4Path; 23 import org.onosproject.bgpio.types.As4Path;
24 import org.onosproject.bgpio.types.AsPath; 24 import org.onosproject.bgpio.types.AsPath;
25 -import org.onosproject.bgpio.types.BGPErrorType; 25 +import org.onosproject.bgpio.types.BgpErrorType;
26 -import org.onosproject.bgpio.types.BGPValueType; 26 +import org.onosproject.bgpio.types.BgpValueType;
27 import org.onosproject.bgpio.types.LocalPref; 27 import org.onosproject.bgpio.types.LocalPref;
28 import org.onosproject.bgpio.types.Med; 28 import org.onosproject.bgpio.types.Med;
29 import org.onosproject.bgpio.types.NextHop; 29 import org.onosproject.bgpio.types.NextHop;
...@@ -58,7 +58,7 @@ public class BgpPathAttributes { ...@@ -58,7 +58,7 @@ public class BgpPathAttributes {
58 public static final int MPREACHNLRI_TYPE = 14; 58 public static final int MPREACHNLRI_TYPE = 14;
59 public static final int MPUNREACHNLRI_TYPE = 15; 59 public static final int MPUNREACHNLRI_TYPE = 15;
60 60
61 - private final List<BGPValueType> pathAttribute; 61 + private final List<BgpValueType> pathAttribute;
62 62
63 /** 63 /**
64 * Initialize parameter. 64 * Initialize parameter.
...@@ -72,7 +72,7 @@ public class BgpPathAttributes { ...@@ -72,7 +72,7 @@ public class BgpPathAttributes {
72 * 72 *
73 * @param pathAttribute list of path attributes 73 * @param pathAttribute list of path attributes
74 */ 74 */
75 - public BgpPathAttributes(List<BGPValueType> pathAttribute) { 75 + public BgpPathAttributes(List<BgpValueType> pathAttribute) {
76 this.pathAttribute = pathAttribute; 76 this.pathAttribute = pathAttribute;
77 } 77 }
78 78
...@@ -81,7 +81,7 @@ public class BgpPathAttributes { ...@@ -81,7 +81,7 @@ public class BgpPathAttributes {
81 * 81 *
82 * @return list of path attributes 82 * @return list of path attributes
83 */ 83 */
84 - public List<BGPValueType> pathAttributes() { 84 + public List<BgpValueType> pathAttributes() {
85 return this.pathAttribute; 85 return this.pathAttribute;
86 } 86 }
87 87
...@@ -90,13 +90,13 @@ public class BgpPathAttributes { ...@@ -90,13 +90,13 @@ public class BgpPathAttributes {
90 * 90 *
91 * @param cb channelBuffer 91 * @param cb channelBuffer
92 * @return object of BgpPathAttributes 92 * @return object of BgpPathAttributes
93 - * @throws BGPParseException while parsing BGP path attributes 93 + * @throws BgpParseException while parsing BGP path attributes
94 */ 94 */
95 public static BgpPathAttributes read(ChannelBuffer cb) 95 public static BgpPathAttributes read(ChannelBuffer cb)
96 - throws BGPParseException { 96 + throws BgpParseException {
97 97
98 - BGPValueType pathAttribute = null; 98 + BgpValueType pathAttribute = null;
99 - List<BGPValueType> pathAttributeList = new LinkedList<>(); 99 + List<BgpValueType> pathAttributeList = new LinkedList<>();
100 boolean isOrigin = false; 100 boolean isOrigin = false;
101 boolean isAsPath = false; 101 boolean isAsPath = false;
102 boolean isNextHop = false; 102 boolean isNextHop = false;
...@@ -161,27 +161,27 @@ public class BgpPathAttributes { ...@@ -161,27 +161,27 @@ public class BgpPathAttributes {
161 * @param isNextHop say whether nexthop attribute is present 161 * @param isNextHop say whether nexthop attribute is present
162 * @param isMpReach say whether mpreach attribute is present 162 * @param isMpReach say whether mpreach attribute is present
163 * @param isMpUnReach say whether mpunreach attribute is present 163 * @param isMpUnReach say whether mpunreach attribute is present
164 - * @throws BGPParseException if mandatory path attribute is not present 164 + * @throws BgpParseException if mandatory path attribute is not present
165 */ 165 */
166 public static void checkMandatoryAttr(boolean isOrigin, boolean isAsPath, 166 public static void checkMandatoryAttr(boolean isOrigin, boolean isAsPath,
167 boolean isNextHop, boolean isMpReach, boolean isMpUnReach) 167 boolean isNextHop, boolean isMpReach, boolean isMpUnReach)
168 - throws BGPParseException { 168 + throws BgpParseException {
169 if (!isOrigin) { 169 if (!isOrigin) {
170 log.debug("Mandatory Attributes not Present"); 170 log.debug("Mandatory Attributes not Present");
171 - Validation.validateType(BGPErrorType.UPDATE_MESSAGE_ERROR, 171 + Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR,
172 - BGPErrorType.MISSING_WELLKNOWN_ATTRIBUTE, 172 + BgpErrorType.MISSING_WELLKNOWN_ATTRIBUTE,
173 Origin.ORIGIN_TYPE); 173 Origin.ORIGIN_TYPE);
174 } 174 }
175 if (!isAsPath) { 175 if (!isAsPath) {
176 log.debug("Mandatory Attributes not Present"); 176 log.debug("Mandatory Attributes not Present");
177 - Validation.validateType(BGPErrorType.UPDATE_MESSAGE_ERROR, 177 + Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR,
178 - BGPErrorType.MISSING_WELLKNOWN_ATTRIBUTE, 178 + BgpErrorType.MISSING_WELLKNOWN_ATTRIBUTE,
179 AsPath.ASPATH_TYPE); 179 AsPath.ASPATH_TYPE);
180 } 180 }
181 if (!isMpUnReach && !isMpReach && !isNextHop) { 181 if (!isMpUnReach && !isMpReach && !isNextHop) {
182 log.debug("Mandatory Attributes not Present"); 182 log.debug("Mandatory Attributes not Present");
183 - Validation.validateType(BGPErrorType.UPDATE_MESSAGE_ERROR, 183 + Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR,
184 - BGPErrorType.MISSING_WELLKNOWN_ATTRIBUTE, 184 + BgpErrorType.MISSING_WELLKNOWN_ATTRIBUTE,
185 NextHop.NEXTHOP_TYPE); 185 NextHop.NEXTHOP_TYPE);
186 } 186 }
187 } 187 }
......
...@@ -20,14 +20,14 @@ import java.util.List; ...@@ -20,14 +20,14 @@ import java.util.List;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 import org.onlab.packet.IpPrefix; 22 import org.onlab.packet.IpPrefix;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.protocol.BGPMessageReader; 24 +import org.onosproject.bgpio.protocol.BgpMessageReader;
25 -import org.onosproject.bgpio.protocol.BGPType; 25 +import org.onosproject.bgpio.protocol.BgpType;
26 import org.onosproject.bgpio.protocol.BgpUpdateMsg; 26 import org.onosproject.bgpio.protocol.BgpUpdateMsg;
27 -import org.onosproject.bgpio.types.BGPErrorType; 27 +import org.onosproject.bgpio.types.BgpErrorType;
28 -import org.onosproject.bgpio.types.BGPHeader; 28 +import org.onosproject.bgpio.types.BgpHeader;
29 import org.onosproject.bgpio.util.Validation; 29 import org.onosproject.bgpio.util.Validation;
30 -import org.onosproject.bgpio.protocol.BGPVersion; 30 +import org.onosproject.bgpio.protocol.BgpVersion;
31 import org.slf4j.Logger; 31 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory; 32 import org.slf4j.LoggerFactory;
33 33
...@@ -75,12 +75,12 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -75,12 +75,12 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
75 public static final int BYTE_IN_BITS = 8; 75 public static final int BYTE_IN_BITS = 8;
76 public static final int MIN_LEN_AFTER_WITHDRW_ROUTES = 2; 76 public static final int MIN_LEN_AFTER_WITHDRW_ROUTES = 2;
77 public static final int MINIMUM_COMMON_HEADER_LENGTH = 19; 77 public static final int MINIMUM_COMMON_HEADER_LENGTH = 19;
78 - public static final BGPType MSG_TYPE = BGPType.UPDATE; 78 + public static final BgpType MSG_TYPE = BgpType.UPDATE;
79 public static final BgpUpdateMsgVer4.Reader READER = new Reader(); 79 public static final BgpUpdateMsgVer4.Reader READER = new Reader();
80 80
81 private List<IpPrefix> withdrawnRoutes; 81 private List<IpPrefix> withdrawnRoutes;
82 private BgpPathAttributes bgpPathAttributes; 82 private BgpPathAttributes bgpPathAttributes;
83 - private BGPHeader bgpHeader; 83 + private BgpHeader bgpHeader;
84 private List<IpPrefix> nlri; 84 private List<IpPrefix> nlri;
85 85
86 /** 86 /**
...@@ -91,7 +91,7 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -91,7 +91,7 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
91 * @param bgpPathAttributes BGP Path attributes 91 * @param bgpPathAttributes BGP Path attributes
92 * @param nlri Network Layer Reachability Information 92 * @param nlri Network Layer Reachability Information
93 */ 93 */
94 - public BgpUpdateMsgVer4(BGPHeader bgpHeader, List<IpPrefix> withdrawnRoutes, 94 + public BgpUpdateMsgVer4(BgpHeader bgpHeader, List<IpPrefix> withdrawnRoutes,
95 BgpPathAttributes bgpPathAttributes, List<IpPrefix> nlri) { 95 BgpPathAttributes bgpPathAttributes, List<IpPrefix> nlri) {
96 this.bgpHeader = bgpHeader; 96 this.bgpHeader = bgpHeader;
97 this.withdrawnRoutes = withdrawnRoutes; 97 this.withdrawnRoutes = withdrawnRoutes;
...@@ -102,15 +102,15 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -102,15 +102,15 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
102 /** 102 /**
103 * Reader reads BGP Update Message from the channel buffer. 103 * Reader reads BGP Update Message from the channel buffer.
104 */ 104 */
105 - static class Reader implements BGPMessageReader<BgpUpdateMsg> { 105 + static class Reader implements BgpMessageReader<BgpUpdateMsg> {
106 106
107 @Override 107 @Override
108 - public BgpUpdateMsg readFrom(ChannelBuffer cb, BGPHeader bgpHeader) 108 + public BgpUpdateMsg readFrom(ChannelBuffer cb, BgpHeader bgpHeader)
109 - throws BGPParseException { 109 + throws BgpParseException {
110 110
111 if (cb.readableBytes() != (bgpHeader.getLength() - MINIMUM_COMMON_HEADER_LENGTH)) { 111 if (cb.readableBytes() != (bgpHeader.getLength() - MINIMUM_COMMON_HEADER_LENGTH)) {
112 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 112 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
113 - BGPErrorType.BAD_MESSAGE_LENGTH, bgpHeader.getLength()); 113 + BgpErrorType.BAD_MESSAGE_LENGTH, bgpHeader.getLength());
114 } 114 }
115 115
116 LinkedList<IpPrefix> withDrwRoutes = new LinkedList<>(); 116 LinkedList<IpPrefix> withDrwRoutes = new LinkedList<>();
...@@ -120,8 +120,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -120,8 +120,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
120 Short withDrwLen = cb.readShort(); 120 Short withDrwLen = cb.readShort();
121 121
122 if (cb.readableBytes() < withDrwLen) { 122 if (cb.readableBytes() < withDrwLen) {
123 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 123 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
124 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, 124 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST,
125 cb.readableBytes()); 125 cb.readableBytes());
126 } 126 }
127 ChannelBuffer tempCb = cb.readBytes(withDrwLen); 127 ChannelBuffer tempCb = cb.readBytes(withDrwLen);
...@@ -131,23 +131,23 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -131,23 +131,23 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
131 } 131 }
132 if (cb.readableBytes() < MIN_LEN_AFTER_WITHDRW_ROUTES) { 132 if (cb.readableBytes() < MIN_LEN_AFTER_WITHDRW_ROUTES) {
133 log.debug("Bgp Path Attribute len field not present"); 133 log.debug("Bgp Path Attribute len field not present");
134 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 134 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
135 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); 135 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null);
136 } 136 }
137 137
138 // Reading Total Path Attribute Length 138 // Reading Total Path Attribute Length
139 short totPathAttrLen = cb.readShort(); 139 short totPathAttrLen = cb.readShort();
140 int len = withDrwLen + totPathAttrLen + PACKET_MINIMUM_LENGTH; 140 int len = withDrwLen + totPathAttrLen + PACKET_MINIMUM_LENGTH;
141 if (len > bgpHeader.getLength()) { 141 if (len > bgpHeader.getLength()) {
142 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 142 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
143 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); 143 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null);
144 } 144 }
145 if (totPathAttrLen != 0) { 145 if (totPathAttrLen != 0) {
146 // Parsing BGPPathAttributes 146 // Parsing BGPPathAttributes
147 if (cb.readableBytes() < totPathAttrLen) { 147 if (cb.readableBytes() < totPathAttrLen) {
148 Validation 148 Validation
149 - .validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 149 + .validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
150 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, 150 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST,
151 cb.readableBytes()); 151 cb.readableBytes());
152 } 152 }
153 tempCb = cb.readBytes(totPathAttrLen); 153 tempCb = cb.readBytes(totPathAttrLen);
...@@ -167,10 +167,10 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -167,10 +167,10 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
167 * 167 *
168 * @param cb channelBuffer 168 * @param cb channelBuffer
169 * @return list of IP Prefix 169 * @return list of IP Prefix
170 - * @throws BGPParseException while parsing NLRI 170 + * @throws BgpParseException while parsing NLRI
171 */ 171 */
172 public static LinkedList<IpPrefix> parseNlri(ChannelBuffer cb) 172 public static LinkedList<IpPrefix> parseNlri(ChannelBuffer cb)
173 - throws BGPParseException { 173 + throws BgpParseException {
174 LinkedList<IpPrefix> nlri = new LinkedList<>(); 174 LinkedList<IpPrefix> nlri = new LinkedList<>();
175 while (cb.readableBytes() > 0) { 175 while (cb.readableBytes() > 0) {
176 int length = cb.readByte(); 176 int length = cb.readByte();
...@@ -186,8 +186,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -186,8 +186,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
186 len = len + 1; 186 len = len + 1;
187 } 187 }
188 if (cb.readableBytes() < len) { 188 if (cb.readableBytes() < len) {
189 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 189 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
190 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, 190 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST,
191 cb.readableBytes()); 191 cb.readableBytes());
192 } 192 }
193 byte[] prefix = new byte[len]; 193 byte[] prefix = new byte[len];
...@@ -204,10 +204,10 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -204,10 +204,10 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
204 * 204 *
205 * @param cb channelBuffer 205 * @param cb channelBuffer
206 * @return list of IP prefix 206 * @return list of IP prefix
207 - * @throws BGPParseException while parsing withdrawn routes 207 + * @throws BgpParseException while parsing withdrawn routes
208 */ 208 */
209 public static LinkedList<IpPrefix> parseWithdrawnRoutes(ChannelBuffer cb) 209 public static LinkedList<IpPrefix> parseWithdrawnRoutes(ChannelBuffer cb)
210 - throws BGPParseException { 210 + throws BgpParseException {
211 LinkedList<IpPrefix> withDrwRoutes = new LinkedList<>(); 211 LinkedList<IpPrefix> withDrwRoutes = new LinkedList<>();
212 while (cb.readableBytes() > 0) { 212 while (cb.readableBytes() > 0) {
213 int length = cb.readByte(); 213 int length = cb.readByte();
...@@ -224,8 +224,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -224,8 +224,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
224 } 224 }
225 if (cb.readableBytes() < len) { 225 if (cb.readableBytes() < len) {
226 Validation 226 Validation
227 - .validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 227 + .validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
228 - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, 228 + BgpErrorType.MALFORMED_ATTRIBUTE_LIST,
229 cb.readableBytes()); 229 cb.readableBytes());
230 } 230 }
231 byte[] prefix = new byte[len]; 231 byte[] prefix = new byte[len];
...@@ -238,17 +238,17 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -238,17 +238,17 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
238 } 238 }
239 239
240 @Override 240 @Override
241 - public BGPVersion getVersion() { 241 + public BgpVersion getVersion() {
242 - return BGPVersion.BGP_4; 242 + return BgpVersion.BGP_4;
243 } 243 }
244 244
245 @Override 245 @Override
246 - public BGPType getType() { 246 + public BgpType getType() {
247 - return BGPType.UPDATE; 247 + return BgpType.UPDATE;
248 } 248 }
249 249
250 @Override 250 @Override
251 - public void writeTo(ChannelBuffer channelBuffer) throws BGPParseException { 251 + public void writeTo(ChannelBuffer channelBuffer) throws BgpParseException {
252 //Not to be implemented as of now 252 //Not to be implemented as of now
253 } 253 }
254 254
...@@ -268,7 +268,7 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { ...@@ -268,7 +268,7 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg {
268 } 268 }
269 269
270 @Override 270 @Override
271 - public BGPHeader getHeader() { 271 + public BgpHeader getHeader() {
272 return this.bgpHeader; 272 return this.bgpHeader;
273 } 273 }
274 274
......
...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects; ...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects;
26 /** 26 /**
27 * Provides AreaID Tlv which contains opaque value (32 Bit Area-ID). 27 * Provides AreaID Tlv which contains opaque value (32 Bit Area-ID).
28 */ 28 */
29 -public class AreaIDTlv implements BGPValueType { 29 +public class AreaIDTlv implements BgpValueType {
30 30
31 /* Reference :draft-ietf-idr-ls-distribution-11 31 /* Reference :draft-ietf-idr-ls-distribution-11
32 * 0 1 2 3 32 * 0 1 2 3
......
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
20 import java.util.Objects; 20 import java.util.Objects;
21 21
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 import org.onosproject.bgpio.util.Constants; 24 import org.onosproject.bgpio.util.Constants;
25 import org.onosproject.bgpio.util.Validation; 25 import org.onosproject.bgpio.util.Validation;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects; ...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects;
31 /** 31 /**
32 * Provides Implementation of As4Path BGP Path Attribute. 32 * Provides Implementation of As4Path BGP Path Attribute.
33 */ 33 */
34 -public class As4Path implements BGPValueType { 34 +public class As4Path implements BgpValueType {
35 private static final Logger log = LoggerFactory.getLogger(AsPath.class); 35 private static final Logger log = LoggerFactory.getLogger(AsPath.class);
36 public static final byte AS4PATH_TYPE = 17; 36 public static final byte AS4PATH_TYPE = 17;
37 public static final byte ASNUM_SIZE = 4; 37 public static final byte ASNUM_SIZE = 4;
...@@ -63,16 +63,16 @@ public class As4Path implements BGPValueType { ...@@ -63,16 +63,16 @@ public class As4Path implements BGPValueType {
63 * 63 *
64 * @param cb ChannelBuffer 64 * @param cb ChannelBuffer
65 * @return object of As4Path 65 * @return object of As4Path
66 - * @throws BGPParseException while parsing As4Path 66 + * @throws BgpParseException while parsing As4Path
67 */ 67 */
68 - public static As4Path read(ChannelBuffer cb) throws BGPParseException { 68 + public static As4Path read(ChannelBuffer cb) throws BgpParseException {
69 List<Integer> as4pathSet = new ArrayList<>(); 69 List<Integer> as4pathSet = new ArrayList<>();
70 List<Integer> as4pathSeq = new ArrayList<>(); 70 List<Integer> as4pathSeq = new ArrayList<>();
71 ChannelBuffer tempCb = cb.copy(); 71 ChannelBuffer tempCb = cb.copy();
72 Validation validation = Validation.parseAttributeHeader(cb); 72 Validation validation = Validation.parseAttributeHeader(cb);
73 73
74 if (cb.readableBytes() < validation.getLength()) { 74 if (cb.readableBytes() < validation.getLength()) {
75 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 75 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
76 validation.getLength()); 76 validation.getLength());
77 } 77 }
78 //if fourth bit is set length is read as short otherwise as byte , len includes type, length and value 78 //if fourth bit is set length is read as short otherwise as byte , len includes type, length and value
...@@ -80,7 +80,7 @@ public class As4Path implements BGPValueType { ...@@ -80,7 +80,7 @@ public class As4Path implements BGPValueType {
80 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE; 80 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE;
81 ChannelBuffer data = tempCb.readBytes(len); 81 ChannelBuffer data = tempCb.readBytes(len);
82 if (validation.getFirstBit() && !validation.getSecondBit() && validation.getThirdBit()) { 82 if (validation.getFirstBit() && !validation.getSecondBit() && validation.getThirdBit()) {
83 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 83 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
84 } 84 }
85 85
86 ChannelBuffer tempBuf = cb.readBytes(validation.getLength()); 86 ChannelBuffer tempBuf = cb.readBytes(validation.getLength());
...@@ -91,8 +91,8 @@ public class As4Path implements BGPValueType { ...@@ -91,8 +91,8 @@ public class As4Path implements BGPValueType {
91 //length = no of Ases * ASnum size (4 bytes) 91 //length = no of Ases * ASnum size (4 bytes)
92 int length = pathSegLen * ASNUM_SIZE; 92 int length = pathSegLen * ASNUM_SIZE;
93 if (tempBuf.readableBytes() < length) { 93 if (tempBuf.readableBytes() < length) {
94 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 94 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
95 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, length); 95 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR, length);
96 } 96 }
97 ChannelBuffer aspathBuf = tempBuf.readBytes(length); 97 ChannelBuffer aspathBuf = tempBuf.readBytes(length);
98 while (aspathBuf.readableBytes() > 0) { 98 while (aspathBuf.readableBytes() > 0) {
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
21 import java.util.Objects; 21 import java.util.Objects;
22 22
23 import org.jboss.netty.buffer.ChannelBuffer; 23 import org.jboss.netty.buffer.ChannelBuffer;
24 -import org.onosproject.bgpio.exceptions.BGPParseException; 24 +import org.onosproject.bgpio.exceptions.BgpParseException;
25 import org.onosproject.bgpio.util.Constants; 25 import org.onosproject.bgpio.util.Constants;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects; ...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects;
32 /** 32 /**
33 * Provides Implementation of AsPath mandatory BGP Path Attribute. 33 * Provides Implementation of AsPath mandatory BGP Path Attribute.
34 */ 34 */
35 -public class AsPath implements BGPValueType { 35 +public class AsPath implements BgpValueType {
36 /** 36 /**
37 * Enum to provide AS types. 37 * Enum to provide AS types.
38 */ 38 */
...@@ -94,16 +94,16 @@ public class AsPath implements BGPValueType { ...@@ -94,16 +94,16 @@ public class AsPath implements BGPValueType {
94 * 94 *
95 * @param cb ChannelBuffer 95 * @param cb ChannelBuffer
96 * @return object of AsPath 96 * @return object of AsPath
97 - * @throws BGPParseException while parsing AsPath 97 + * @throws BgpParseException while parsing AsPath
98 */ 98 */
99 - public static AsPath read(ChannelBuffer cb) throws BGPParseException { 99 + public static AsPath read(ChannelBuffer cb) throws BgpParseException {
100 List<Short> aspathSet = new ArrayList<>(); 100 List<Short> aspathSet = new ArrayList<>();
101 List<Short> aspathSeq = new ArrayList<>(); 101 List<Short> aspathSeq = new ArrayList<>();
102 ChannelBuffer tempCb = cb.copy(); 102 ChannelBuffer tempCb = cb.copy();
103 Validation validation = Validation.parseAttributeHeader(cb); 103 Validation validation = Validation.parseAttributeHeader(cb);
104 104
105 if (cb.readableBytes() < validation.getLength()) { 105 if (cb.readableBytes() < validation.getLength()) {
106 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 106 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
107 validation.getLength()); 107 validation.getLength());
108 } 108 }
109 //if fourth bit is set, length is read as short otherwise as byte , len includes type, length and value 109 //if fourth bit is set, length is read as short otherwise as byte , len includes type, length and value
...@@ -111,7 +111,7 @@ public class AsPath implements BGPValueType { ...@@ -111,7 +111,7 @@ public class AsPath implements BGPValueType {
111 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE; 111 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE;
112 ChannelBuffer data = tempCb.readBytes(len); 112 ChannelBuffer data = tempCb.readBytes(len);
113 if (validation.getFirstBit() && !validation.getSecondBit() && validation.getThirdBit()) { 113 if (validation.getFirstBit() && !validation.getSecondBit() && validation.getThirdBit()) {
114 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 114 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
115 } 115 }
116 116
117 ChannelBuffer tempBuf = cb.readBytes(validation.getLength()); 117 ChannelBuffer tempBuf = cb.readBytes(validation.getLength());
...@@ -121,8 +121,8 @@ public class AsPath implements BGPValueType { ...@@ -121,8 +121,8 @@ public class AsPath implements BGPValueType {
121 byte pathSegLen = tempBuf.readByte(); 121 byte pathSegLen = tempBuf.readByte();
122 int length = pathSegLen * ASNUM_SIZE; 122 int length = pathSegLen * ASNUM_SIZE;
123 if (tempBuf.readableBytes() < length) { 123 if (tempBuf.readableBytes() < length) {
124 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 124 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
125 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, length); 125 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR, length);
126 } 126 }
127 ChannelBuffer aspathBuf = tempBuf.readBytes(length); 127 ChannelBuffer aspathBuf = tempBuf.readBytes(length);
128 while (aspathBuf.readableBytes() > 0) { 128 while (aspathBuf.readableBytes() > 0) {
......
...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects; ...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects;
26 /** 26 /**
27 * Provides Autonomous System Tlv which contains opaque value (32 Bit AS Number). 27 * Provides Autonomous System Tlv which contains opaque value (32 Bit AS Number).
28 */ 28 */
29 -public class AutonomousSystemTlv implements BGPValueType { 29 +public class AutonomousSystemTlv implements BgpValueType {
30 30
31 /* Reference :draft-ietf-idr-ls-distribution-11 31 /* Reference :draft-ietf-idr-ls-distribution-11
32 * 0 1 2 3 32 * 0 1 2 3
......
...@@ -19,8 +19,8 @@ package org.onosproject.bgpio.types; ...@@ -19,8 +19,8 @@ package org.onosproject.bgpio.types;
19 /** 19 /**
20 * BgpErrorType class defines all errorCodes and error Subcodes required for Notification message. 20 * BgpErrorType class defines all errorCodes and error Subcodes required for Notification message.
21 */ 21 */
22 -public final class BGPErrorType { 22 +public final class BgpErrorType {
23 - private BGPErrorType() { 23 + private BgpErrorType() {
24 } 24 }
25 25
26 //Error Codes 26 //Error Codes
......
...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory; ...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
23 * Provides BGP Message Header which is common for all the Messages. 23 * Provides BGP Message Header which is common for all the Messages.
24 */ 24 */
25 25
26 -public class BGPHeader { 26 +public class BgpHeader {
27 27
28 /* 0 1 2 3 28 /* 0 1 2 3
29 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 29 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
...@@ -40,7 +40,7 @@ public class BGPHeader { ...@@ -40,7 +40,7 @@ public class BGPHeader {
40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 40 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 */ 41 */
42 42
43 - protected static final Logger log = LoggerFactory.getLogger(BGPHeader.class); 43 + protected static final Logger log = LoggerFactory.getLogger(BgpHeader.class);
44 44
45 public static final int MARKER_LENGTH = 16; 45 public static final int MARKER_LENGTH = 16;
46 public static final short DEFAULT_HEADER_LENGTH = 19; 46 public static final short DEFAULT_HEADER_LENGTH = 19;
...@@ -52,7 +52,7 @@ public class BGPHeader { ...@@ -52,7 +52,7 @@ public class BGPHeader {
52 /** 52 /**
53 * Reset fields. 53 * Reset fields.
54 */ 54 */
55 - public BGPHeader() { 55 + public BgpHeader() {
56 this.marker = null; 56 this.marker = null;
57 this.length = 0; 57 this.length = 0;
58 this.type = 0; 58 this.type = 0;
...@@ -65,7 +65,7 @@ public class BGPHeader { ...@@ -65,7 +65,7 @@ public class BGPHeader {
65 * @param length message length 65 * @param length message length
66 * @param type message type 66 * @param type message type
67 */ 67 */
68 - public BGPHeader(byte[] marker, short length, byte type) { 68 + public BgpHeader(byte[] marker, short length, byte type) {
69 this.marker = marker; 69 this.marker = marker;
70 this.length = length; 70 this.length = length;
71 this.type = type; 71 this.type = type;
...@@ -148,7 +148,7 @@ public class BGPHeader { ...@@ -148,7 +148,7 @@ public class BGPHeader {
148 * @param cb ChannelBuffer 148 * @param cb ChannelBuffer
149 * @return object of BGPHeader 149 * @return object of BGPHeader
150 */ 150 */
151 - public static BGPHeader read(ChannelBuffer cb) { 151 + public static BgpHeader read(ChannelBuffer cb) {
152 152
153 byte[] marker = new byte[MARKER_LENGTH]; 153 byte[] marker = new byte[MARKER_LENGTH];
154 byte type; 154 byte type;
...@@ -156,6 +156,6 @@ public class BGPHeader { ...@@ -156,6 +156,6 @@ public class BGPHeader {
156 cb.readBytes(marker, 0, MARKER_LENGTH); 156 cb.readBytes(marker, 0, MARKER_LENGTH);
157 length = cb.readShort(); 157 length = cb.readShort();
158 type = cb.readByte(); 158 type = cb.readByte();
159 - return new BGPHeader(marker, length, type); 159 + return new BgpHeader(marker, length, type);
160 } 160 }
161 } 161 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides BGPLSIdentifier Tlv which contains opaque value (32 Bit BGPLS-Identifier). 28 * Provides BGPLSIdentifier Tlv which contains opaque value (32 Bit BGPLS-Identifier).
29 */ 29 */
30 -public class BGPLSIdentifierTlv implements BGPValueType { 30 +public class BgpLSIdentifierTlv implements BgpValueType {
31 31
32 /* Reference :draft-ietf-idr-ls-distribution-11 32 /* Reference :draft-ietf-idr-ls-distribution-11
33 * 0 1 2 3 33 * 0 1 2 3
...@@ -39,7 +39,7 @@ public class BGPLSIdentifierTlv implements BGPValueType { ...@@ -39,7 +39,7 @@ public class BGPLSIdentifierTlv implements BGPValueType {
39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 39 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 */ 40 */
41 41
42 - protected static final Logger log = LoggerFactory.getLogger(BGPLSIdentifierTlv.class); 42 + protected static final Logger log = LoggerFactory.getLogger(BgpLSIdentifierTlv.class);
43 43
44 public static final short TYPE = 513; 44 public static final short TYPE = 513;
45 public static final short LENGTH = 4; 45 public static final short LENGTH = 4;
...@@ -49,26 +49,26 @@ public class BGPLSIdentifierTlv implements BGPValueType { ...@@ -49,26 +49,26 @@ public class BGPLSIdentifierTlv implements BGPValueType {
49 /** 49 /**
50 * Constructor to initialize bgpLSIdentifier. 50 * Constructor to initialize bgpLSIdentifier.
51 * 51 *
52 - * @param bgpLSIdentifier BgpLS-Identifier 52 + * @param bgpLSIdentifier BGPLS-Identifier
53 */ 53 */
54 - public BGPLSIdentifierTlv(int bgpLSIdentifier) { 54 + public BgpLSIdentifierTlv(int bgpLSIdentifier) {
55 this.bgpLSIdentifier = bgpLSIdentifier; 55 this.bgpLSIdentifier = bgpLSIdentifier;
56 } 56 }
57 57
58 /** 58 /**
59 * Returns object of this class with specified rbgpLSIdentifier. 59 * Returns object of this class with specified rbgpLSIdentifier.
60 * 60 *
61 - * @param bgpLSIdentifier BgpLS-Identifier 61 + * @param bgpLSIdentifier BGPLS-Identifier
62 - * @return BgpLS-Identifier 62 + * @return BGPLS-Identifier
63 */ 63 */
64 - public static BGPLSIdentifierTlv of(final int bgpLSIdentifier) { 64 + public static BgpLSIdentifierTlv of(final int bgpLSIdentifier) {
65 - return new BGPLSIdentifierTlv(bgpLSIdentifier); 65 + return new BgpLSIdentifierTlv(bgpLSIdentifier);
66 } 66 }
67 67
68 /** 68 /**
69 - * Returns opaque value of BgpLS-Identifier. 69 + * Returns opaque value of BGPLS-Identifier.
70 * 70 *
71 - * @return opaque value of BgpLS-Identifier 71 + * @return opaque value of BGPLS-Identifier
72 */ 72 */
73 public int getBgpLSIdentifier() { 73 public int getBgpLSIdentifier() {
74 return bgpLSIdentifier; 74 return bgpLSIdentifier;
...@@ -85,8 +85,8 @@ public class BGPLSIdentifierTlv implements BGPValueType { ...@@ -85,8 +85,8 @@ public class BGPLSIdentifierTlv implements BGPValueType {
85 return true; 85 return true;
86 } 86 }
87 87
88 - if (obj instanceof BGPLSIdentifierTlv) { 88 + if (obj instanceof BgpLSIdentifierTlv) {
89 - BGPLSIdentifierTlv other = (BGPLSIdentifierTlv) obj; 89 + BgpLSIdentifierTlv other = (BgpLSIdentifierTlv) obj;
90 return Objects.equals(bgpLSIdentifier, other.bgpLSIdentifier); 90 return Objects.equals(bgpLSIdentifier, other.bgpLSIdentifier);
91 } 91 }
92 return false; 92 return false;
...@@ -107,8 +107,8 @@ public class BGPLSIdentifierTlv implements BGPValueType { ...@@ -107,8 +107,8 @@ public class BGPLSIdentifierTlv implements BGPValueType {
107 * @param cb ChannelBuffer 107 * @param cb ChannelBuffer
108 * @return object of BGPLSIdentifierTlv 108 * @return object of BGPLSIdentifierTlv
109 */ 109 */
110 - public static BGPLSIdentifierTlv read(ChannelBuffer cb) { 110 + public static BgpLSIdentifierTlv read(ChannelBuffer cb) {
111 - return BGPLSIdentifierTlv.of(cb.readInt()); 111 + return BgpLSIdentifierTlv.of(cb.readInt());
112 } 112 }
113 113
114 @Override 114 @Override
......
...@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
21 /** 21 /**
22 * Abstraction which Provides the BGP of TLV format. 22 * Abstraction which Provides the BGP of TLV format.
23 */ 23 */
24 -public interface BGPValueType { 24 +public interface BgpValueType {
25 /** 25 /**
26 * Returns the Type of BGP Message. 26 * Returns the Type of BGP Message.
27 * 27 *
......
...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects; ...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects;
26 /** 26 /**
27 * Provides FourOctetAsNumCapabilityTlv Capability Tlv. 27 * Provides FourOctetAsNumCapabilityTlv Capability Tlv.
28 */ 28 */
29 -public class FourOctetAsNumCapabilityTlv implements BGPValueType { 29 +public class FourOctetAsNumCapabilityTlv implements BgpValueType {
30 30
31 /** 31 /**
32 * support to indicate its support for four-octet AS numbers -CAPABILITY TLV format. 32 * support to indicate its support for four-octet AS numbers -CAPABILITY TLV format.
......
...@@ -29,7 +29,7 @@ import com.google.common.base.MoreObjects; ...@@ -29,7 +29,7 @@ import com.google.common.base.MoreObjects;
29 /** 29 /**
30 * Provides IP Reachability InformationTlv Tlv which contains IP Prefix. 30 * Provides IP Reachability InformationTlv Tlv which contains IP Prefix.
31 */ 31 */
32 -public class IPReachabilityInformationTlv implements BGPValueType { 32 +public class IPReachabilityInformationTlv implements BgpValueType {
33 33
34 /* 34 /*
35 * Reference :draft-ietf-idr-ls-distribution-11 35 * Reference :draft-ietf-idr-ls-distribution-11
......
...@@ -20,7 +20,7 @@ import java.util.Objects; ...@@ -20,7 +20,7 @@ import java.util.Objects;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 import org.onlab.packet.Ip4Address; 22 import org.onlab.packet.Ip4Address;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -31,7 +31,7 @@ import com.google.common.base.Preconditions; ...@@ -31,7 +31,7 @@ import com.google.common.base.Preconditions;
31 /** 31 /**
32 * Provides Implementation of IPv4AddressTlv. 32 * Provides Implementation of IPv4AddressTlv.
33 */ 33 */
34 -public class IPv4AddressTlv implements BGPValueType { 34 +public class IPv4AddressTlv implements BgpValueType {
35 private static final Logger log = LoggerFactory.getLogger(IPv4AddressTlv.class); 35 private static final Logger log = LoggerFactory.getLogger(IPv4AddressTlv.class);
36 private static final int LENGTH = 4; 36 private static final int LENGTH = 4;
37 37
...@@ -95,12 +95,12 @@ public class IPv4AddressTlv implements BGPValueType { ...@@ -95,12 +95,12 @@ public class IPv4AddressTlv implements BGPValueType {
95 * @param cb channelBuffer 95 * @param cb channelBuffer
96 * @param type address type 96 * @param type address type
97 * @return object of IPv4AddressTlv 97 * @return object of IPv4AddressTlv
98 - * @throws BGPParseException while parsing IPv4AddressTlv 98 + * @throws BgpParseException while parsing IPv4AddressTlv
99 */ 99 */
100 - public static IPv4AddressTlv read(ChannelBuffer cb, short type) throws BGPParseException { 100 + public static IPv4AddressTlv read(ChannelBuffer cb, short type) throws BgpParseException {
101 InetAddress ipAddress = Validation.toInetAddress(LENGTH, cb); 101 InetAddress ipAddress = Validation.toInetAddress(LENGTH, cb);
102 if (ipAddress.isMulticastAddress()) { 102 if (ipAddress.isMulticastAddress()) {
103 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); 103 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
104 } 104 }
105 Ip4Address address = Ip4Address.valueOf(ipAddress); 105 Ip4Address address = Ip4Address.valueOf(ipAddress);
106 return IPv4AddressTlv.of(address, type); 106 return IPv4AddressTlv.of(address, type);
......
...@@ -20,7 +20,7 @@ import java.util.Objects; ...@@ -20,7 +20,7 @@ import java.util.Objects;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 import org.onlab.packet.Ip6Address; 22 import org.onlab.packet.Ip6Address;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -31,7 +31,7 @@ import com.google.common.base.Preconditions; ...@@ -31,7 +31,7 @@ import com.google.common.base.Preconditions;
31 /** 31 /**
32 * Provides Implementation of IPv6AddressTlv. 32 * Provides Implementation of IPv6AddressTlv.
33 */ 33 */
34 -public class IPv6AddressTlv implements BGPValueType { 34 +public class IPv6AddressTlv implements BgpValueType {
35 private static final Logger log = LoggerFactory.getLogger(IPv6AddressTlv.class); 35 private static final Logger log = LoggerFactory.getLogger(IPv6AddressTlv.class);
36 private static final int LENGTH = 16; 36 private static final int LENGTH = 16;
37 37
...@@ -95,12 +95,12 @@ public class IPv6AddressTlv implements BGPValueType { ...@@ -95,12 +95,12 @@ public class IPv6AddressTlv implements BGPValueType {
95 * @param cb channelBuffer 95 * @param cb channelBuffer
96 * @param type address type 96 * @param type address type
97 * @return object of IPv6AddressTlv 97 * @return object of IPv6AddressTlv
98 - * @throws BGPParseException while parsing IPv6AddressTlv 98 + * @throws BgpParseException while parsing IPv6AddressTlv
99 */ 99 */
100 - public static IPv6AddressTlv read(ChannelBuffer cb, short type) throws BGPParseException { 100 + public static IPv6AddressTlv read(ChannelBuffer cb, short type) throws BgpParseException {
101 InetAddress ipAddress = Validation.toInetAddress(LENGTH, cb); 101 InetAddress ipAddress = Validation.toInetAddress(LENGTH, cb);
102 if (ipAddress.isMulticastAddress()) { 102 if (ipAddress.isMulticastAddress()) {
103 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); 103 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
104 } 104 }
105 Ip6Address address = Ip6Address.valueOf(ipAddress); 105 Ip6Address address = Ip6Address.valueOf(ipAddress);
106 return IPv6AddressTlv.of(address, type); 106 return IPv6AddressTlv.of(address, type);
......
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Implementation of IsIsNonPseudonode Tlv. 28 * Provides Implementation of IsIsNonPseudonode Tlv.
29 */ 29 */
30 -public class IsIsNonPseudonode implements IGPRouterID, BGPValueType { 30 +public class IsIsNonPseudonode implements IGPRouterID, BgpValueType {
31 private static final Logger log = LoggerFactory.getLogger(IsIsNonPseudonode.class); 31 private static final Logger log = LoggerFactory.getLogger(IsIsNonPseudonode.class);
32 32
33 public static final short TYPE = 515; 33 public static final short TYPE = 515;
......
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects;
28 /** 28 /**
29 * Provides implementation of IsIsPseudonode Tlv. 29 * Provides implementation of IsIsPseudonode Tlv.
30 */ 30 */
31 -public class IsIsPseudonode implements IGPRouterID, BGPValueType { 31 +public class IsIsPseudonode implements IGPRouterID, BgpValueType {
32 private static final Logger log = LoggerFactory.getLogger(IsIsPseudonode.class); 32 private static final Logger log = LoggerFactory.getLogger(IsIsPseudonode.class);
33 33
34 public static final short TYPE = 515; 34 public static final short TYPE = 515;
......
...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects; ...@@ -26,7 +26,7 @@ import com.google.common.base.MoreObjects;
26 /** 26 /**
27 * Provides Implementation of Link Local/Remote IdentifiersTlv. 27 * Provides Implementation of Link Local/Remote IdentifiersTlv.
28 */ 28 */
29 -public class LinkLocalRemoteIdentifiersTlv implements BGPValueType { 29 +public class LinkLocalRemoteIdentifiersTlv implements BgpValueType {
30 private static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersTlv.class); 30 private static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersTlv.class);
31 public static final short TYPE = 258; 31 public static final short TYPE = 258;
32 private static final int LENGTH = 8; 32 private static final int LENGTH = 8;
......
...@@ -19,7 +19,7 @@ import java.util.LinkedList; ...@@ -19,7 +19,7 @@ import java.util.LinkedList;
19 import java.util.List; 19 import java.util.List;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 -import org.onosproject.bgpio.exceptions.BGPParseException; 22 +import org.onosproject.bgpio.exceptions.BgpParseException;
23 import org.onosproject.bgpio.types.attr.BgpAttrNodeFlagBitTlv; 23 import org.onosproject.bgpio.types.attr.BgpAttrNodeFlagBitTlv;
24 import org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId; 24 import org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId;
25 import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId; 25 import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId;
...@@ -52,7 +52,7 @@ import com.google.common.base.MoreObjects; ...@@ -52,7 +52,7 @@ import com.google.common.base.MoreObjects;
52 /** 52 /**
53 * Implements BGP Link state attribute. 53 * Implements BGP Link state attribute.
54 */ 54 */
55 -public class LinkStateAttributes implements BGPValueType { 55 +public class LinkStateAttributes implements BgpValueType {
56 56
57 protected static final Logger log = LoggerFactory 57 protected static final Logger log = LoggerFactory
58 .getLogger(LinkStateAttributes.class); 58 .getLogger(LinkStateAttributes.class);
...@@ -92,7 +92,7 @@ public class LinkStateAttributes implements BGPValueType { ...@@ -92,7 +92,7 @@ public class LinkStateAttributes implements BGPValueType {
92 public static final byte LINKSTATE_ATTRIB_TYPE = 50; 92 public static final byte LINKSTATE_ATTRIB_TYPE = 50;
93 public static final byte TYPE_AND_LEN = 4; 93 public static final byte TYPE_AND_LEN = 4;
94 private boolean isLinkStateAttribute = false; 94 private boolean isLinkStateAttribute = false;
95 - private List<BGPValueType> linkStateAttribList; 95 + private List<BgpValueType> linkStateAttribList;
96 96
97 /** 97 /**
98 * Constructor to reset parameters. 98 * Constructor to reset parameters.
...@@ -106,7 +106,7 @@ public class LinkStateAttributes implements BGPValueType { ...@@ -106,7 +106,7 @@ public class LinkStateAttributes implements BGPValueType {
106 * 106 *
107 * @param linkStateAttribList Linked list of Link, Node and Prefix TLVs 107 * @param linkStateAttribList Linked list of Link, Node and Prefix TLVs
108 */ 108 */
109 - LinkStateAttributes(List<BGPValueType> linkStateAttribList) { 109 + LinkStateAttributes(List<BgpValueType> linkStateAttribList) {
110 this.linkStateAttribList = linkStateAttribList; 110 this.linkStateAttribList = linkStateAttribList;
111 this.isLinkStateAttribute = true; 111 this.isLinkStateAttribute = true;
112 } 112 }
...@@ -116,7 +116,7 @@ public class LinkStateAttributes implements BGPValueType { ...@@ -116,7 +116,7 @@ public class LinkStateAttributes implements BGPValueType {
116 * 116 *
117 * @return linked list of Link, Node and Prefix TLVs 117 * @return linked list of Link, Node and Prefix TLVs
118 */ 118 */
119 - public List<BGPValueType> linkStateAttributes() { 119 + public List<BgpValueType> linkStateAttributes() {
120 return this.linkStateAttribList; 120 return this.linkStateAttribList;
121 } 121 }
122 122
...@@ -134,10 +134,10 @@ public class LinkStateAttributes implements BGPValueType { ...@@ -134,10 +134,10 @@ public class LinkStateAttributes implements BGPValueType {
134 * 134 *
135 * @param cb ChannelBuffer 135 * @param cb ChannelBuffer
136 * @return constructor of LinkStateAttributes 136 * @return constructor of LinkStateAttributes
137 - * @throws BGPParseException while parsing link state attributes 137 + * @throws BgpParseException while parsing link state attributes
138 */ 138 */
139 public static LinkStateAttributes read(ChannelBuffer cb) 139 public static LinkStateAttributes read(ChannelBuffer cb)
140 - throws BGPParseException { 140 + throws BgpParseException {
141 141
142 ChannelBuffer tempBuf = cb; 142 ChannelBuffer tempBuf = cb;
143 Validation parseFlags = Validation.parseAttributeHeader(cb); 143 Validation parseFlags = Validation.parseAttributeHeader(cb);
...@@ -147,20 +147,20 @@ public class LinkStateAttributes implements BGPValueType { ...@@ -147,20 +147,20 @@ public class LinkStateAttributes implements BGPValueType {
147 ChannelBuffer data = tempBuf.readBytes(len); 147 ChannelBuffer data = tempBuf.readBytes(len);
148 if (!parseFlags.getFirstBit() || parseFlags.getSecondBit() 148 if (!parseFlags.getFirstBit() || parseFlags.getSecondBit()
149 || parseFlags.getThirdBit()) { 149 || parseFlags.getThirdBit()) {
150 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 150 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
151 - BGPErrorType.ATTRIBUTE_FLAGS_ERROR, 151 + BgpErrorType.ATTRIBUTE_FLAGS_ERROR,
152 data); 152 data);
153 } 153 }
154 154
155 if (cb.readableBytes() < parseFlags.getLength()) { 155 if (cb.readableBytes() < parseFlags.getLength()) {
156 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 156 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
157 - BGPErrorType.BAD_MESSAGE_LENGTH, 157 + BgpErrorType.BAD_MESSAGE_LENGTH,
158 parseFlags.getLength()); 158 parseFlags.getLength());
159 } 159 }
160 160
161 - BGPValueType bgpLSAttrib = null; 161 + BgpValueType bgpLSAttrib = null;
162 - LinkedList<BGPValueType> linkStateAttribList; 162 + LinkedList<BgpValueType> linkStateAttribList;
163 - linkStateAttribList = new LinkedList<BGPValueType>(); 163 + linkStateAttribList = new LinkedList<BgpValueType>();
164 ChannelBuffer tempCb = cb.readBytes(parseFlags.getLength()); 164 ChannelBuffer tempCb = cb.readBytes(parseFlags.getLength());
165 while (tempCb.readableBytes() > 0) { 165 while (tempCb.readableBytes() > 0) {
166 short tlvCodePoint = tempCb.readShort(); 166 short tlvCodePoint = tempCb.readShort();
...@@ -279,8 +279,8 @@ public class LinkStateAttributes implements BGPValueType { ...@@ -279,8 +279,8 @@ public class LinkStateAttributes implements BGPValueType {
279 break; 279 break;
280 280
281 default: 281 default:
282 - throw new BGPParseException( 282 + throw new BgpParseException(
283 - "The BGP-LS Attribute is not supported : " 283 + "The Bgp-LS Attribute is not supported : "
284 + tlvCodePoint); 284 + tlvCodePoint);
285 } 285 }
286 286
......
...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types; ...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 import org.onosproject.bgpio.util.Constants; 22 import org.onosproject.bgpio.util.Constants;
23 import org.onosproject.bgpio.util.Validation; 23 import org.onosproject.bgpio.util.Validation;
24 24
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides implementation of LocalPref BGP Path Attribute. 28 * Provides implementation of LocalPref BGP Path Attribute.
29 */ 29 */
30 -public class LocalPref implements BGPValueType { 30 +public class LocalPref implements BgpValueType {
31 public static final byte LOCAL_PREF_TYPE = 5; 31 public static final byte LOCAL_PREF_TYPE = 5;
32 public static final byte LOCAL_PREF_MAX_LEN = 4; 32 public static final byte LOCAL_PREF_MAX_LEN = 4;
33 33
...@@ -56,14 +56,14 @@ public class LocalPref implements BGPValueType { ...@@ -56,14 +56,14 @@ public class LocalPref implements BGPValueType {
56 * 56 *
57 * @param cb channelBuffer 57 * @param cb channelBuffer
58 * @return object of LocalPref 58 * @return object of LocalPref
59 - * @throws BGPParseException while parsing localPref attribute 59 + * @throws BgpParseException while parsing localPref attribute
60 */ 60 */
61 - public static LocalPref read(ChannelBuffer cb) throws BGPParseException { 61 + public static LocalPref read(ChannelBuffer cb) throws BgpParseException {
62 int localPref; 62 int localPref;
63 ChannelBuffer tempCb = cb.copy(); 63 ChannelBuffer tempCb = cb.copy();
64 Validation parseFlags = Validation.parseAttributeHeader(cb); 64 Validation parseFlags = Validation.parseAttributeHeader(cb);
65 if ((parseFlags.getLength() > LOCAL_PREF_MAX_LEN) || cb.readableBytes() < parseFlags.getLength()) { 65 if ((parseFlags.getLength() > LOCAL_PREF_MAX_LEN) || cb.readableBytes() < parseFlags.getLength()) {
66 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 66 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
67 parseFlags.getLength()); 67 parseFlags.getLength());
68 } 68 }
69 69
...@@ -71,7 +71,7 @@ public class LocalPref implements BGPValueType { ...@@ -71,7 +71,7 @@ public class LocalPref implements BGPValueType {
71 Constants.TYPE_AND_LEN_AS_SHORT : parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_BYTE; 71 Constants.TYPE_AND_LEN_AS_SHORT : parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_BYTE;
72 ChannelBuffer data = tempCb.readBytes(len); 72 ChannelBuffer data = tempCb.readBytes(len);
73 if (parseFlags.getFirstBit()) { 73 if (parseFlags.getFirstBit()) {
74 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 74 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
75 } 75 }
76 76
77 localPref = cb.readInt(); 77 localPref = cb.readInt();
......
...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types; ...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 import org.onosproject.bgpio.util.Constants; 22 import org.onosproject.bgpio.util.Constants;
23 import org.onosproject.bgpio.util.Validation; 23 import org.onosproject.bgpio.util.Validation;
24 24
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Implementation of Med BGP Path Attribute. 28 * Provides Implementation of Med BGP Path Attribute.
29 */ 29 */
30 -public class Med implements BGPValueType { 30 +public class Med implements BgpValueType {
31 public static final byte MED_TYPE = 4; 31 public static final byte MED_TYPE = 4;
32 public static final byte MED_MAX_LEN = 4; 32 public static final byte MED_MAX_LEN = 4;
33 33
...@@ -56,22 +56,22 @@ public class Med implements BGPValueType { ...@@ -56,22 +56,22 @@ public class Med implements BGPValueType {
56 * 56 *
57 * @param cb ChannelBuffer 57 * @param cb ChannelBuffer
58 * @return object of Med 58 * @return object of Med
59 - * @throws BGPParseException while parsing Med path attribute 59 + * @throws BgpParseException while parsing Med path attribute
60 */ 60 */
61 - public static Med read(ChannelBuffer cb) throws BGPParseException { 61 + public static Med read(ChannelBuffer cb) throws BgpParseException {
62 int med; 62 int med;
63 ChannelBuffer tempCb = cb.copy(); 63 ChannelBuffer tempCb = cb.copy();
64 Validation parseFlags = Validation.parseAttributeHeader(cb); 64 Validation parseFlags = Validation.parseAttributeHeader(cb);
65 65
66 if ((parseFlags.getLength() > MED_MAX_LEN) || cb.readableBytes() < parseFlags.getLength()) { 66 if ((parseFlags.getLength() > MED_MAX_LEN) || cb.readableBytes() < parseFlags.getLength()) {
67 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 67 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
68 parseFlags.getLength()); 68 parseFlags.getLength());
69 } 69 }
70 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT : parseFlags 70 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT : parseFlags
71 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE; 71 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE;
72 ChannelBuffer data = tempCb.readBytes(len); 72 ChannelBuffer data = tempCb.readBytes(len);
73 if (!parseFlags.getFirstBit() && parseFlags.getSecondBit() && parseFlags.getThirdBit()) { 73 if (!parseFlags.getFirstBit() && parseFlags.getSecondBit() && parseFlags.getThirdBit()) {
74 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 74 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
75 } 75 }
76 76
77 med = cb.readInt(); 77 med = cb.readInt();
......
...@@ -22,10 +22,10 @@ import java.util.List; ...@@ -22,10 +22,10 @@ import java.util.List;
22 22
23 import org.jboss.netty.buffer.ChannelBuffer; 23 import org.jboss.netty.buffer.ChannelBuffer;
24 import org.onlab.packet.Ip4Address; 24 import org.onlab.packet.Ip4Address;
25 -import org.onosproject.bgpio.exceptions.BGPParseException; 25 +import org.onosproject.bgpio.exceptions.BgpParseException;
26 -import org.onosproject.bgpio.protocol.BGPLSNlri; 26 +import org.onosproject.bgpio.protocol.BgpLSNlri;
27 -import org.onosproject.bgpio.protocol.linkstate.BGPPrefixIPv4LSNlriVer4; 27 +import org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4;
28 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 28 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
29 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 29 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
30 import org.onosproject.bgpio.util.Constants; 30 import org.onosproject.bgpio.util.Constants;
31 import org.onosproject.bgpio.util.Validation; 31 import org.onosproject.bgpio.util.Validation;
...@@ -37,14 +37,14 @@ import com.google.common.base.MoreObjects; ...@@ -37,14 +37,14 @@ import com.google.common.base.MoreObjects;
37 /* 37 /*
38 * Provides Implementation of MpReach Nlri BGP Path Attribute. 38 * Provides Implementation of MpReach Nlri BGP Path Attribute.
39 */ 39 */
40 -public class MpReachNlri implements BGPValueType { 40 +public class MpReachNlri implements BgpValueType {
41 41
42 private static final Logger log = LoggerFactory.getLogger(MpReachNlri.class); 42 private static final Logger log = LoggerFactory.getLogger(MpReachNlri.class);
43 public static final byte MPREACHNLRI_TYPE = 14; 43 public static final byte MPREACHNLRI_TYPE = 14;
44 public static final byte LINK_NLRITYPE = 2; 44 public static final byte LINK_NLRITYPE = 2;
45 45
46 private boolean isMpReachNlri = false; 46 private boolean isMpReachNlri = false;
47 - private final List<BGPLSNlri> mpReachNlri; 47 + private final List<BgpLSNlri> mpReachNlri;
48 private final int length; 48 private final int length;
49 private final short afi; 49 private final short afi;
50 private final byte safi; 50 private final byte safi;
...@@ -59,7 +59,7 @@ public class MpReachNlri implements BGPValueType { ...@@ -59,7 +59,7 @@ public class MpReachNlri implements BGPValueType {
59 * @param ipNextHop nexthop IpAddress 59 * @param ipNextHop nexthop IpAddress
60 * @param length of MpReachNlri 60 * @param length of MpReachNlri
61 */ 61 */
62 - public MpReachNlri(List<BGPLSNlri> mpReachNlri, short afi, byte safi, Ip4Address ipNextHop, int length) { 62 + public MpReachNlri(List<BgpLSNlri> mpReachNlri, short afi, byte safi, Ip4Address ipNextHop, int length) {
63 this.mpReachNlri = mpReachNlri; 63 this.mpReachNlri = mpReachNlri;
64 this.isMpReachNlri = true; 64 this.isMpReachNlri = true;
65 this.ipNextHop = ipNextHop; 65 this.ipNextHop = ipNextHop;
...@@ -82,7 +82,7 @@ public class MpReachNlri implements BGPValueType { ...@@ -82,7 +82,7 @@ public class MpReachNlri implements BGPValueType {
82 * 82 *
83 * @return list of MpReach Nlri 83 * @return list of MpReach Nlri
84 */ 84 */
85 - public List<BGPLSNlri> mpReachNlri() { 85 + public List<BgpLSNlri> mpReachNlri() {
86 return this.mpReachNlri; 86 return this.mpReachNlri;
87 } 87 }
88 88
...@@ -100,9 +100,9 @@ public class MpReachNlri implements BGPValueType { ...@@ -100,9 +100,9 @@ public class MpReachNlri implements BGPValueType {
100 * 100 *
101 * @param cb channelBuffer 101 * @param cb channelBuffer
102 * @return object of MpReachNlri 102 * @return object of MpReachNlri
103 - * @throws BGPParseException while parsing MpReachNlri 103 + * @throws BgpParseException while parsing MpReachNlri
104 */ 104 */
105 - public static MpReachNlri read(ChannelBuffer cb) throws BGPParseException { 105 + public static MpReachNlri read(ChannelBuffer cb) throws BgpParseException {
106 ChannelBuffer tempBuf = cb.copy(); 106 ChannelBuffer tempBuf = cb.copy();
107 Validation parseFlags = Validation.parseAttributeHeader(cb); 107 Validation parseFlags = Validation.parseAttributeHeader(cb);
108 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT : 108 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT :
...@@ -110,15 +110,15 @@ public class MpReachNlri implements BGPValueType { ...@@ -110,15 +110,15 @@ public class MpReachNlri implements BGPValueType {
110 ChannelBuffer data = tempBuf.readBytes(len); 110 ChannelBuffer data = tempBuf.readBytes(len);
111 111
112 if (cb.readableBytes() < parseFlags.getLength()) { 112 if (cb.readableBytes() < parseFlags.getLength()) {
113 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 113 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
114 parseFlags.getLength()); 114 parseFlags.getLength());
115 } 115 }
116 if (!parseFlags.getFirstBit() && parseFlags.getSecondBit() && parseFlags.getThirdBit()) { 116 if (!parseFlags.getFirstBit() && parseFlags.getSecondBit() && parseFlags.getThirdBit()) {
117 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 117 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
118 } 118 }
119 119
120 - BGPLSNlri bgpLSNlri = null; 120 + BgpLSNlri bgpLSNlri = null;
121 - List<BGPLSNlri> mpReachNlri = new LinkedList<>(); 121 + List<BgpLSNlri> mpReachNlri = new LinkedList<>();
122 ChannelBuffer tempCb = cb.readBytes(parseFlags.getLength()); 122 ChannelBuffer tempCb = cb.readBytes(parseFlags.getLength());
123 short afi = 0; 123 short afi = 0;
124 byte safi = 0; 124 byte safi = 0;
...@@ -133,7 +133,7 @@ public class MpReachNlri implements BGPValueType { ...@@ -133,7 +133,7 @@ public class MpReachNlri implements BGPValueType {
133 byte nextHopLen = tempCb.readByte(); 133 byte nextHopLen = tempCb.readByte();
134 InetAddress ipAddress = Validation.toInetAddress(nextHopLen, cb); 134 InetAddress ipAddress = Validation.toInetAddress(nextHopLen, cb);
135 if (ipAddress.isMulticastAddress()) { 135 if (ipAddress.isMulticastAddress()) {
136 - throw new BGPParseException("Multicast not supported"); 136 + throw new BgpParseException("Multicast not supported");
137 } 137 }
138 ipNextHop = Ip4Address.valueOf(ipAddress); 138 ipNextHop = Ip4Address.valueOf(ipAddress);
139 byte reserved = tempCb.readByte(); 139 byte reserved = tempCb.readByte();
...@@ -142,19 +142,19 @@ public class MpReachNlri implements BGPValueType { ...@@ -142,19 +142,19 @@ public class MpReachNlri implements BGPValueType {
142 short nlriType = tempCb.readShort(); 142 short nlriType = tempCb.readShort();
143 short totNlriLen = tempCb.readShort(); 143 short totNlriLen = tempCb.readShort();
144 if (tempCb.readableBytes() < totNlriLen) { 144 if (tempCb.readableBytes() < totNlriLen) {
145 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 145 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
146 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, totNlriLen); 146 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR, totNlriLen);
147 } 147 }
148 tempBuf = tempCb.readBytes(totNlriLen); 148 tempBuf = tempCb.readBytes(totNlriLen);
149 switch (nlriType) { 149 switch (nlriType) {
150 - case BGPNodeLSNlriVer4.NODE_NLRITYPE: 150 + case BgpNodeLSNlriVer4.NODE_NLRITYPE:
151 - bgpLSNlri = BGPNodeLSNlriVer4.read(tempBuf, afi, safi); 151 + bgpLSNlri = BgpNodeLSNlriVer4.read(tempBuf, afi, safi);
152 break; 152 break;
153 case BgpLinkLsNlriVer4.LINK_NLRITYPE: 153 case BgpLinkLsNlriVer4.LINK_NLRITYPE:
154 bgpLSNlri = BgpLinkLsNlriVer4.read(tempBuf, afi, safi); 154 bgpLSNlri = BgpLinkLsNlriVer4.read(tempBuf, afi, safi);
155 break; 155 break;
156 - case BGPPrefixIPv4LSNlriVer4.PREFIX_IPV4_NLRITYPE: 156 + case BgpPrefixIPv4LSNlriVer4.PREFIX_IPV4_NLRITYPE:
157 - bgpLSNlri = BGPPrefixIPv4LSNlriVer4.read(tempBuf, afi, safi); 157 + bgpLSNlri = BgpPrefixIPv4LSNlriVer4.read(tempBuf, afi, safi);
158 break; 158 break;
159 default: 159 default:
160 log.debug("nlriType not supported" + nlriType); 160 log.debug("nlriType not supported" + nlriType);
...@@ -162,7 +162,7 @@ public class MpReachNlri implements BGPValueType { ...@@ -162,7 +162,7 @@ public class MpReachNlri implements BGPValueType {
162 mpReachNlri.add(bgpLSNlri); 162 mpReachNlri.add(bgpLSNlri);
163 } 163 }
164 } else { 164 } else {
165 - throw new BGPParseException("Not Supporting afi " + afi + "safi " + safi); 165 + throw new BgpParseException("Not Supporting afi " + afi + "safi " + safi);
166 } 166 }
167 } 167 }
168 return new MpReachNlri(mpReachNlri, afi, safi, ipNextHop, parseFlags.getLength()); 168 return new MpReachNlri(mpReachNlri, afi, safi, ipNextHop, parseFlags.getLength());
......
...@@ -20,10 +20,10 @@ import java.util.LinkedList; ...@@ -20,10 +20,10 @@ import java.util.LinkedList;
20 import java.util.List; 20 import java.util.List;
21 21
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.protocol.BGPLSNlri; 24 +import org.onosproject.bgpio.protocol.BgpLSNlri;
25 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 25 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
26 -import org.onosproject.bgpio.protocol.linkstate.BGPPrefixIPv4LSNlriVer4; 26 +import org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4;
27 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 27 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
28 import org.onosproject.bgpio.util.Constants; 28 import org.onosproject.bgpio.util.Constants;
29 import org.onosproject.bgpio.util.Validation; 29 import org.onosproject.bgpio.util.Validation;
...@@ -35,7 +35,7 @@ import com.google.common.base.MoreObjects; ...@@ -35,7 +35,7 @@ import com.google.common.base.MoreObjects;
35 /** 35 /**
36 * Provides Implementation of MpUnReach Nlri BGP Path Attribute. 36 * Provides Implementation of MpUnReach Nlri BGP Path Attribute.
37 */ 37 */
38 -public class MpUnReachNlri implements BGPValueType { 38 +public class MpUnReachNlri implements BgpValueType {
39 39
40 private static final Logger log = LoggerFactory.getLogger(MpUnReachNlri.class); 40 private static final Logger log = LoggerFactory.getLogger(MpUnReachNlri.class);
41 public static final byte MPUNREACHNLRI_TYPE = 15; 41 public static final byte MPUNREACHNLRI_TYPE = 15;
...@@ -44,7 +44,7 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -44,7 +44,7 @@ public class MpUnReachNlri implements BGPValueType {
44 private boolean isMpUnReachNlri = false; 44 private boolean isMpUnReachNlri = false;
45 private final short afi; 45 private final short afi;
46 private final byte safi; 46 private final byte safi;
47 - private final List<BGPLSNlri> mpUnReachNlri; 47 + private final List<BgpLSNlri> mpUnReachNlri;
48 private final int length; 48 private final int length;
49 49
50 /** 50 /**
...@@ -55,7 +55,7 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -55,7 +55,7 @@ public class MpUnReachNlri implements BGPValueType {
55 * @param safi subsequent address family identifier 55 * @param safi subsequent address family identifier
56 * @param length of MpUnReachNlri 56 * @param length of MpUnReachNlri
57 */ 57 */
58 - public MpUnReachNlri(List<BGPLSNlri> mpUnReachNlri, short afi, byte safi, 58 + public MpUnReachNlri(List<BgpLSNlri> mpUnReachNlri, short afi, byte safi,
59 int length) { 59 int length) {
60 this.mpUnReachNlri = mpUnReachNlri; 60 this.mpUnReachNlri = mpUnReachNlri;
61 this.isMpUnReachNlri = true; 61 this.isMpUnReachNlri = true;
...@@ -69,9 +69,9 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -69,9 +69,9 @@ public class MpUnReachNlri implements BGPValueType {
69 * 69 *
70 * @param cb ChannelBuffer 70 * @param cb ChannelBuffer
71 * @return object of MpUnReachNlri 71 * @return object of MpUnReachNlri
72 - * @throws BGPParseException while parsing MpUnReachNlri 72 + * @throws BgpParseException while parsing MpUnReachNlri
73 */ 73 */
74 - public static MpUnReachNlri read(ChannelBuffer cb) throws BGPParseException { 74 + public static MpUnReachNlri read(ChannelBuffer cb) throws BgpParseException {
75 ChannelBuffer tempBuf = cb.copy(); 75 ChannelBuffer tempBuf = cb.copy();
76 Validation parseFlags = Validation.parseAttributeHeader(cb); 76 Validation parseFlags = Validation.parseAttributeHeader(cb);
77 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT 77 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT
...@@ -80,17 +80,17 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -80,17 +80,17 @@ public class MpUnReachNlri implements BGPValueType {
80 80
81 if (!parseFlags.getFirstBit() && parseFlags.getSecondBit() 81 if (!parseFlags.getFirstBit() && parseFlags.getSecondBit()
82 && parseFlags.getThirdBit()) { 82 && parseFlags.getThirdBit()) {
83 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, 83 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
84 - BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 84 + BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
85 } 85 }
86 86
87 if (cb.readableBytes() < parseFlags.getLength()) { 87 if (cb.readableBytes() < parseFlags.getLength()) {
88 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 88 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
89 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, parseFlags.getLength()); 89 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR, parseFlags.getLength());
90 } 90 }
91 91
92 - LinkedList<BGPLSNlri> mpUnReachNlri = new LinkedList<>(); 92 + LinkedList<BgpLSNlri> mpUnReachNlri = new LinkedList<>();
93 - BGPLSNlri bgpLSNlri = null; 93 + BgpLSNlri bgpLSNlri = null;
94 short afi = 0; 94 short afi = 0;
95 byte safi = 0; 95 byte safi = 0;
96 ChannelBuffer tempCb = cb.readBytes(parseFlags.getLength()); 96 ChannelBuffer tempCb = cb.readBytes(parseFlags.getLength());
...@@ -106,19 +106,19 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -106,19 +106,19 @@ public class MpUnReachNlri implements BGPValueType {
106 short totNlriLen = tempCb.readShort(); 106 short totNlriLen = tempCb.readShort();
107 if (tempCb.readableBytes() < totNlriLen) { 107 if (tempCb.readableBytes() < totNlriLen) {
108 Validation.validateLen( 108 Validation.validateLen(
109 - BGPErrorType.UPDATE_MESSAGE_ERROR, 109 + BgpErrorType.UPDATE_MESSAGE_ERROR,
110 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, totNlriLen); 110 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR, totNlriLen);
111 } 111 }
112 tempBuf = tempCb.readBytes(totNlriLen); 112 tempBuf = tempCb.readBytes(totNlriLen);
113 switch (nlriType) { 113 switch (nlriType) {
114 - case BGPNodeLSNlriVer4.NODE_NLRITYPE: 114 + case BgpNodeLSNlriVer4.NODE_NLRITYPE:
115 - bgpLSNlri = BGPNodeLSNlriVer4.read(tempBuf, afi, safi); 115 + bgpLSNlri = BgpNodeLSNlriVer4.read(tempBuf, afi, safi);
116 break; 116 break;
117 case BgpLinkLsNlriVer4.LINK_NLRITYPE: 117 case BgpLinkLsNlriVer4.LINK_NLRITYPE:
118 bgpLSNlri = BgpLinkLsNlriVer4.read(tempBuf, afi, safi); 118 bgpLSNlri = BgpLinkLsNlriVer4.read(tempBuf, afi, safi);
119 break; 119 break;
120 - case BGPPrefixIPv4LSNlriVer4.PREFIX_IPV4_NLRITYPE: 120 + case BgpPrefixIPv4LSNlriVer4.PREFIX_IPV4_NLRITYPE:
121 - bgpLSNlri = BGPPrefixIPv4LSNlriVer4.read(tempBuf, afi, 121 + bgpLSNlri = BgpPrefixIPv4LSNlriVer4.read(tempBuf, afi,
122 safi); 122 safi);
123 break; 123 break;
124 default: 124 default:
...@@ -128,7 +128,7 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -128,7 +128,7 @@ public class MpUnReachNlri implements BGPValueType {
128 } 128 }
129 } else { 129 } else {
130 //TODO: check with the values got from capability 130 //TODO: check with the values got from capability
131 - throw new BGPParseException("Not Supporting afi " + afi 131 + throw new BgpParseException("Not Supporting afi " + afi
132 + "safi " + safi); 132 + "safi " + safi);
133 } 133 }
134 } 134 }
...@@ -164,7 +164,7 @@ public class MpUnReachNlri implements BGPValueType { ...@@ -164,7 +164,7 @@ public class MpUnReachNlri implements BGPValueType {
164 * 164 *
165 * @return list of MpUnReach Nlri 165 * @return list of MpUnReach Nlri
166 */ 166 */
167 - public List<BGPLSNlri> mpUnReachNlri() { 167 + public List<BgpLSNlri> mpUnReachNlri() {
168 return this.mpUnReachNlri; 168 return this.mpUnReachNlri;
169 } 169 }
170 170
......
...@@ -25,7 +25,7 @@ import com.google.common.base.MoreObjects; ...@@ -25,7 +25,7 @@ import com.google.common.base.MoreObjects;
25 /** 25 /**
26 * Provides MultiProtocolExtnCapabilityTlv. 26 * Provides MultiProtocolExtnCapabilityTlv.
27 */ 27 */
28 -public class MultiProtocolExtnCapabilityTlv implements BGPValueType { 28 +public class MultiProtocolExtnCapabilityTlv implements BgpValueType {
29 29
30 /* 30 /*
31 0 7 15 23 31 31 0 7 15 23 31
...@@ -141,7 +141,7 @@ public class MultiProtocolExtnCapabilityTlv implements BGPValueType { ...@@ -141,7 +141,7 @@ public class MultiProtocolExtnCapabilityTlv implements BGPValueType {
141 * @param cb of type channel buffer 141 * @param cb of type channel buffer
142 * @return object of MultiProtocolExtnCapabilityTlv 142 * @return object of MultiProtocolExtnCapabilityTlv
143 */ 143 */
144 - public static BGPValueType read(ChannelBuffer cb) { 144 + public static BgpValueType read(ChannelBuffer cb) {
145 short afi = cb.readShort(); 145 short afi = cb.readShort();
146 byte res = cb.readByte(); 146 byte res = cb.readByte();
147 byte safi = cb.readByte(); 147 byte safi = cb.readByte();
......
...@@ -20,7 +20,7 @@ import java.util.Objects; ...@@ -20,7 +20,7 @@ import java.util.Objects;
20 20
21 import org.jboss.netty.buffer.ChannelBuffer; 21 import org.jboss.netty.buffer.ChannelBuffer;
22 import org.onlab.packet.Ip4Address; 22 import org.onlab.packet.Ip4Address;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 import org.onosproject.bgpio.util.Constants; 24 import org.onosproject.bgpio.util.Constants;
25 import org.onosproject.bgpio.util.Validation; 25 import org.onosproject.bgpio.util.Validation;
26 26
...@@ -30,7 +30,7 @@ import com.google.common.base.Preconditions; ...@@ -30,7 +30,7 @@ import com.google.common.base.Preconditions;
30 /** 30 /**
31 * Implementation of NextHop BGP Path Attribute. 31 * Implementation of NextHop BGP Path Attribute.
32 */ 32 */
33 -public class NextHop implements BGPValueType { 33 +public class NextHop implements BgpValueType {
34 public static final byte NEXTHOP_TYPE = 3; 34 public static final byte NEXTHOP_TYPE = 3;
35 35
36 private boolean isNextHop = false; 36 private boolean isNextHop = false;
...@@ -60,27 +60,27 @@ public class NextHop implements BGPValueType { ...@@ -60,27 +60,27 @@ public class NextHop implements BGPValueType {
60 * 60 *
61 * @param cb ChannelBuffer 61 * @param cb ChannelBuffer
62 * @return object of NextHop 62 * @return object of NextHop
63 - * @throws BGPParseException while parsing nexthop attribute 63 + * @throws BgpParseException while parsing nexthop attribute
64 */ 64 */
65 - public static NextHop read(ChannelBuffer cb) throws BGPParseException { 65 + public static NextHop read(ChannelBuffer cb) throws BgpParseException {
66 Ip4Address nextHop; 66 Ip4Address nextHop;
67 ChannelBuffer tempCb = cb.copy(); 67 ChannelBuffer tempCb = cb.copy();
68 Validation parseFlags = Validation.parseAttributeHeader(cb); 68 Validation parseFlags = Validation.parseAttributeHeader(cb);
69 69
70 if (cb.readableBytes() < parseFlags.getLength()) { 70 if (cb.readableBytes() < parseFlags.getLength()) {
71 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 71 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
72 parseFlags.getLength()); 72 parseFlags.getLength());
73 } 73 }
74 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT : parseFlags 74 int len = parseFlags.isShort() ? parseFlags.getLength() + Constants.TYPE_AND_LEN_AS_SHORT : parseFlags
75 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE; 75 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE;
76 ChannelBuffer data = tempCb.readBytes(len); 76 ChannelBuffer data = tempCb.readBytes(len);
77 if (parseFlags.getFirstBit() && !parseFlags.getSecondBit() && parseFlags.getThirdBit()) { 77 if (parseFlags.getFirstBit() && !parseFlags.getSecondBit() && parseFlags.getThirdBit()) {
78 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 78 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
79 } 79 }
80 80
81 InetAddress ipAddress = Validation.toInetAddress(parseFlags.getLength(), cb); 81 InetAddress ipAddress = Validation.toInetAddress(parseFlags.getLength(), cb);
82 if (ipAddress.isMulticastAddress()) { 82 if (ipAddress.isMulticastAddress()) {
83 - throw new BGPParseException("Multicast address is not supported"); 83 + throw new BgpParseException("Multicast address is not supported");
84 } 84 }
85 85
86 nextHop = Ip4Address.valueOf(ipAddress); 86 nextHop = Ip4Address.valueOf(ipAddress);
......
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects;
28 /** 28 /**
29 * Provides implementation of OSPFNonPseudonode Tlv. 29 * Provides implementation of OSPFNonPseudonode Tlv.
30 */ 30 */
31 -public class OSPFNonPseudonode implements IGPRouterID, BGPValueType { 31 +public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
32 32
33 protected static final Logger log = LoggerFactory.getLogger(OSPFNonPseudonode.class); 33 protected static final Logger log = LoggerFactory.getLogger(OSPFNonPseudonode.class);
34 34
......
...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects; ...@@ -28,7 +28,7 @@ import com.google.common.base.MoreObjects;
28 /** 28 /**
29 * Provides implementation of OSPFPseudonode Tlv. 29 * Provides implementation of OSPFPseudonode Tlv.
30 */ 30 */
31 -public class OSPFPseudonode implements IGPRouterID, BGPValueType { 31 +public class OSPFPseudonode implements IGPRouterID, BgpValueType {
32 32
33 protected static final Logger log = LoggerFactory.getLogger(OSPFPseudonode.class); 33 protected static final Logger log = LoggerFactory.getLogger(OSPFPseudonode.class);
34 34
......
...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types; ...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 import org.slf4j.Logger; 22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory; 23 import org.slf4j.LoggerFactory;
24 24
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides OSPF Route Type Tlv which contains route type. 28 * Provides OSPF Route Type Tlv which contains route type.
29 */ 29 */
30 -public class OSPFRouteTypeTlv implements BGPValueType { 30 +public class OSPFRouteTypeTlv implements BgpValueType {
31 31
32 /* Reference :draft-ietf-idr-ls-distribution-11 32 /* Reference :draft-ietf-idr-ls-distribution-11
33 0 1 2 3 33 0 1 2 3
...@@ -90,9 +90,9 @@ public class OSPFRouteTypeTlv implements BGPValueType { ...@@ -90,9 +90,9 @@ public class OSPFRouteTypeTlv implements BGPValueType {
90 * Returns RouteType. 90 * Returns RouteType.
91 * 91 *
92 * @return RouteType 92 * @return RouteType
93 - * @throws BGPParseException if routeType is not matched 93 + * @throws BgpParseException if routeType is not matched
94 */ 94 */
95 - public ROUTETYPE getValue() throws BGPParseException { 95 + public ROUTETYPE getValue() throws BgpParseException {
96 switch (routeType) { 96 switch (routeType) {
97 case INTRA_AREA_TYPE: 97 case INTRA_AREA_TYPE:
98 return ROUTETYPE.Intra_Area; 98 return ROUTETYPE.Intra_Area;
...@@ -107,7 +107,7 @@ public class OSPFRouteTypeTlv implements BGPValueType { ...@@ -107,7 +107,7 @@ public class OSPFRouteTypeTlv implements BGPValueType {
107 case NSSA_TYPE_2: 107 case NSSA_TYPE_2:
108 return ROUTETYPE.NSSA_2; 108 return ROUTETYPE.NSSA_2;
109 default: 109 default:
110 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); 110 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
111 } 111 }
112 } 112 }
113 113
......
...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types; ...@@ -18,7 +18,7 @@ package org.onosproject.bgpio.types;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 import org.onosproject.bgpio.util.Constants; 22 import org.onosproject.bgpio.util.Constants;
23 import org.onosproject.bgpio.util.Validation; 23 import org.onosproject.bgpio.util.Validation;
24 24
...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects; ...@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
27 /** 27 /**
28 * Provides Implementation of mandatory BGP Origin path attribute. 28 * Provides Implementation of mandatory BGP Origin path attribute.
29 */ 29 */
30 -public class Origin implements BGPValueType { 30 +public class Origin implements BgpValueType {
31 31
32 /** 32 /**
33 * Enum to provide ORIGIN types. 33 * Enum to provide ORIGIN types.
...@@ -99,9 +99,9 @@ public class Origin implements BGPValueType { ...@@ -99,9 +99,9 @@ public class Origin implements BGPValueType {
99 * 99 *
100 * @param cb ChannelBuffer 100 * @param cb ChannelBuffer
101 * @return object of Origin 101 * @return object of Origin
102 - * @throws BGPParseException while parsing Origin path attribute 102 + * @throws BgpParseException while parsing Origin path attribute
103 */ 103 */
104 - public static Origin read(ChannelBuffer cb) throws BGPParseException { 104 + public static Origin read(ChannelBuffer cb) throws BgpParseException {
105 ChannelBuffer tempCb = cb.copy(); 105 ChannelBuffer tempCb = cb.copy();
106 Validation parseFlags = Validation.parseAttributeHeader(cb); 106 Validation parseFlags = Validation.parseAttributeHeader(cb);
107 107
...@@ -109,18 +109,18 @@ public class Origin implements BGPValueType { ...@@ -109,18 +109,18 @@ public class Origin implements BGPValueType {
109 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE; 109 .getLength() + Constants.TYPE_AND_LEN_AS_BYTE;
110 ChannelBuffer data = tempCb.readBytes(len); 110 ChannelBuffer data = tempCb.readBytes(len);
111 if ((parseFlags.getLength() > ORIGIN_VALUE_LEN) || (cb.readableBytes() < parseFlags.getLength())) { 111 if ((parseFlags.getLength() > ORIGIN_VALUE_LEN) || (cb.readableBytes() < parseFlags.getLength())) {
112 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 112 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
113 parseFlags.getLength()); 113 parseFlags.getLength());
114 } 114 }
115 if (parseFlags.getFirstBit() && !parseFlags.getSecondBit() && parseFlags.getThirdBit()) { 115 if (parseFlags.getFirstBit() && !parseFlags.getSecondBit() && parseFlags.getThirdBit()) {
116 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); 116 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data);
117 } 117 }
118 118
119 byte originValue; 119 byte originValue;
120 originValue = cb.readByte(); 120 originValue = cb.readByte();
121 if ((originValue != ORIGINTYPE.INCOMPLETE.value) && (originValue != ORIGINTYPE.IGP.value) && 121 if ((originValue != ORIGINTYPE.INCOMPLETE.value) && (originValue != ORIGINTYPE.IGP.value) &&
122 (originValue != ORIGINTYPE.EGP.value)) { 122 (originValue != ORIGINTYPE.EGP.value)) {
123 - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.INVALID_ORIGIN_ATTRIBUTE, data); 123 + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.INVALID_ORIGIN_ATTRIBUTE, data);
124 } 124 }
125 return new Origin(originValue); 125 return new Origin(originValue);
126 } 126 }
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP attribute node flag. 31 * Implements BGP attribute node flag.
32 */ 32 */
33 -public final class BgpAttrNodeFlagBitTlv implements BGPValueType { 33 +public final class BgpAttrNodeFlagBitTlv implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpAttrNodeFlagBitTlv.class); 36 .getLogger(BgpAttrNodeFlagBitTlv.class);
...@@ -86,10 +86,10 @@ public final class BgpAttrNodeFlagBitTlv implements BGPValueType { ...@@ -86,10 +86,10 @@ public final class BgpAttrNodeFlagBitTlv implements BGPValueType {
86 * 86 *
87 * @param cb ChannelBuffer 87 * @param cb ChannelBuffer
88 * @return attribute node flag bit tlv 88 * @return attribute node flag bit tlv
89 - * @throws BGPParseException while parsing BgpAttrNodeFlagBitTlv 89 + * @throws BgpParseException while parsing BgpAttrNodeFlagBitTlv
90 */ 90 */
91 public static BgpAttrNodeFlagBitTlv read(ChannelBuffer cb) 91 public static BgpAttrNodeFlagBitTlv read(ChannelBuffer cb)
92 - throws BGPParseException { 92 + throws BgpParseException {
93 boolean bOverloadBit = false; 93 boolean bOverloadBit = false;
94 boolean bAttachedBit = false; 94 boolean bAttachedBit = false;
95 boolean bExternalBit = false; 95 boolean bExternalBit = false;
...@@ -98,8 +98,8 @@ public final class BgpAttrNodeFlagBitTlv implements BGPValueType { ...@@ -98,8 +98,8 @@ public final class BgpAttrNodeFlagBitTlv implements BGPValueType {
98 short lsAttrLength = cb.readShort(); 98 short lsAttrLength = cb.readShort();
99 99
100 if ((lsAttrLength != 1) || (cb.readableBytes() < lsAttrLength)) { 100 if ((lsAttrLength != 1) || (cb.readableBytes() < lsAttrLength)) {
101 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 101 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
102 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 102 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
103 lsAttrLength); 103 lsAttrLength);
104 } 104 }
105 105
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Arrays; 18 import java.util.Arrays;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP attribute ISIS Area Identifier. 31 * Implements BGP attribute ISIS Area Identifier.
32 */ 32 */
33 -public class BgpAttrNodeIsIsAreaId implements BGPValueType { 33 +public class BgpAttrNodeIsIsAreaId implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpAttrNodeIsIsAreaId.class); 36 .getLogger(BgpAttrNodeIsIsAreaId.class);
...@@ -64,17 +64,17 @@ public class BgpAttrNodeIsIsAreaId implements BGPValueType { ...@@ -64,17 +64,17 @@ public class BgpAttrNodeIsIsAreaId implements BGPValueType {
64 * 64 *
65 * @param cb ChannelBuffer 65 * @param cb ChannelBuffer
66 * @return object of BgpAttrNodeIsIsAreaId 66 * @return object of BgpAttrNodeIsIsAreaId
67 - * @throws BGPParseException while parsing BgpAttrNodeIsIsAreaId 67 + * @throws BgpParseException while parsing BgpAttrNodeIsIsAreaId
68 */ 68 */
69 public static BgpAttrNodeIsIsAreaId read(ChannelBuffer cb) 69 public static BgpAttrNodeIsIsAreaId read(ChannelBuffer cb)
70 - throws BGPParseException { 70 + throws BgpParseException {
71 byte[] isisAreaId; 71 byte[] isisAreaId;
72 72
73 short lsAttrLength = cb.readShort(); 73 short lsAttrLength = cb.readShort();
74 74
75 if (cb.readableBytes() < lsAttrLength) { 75 if (cb.readableBytes() < lsAttrLength) {
76 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 76 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
77 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 77 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
78 lsAttrLength); 78 lsAttrLength);
79 } 79 }
80 80
......
...@@ -20,9 +20,9 @@ import java.util.List; ...@@ -20,9 +20,9 @@ import java.util.List;
20 import java.util.Objects; 20 import java.util.Objects;
21 21
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.types.BGPErrorType; 24 +import org.onosproject.bgpio.types.BgpErrorType;
25 -import org.onosproject.bgpio.types.BGPValueType; 25 +import org.onosproject.bgpio.types.BgpValueType;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects; ...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects;
32 /** 32 /**
33 * BGP Multi-Topology ID of the LS attribute. 33 * BGP Multi-Topology ID of the LS attribute.
34 */ 34 */
35 -public class BgpAttrNodeMultiTopologyId implements BGPValueType { 35 +public class BgpAttrNodeMultiTopologyId implements BgpValueType {
36 36
37 private static final Logger log = LoggerFactory 37 private static final Logger log = LoggerFactory
38 .getLogger(BgpAttrNodeMultiTopologyId.class); 38 .getLogger(BgpAttrNodeMultiTopologyId.class);
...@@ -66,18 +66,18 @@ public class BgpAttrNodeMultiTopologyId implements BGPValueType { ...@@ -66,18 +66,18 @@ public class BgpAttrNodeMultiTopologyId implements BGPValueType {
66 * 66 *
67 * @param cb ChannelBuffer 67 * @param cb ChannelBuffer
68 * @return Constructor of BgpAttrNodeMultiTopologyId 68 * @return Constructor of BgpAttrNodeMultiTopologyId
69 - * @throws BGPParseException while parsing BgpAttrNodeMultiTopologyId 69 + * @throws BgpParseException while parsing BgpAttrNodeMultiTopologyId
70 */ 70 */
71 public static BgpAttrNodeMultiTopologyId read(ChannelBuffer cb) 71 public static BgpAttrNodeMultiTopologyId read(ChannelBuffer cb)
72 - throws BGPParseException { 72 + throws BgpParseException {
73 ArrayList<Short> multiTopologyId = new ArrayList<Short>(); 73 ArrayList<Short> multiTopologyId = new ArrayList<Short>();
74 short tempMultiTopologyId; 74 short tempMultiTopologyId;
75 short lsAttrLength = cb.readShort(); 75 short lsAttrLength = cb.readShort();
76 int len = lsAttrLength / 2; // Length is 2*n and n is the number of MT-IDs 76 int len = lsAttrLength / 2; // Length is 2*n and n is the number of MT-IDs
77 77
78 if (cb.readableBytes() < lsAttrLength) { 78 if (cb.readableBytes() < lsAttrLength) {
79 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 79 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
80 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 80 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
81 lsAttrLength); 81 lsAttrLength);
82 } 82 }
83 83
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Arrays; 18 import java.util.Arrays;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP attribute node name. 31 * Implements BGP attribute node name.
32 */ 32 */
33 -public class BgpAttrNodeName implements BGPValueType { 33 +public class BgpAttrNodeName implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpAttrNodeName.class); 36 .getLogger(BgpAttrNodeName.class);
...@@ -64,17 +64,17 @@ public class BgpAttrNodeName implements BGPValueType { ...@@ -64,17 +64,17 @@ public class BgpAttrNodeName implements BGPValueType {
64 * 64 *
65 * @param cb ChannelBuffer 65 * @param cb ChannelBuffer
66 * @return object of BgpAttrNodeName 66 * @return object of BgpAttrNodeName
67 - * @throws BGPParseException while parsing BgpAttrNodeName 67 + * @throws BgpParseException while parsing BgpAttrNodeName
68 */ 68 */
69 public static BgpAttrNodeName read(ChannelBuffer cb) 69 public static BgpAttrNodeName read(ChannelBuffer cb)
70 - throws BGPParseException { 70 + throws BgpParseException {
71 byte[] nodeName; 71 byte[] nodeName;
72 72
73 short lsAttrLength = cb.readShort(); 73 short lsAttrLength = cb.readShort();
74 74
75 if (cb.readableBytes() < lsAttrLength) { 75 if (cb.readableBytes() < lsAttrLength) {
76 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 76 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
77 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 77 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
78 lsAttrLength); 78 lsAttrLength);
79 } 79 }
80 80
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Arrays; 18 import java.util.Arrays;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP attribute opaque node. 31 * Implements BGP attribute opaque node.
32 */ 32 */
33 -public class BgpAttrOpaqueNode implements BGPValueType { 33 +public class BgpAttrOpaqueNode implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpAttrOpaqueNode.class); 36 .getLogger(BgpAttrOpaqueNode.class);
...@@ -64,18 +64,18 @@ public class BgpAttrOpaqueNode implements BGPValueType { ...@@ -64,18 +64,18 @@ public class BgpAttrOpaqueNode implements BGPValueType {
64 * 64 *
65 * @param cb ChannelBuffer 65 * @param cb ChannelBuffer
66 * @return object of BgpAttrOpaqueNode 66 * @return object of BgpAttrOpaqueNode
67 - * @throws BGPParseException while parsing BgpAttrOpaqueNode 67 + * @throws BgpParseException while parsing BgpAttrOpaqueNode
68 */ 68 */
69 public static BgpAttrOpaqueNode read(ChannelBuffer cb) 69 public static BgpAttrOpaqueNode read(ChannelBuffer cb)
70 - throws BGPParseException { 70 + throws BgpParseException {
71 71
72 byte[] opaqueNodeAttribute; 72 byte[] opaqueNodeAttribute;
73 73
74 short lsAttrLength = cb.readShort(); 74 short lsAttrLength = cb.readShort();
75 75
76 if (cb.readableBytes() < lsAttrLength) { 76 if (cb.readableBytes() < lsAttrLength) {
77 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 77 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
78 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 78 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
79 lsAttrLength); 79 lsAttrLength);
80 } 80 }
81 81
......
...@@ -19,9 +19,9 @@ import java.util.Objects; ...@@ -19,9 +19,9 @@ import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onlab.packet.Ip4Address; 21 import org.onlab.packet.Ip4Address;
22 -import org.onosproject.bgpio.exceptions.BGPParseException; 22 +import org.onosproject.bgpio.exceptions.BgpParseException;
23 -import org.onosproject.bgpio.types.BGPErrorType; 23 +import org.onosproject.bgpio.types.BgpErrorType;
24 -import org.onosproject.bgpio.types.BGPValueType; 24 +import org.onosproject.bgpio.types.BgpValueType;
25 import org.onosproject.bgpio.util.Validation; 25 import org.onosproject.bgpio.util.Validation;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 27 import org.slf4j.LoggerFactory;
...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects; ...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects;
31 /** 31 /**
32 * Implements BGP attribute node router ID. 32 * Implements BGP attribute node router ID.
33 */ 33 */
34 -public final class BgpAttrRouterIdV4 implements BGPValueType { 34 +public final class BgpAttrRouterIdV4 implements BgpValueType {
35 35
36 protected static final Logger log = LoggerFactory 36 protected static final Logger log = LoggerFactory
37 .getLogger(BgpAttrRouterIdV4.class); 37 .getLogger(BgpAttrRouterIdV4.class);
...@@ -70,15 +70,15 @@ public final class BgpAttrRouterIdV4 implements BGPValueType { ...@@ -70,15 +70,15 @@ public final class BgpAttrRouterIdV4 implements BGPValueType {
70 * @param cb ChannelBuffer 70 * @param cb ChannelBuffer
71 * @param sType tag type 71 * @param sType tag type
72 * @return object of BgpAttrRouterIdV4 72 * @return object of BgpAttrRouterIdV4
73 - * @throws BGPParseException while parsing BgpAttrRouterIdV4 73 + * @throws BgpParseException while parsing BgpAttrRouterIdV4
74 */ 74 */
75 public static BgpAttrRouterIdV4 read(ChannelBuffer cb, short sType) 75 public static BgpAttrRouterIdV4 read(ChannelBuffer cb, short sType)
76 - throws BGPParseException { 76 + throws BgpParseException {
77 short lsAttrLength = cb.readShort(); 77 short lsAttrLength = cb.readShort();
78 78
79 if ((lsAttrLength != 4) || (cb.readableBytes() < lsAttrLength)) { 79 if ((lsAttrLength != 4) || (cb.readableBytes() < lsAttrLength)) {
80 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 80 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
81 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 81 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
82 lsAttrLength); 82 lsAttrLength);
83 } 83 }
84 84
......
...@@ -19,9 +19,9 @@ import java.util.Objects; ...@@ -19,9 +19,9 @@ import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onlab.packet.Ip6Address; 21 import org.onlab.packet.Ip6Address;
22 -import org.onosproject.bgpio.exceptions.BGPParseException; 22 +import org.onosproject.bgpio.exceptions.BgpParseException;
23 -import org.onosproject.bgpio.types.BGPErrorType; 23 +import org.onosproject.bgpio.types.BgpErrorType;
24 -import org.onosproject.bgpio.types.BGPValueType; 24 +import org.onosproject.bgpio.types.BgpValueType;
25 import org.onosproject.bgpio.util.Validation; 25 import org.onosproject.bgpio.util.Validation;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 27 import org.slf4j.LoggerFactory;
...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects; ...@@ -31,7 +31,7 @@ import com.google.common.base.MoreObjects;
31 /** 31 /**
32 * Implements BGP attribute IPv6 router ID. 32 * Implements BGP attribute IPv6 router ID.
33 */ 33 */
34 -public final class BgpAttrRouterIdV6 implements BGPValueType { 34 +public final class BgpAttrRouterIdV6 implements BgpValueType {
35 35
36 protected static final Logger log = LoggerFactory 36 protected static final Logger log = LoggerFactory
37 .getLogger(BgpAttrRouterIdV6.class); 37 .getLogger(BgpAttrRouterIdV6.class);
...@@ -70,18 +70,18 @@ public final class BgpAttrRouterIdV6 implements BGPValueType { ...@@ -70,18 +70,18 @@ public final class BgpAttrRouterIdV6 implements BGPValueType {
70 * @param cb ChannelBuffer 70 * @param cb ChannelBuffer
71 * @param sType TLV type 71 * @param sType TLV type
72 * @return object of BgpAttrRouterIdV6 72 * @return object of BgpAttrRouterIdV6
73 - * @throws BGPParseException while parsing BgpAttrRouterIdV6 73 + * @throws BgpParseException while parsing BgpAttrRouterIdV6
74 */ 74 */
75 public static BgpAttrRouterIdV6 read(ChannelBuffer cb, short sType) 75 public static BgpAttrRouterIdV6 read(ChannelBuffer cb, short sType)
76 - throws BGPParseException { 76 + throws BgpParseException {
77 byte[] ipBytes; 77 byte[] ipBytes;
78 Ip6Address ip6RouterId; 78 Ip6Address ip6RouterId;
79 79
80 short lsAttrLength = cb.readShort(); 80 short lsAttrLength = cb.readShort();
81 81
82 if ((lsAttrLength != 16) || (cb.readableBytes() < lsAttrLength)) { 82 if ((lsAttrLength != 16) || (cb.readableBytes() < lsAttrLength)) {
83 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 83 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
84 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 84 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
85 lsAttrLength); 85 lsAttrLength);
86 } 86 }
87 87
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP link IGP metric attribute. 31 * Implements BGP link IGP metric attribute.
32 */ 32 */
33 -public class BgpLinkAttrIgpMetric implements BGPValueType { 33 +public class BgpLinkAttrIgpMetric implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrIgpMetric.class); 36 .getLogger(BgpLinkAttrIgpMetric.class);
...@@ -75,10 +75,10 @@ public class BgpLinkAttrIgpMetric implements BGPValueType { ...@@ -75,10 +75,10 @@ public class BgpLinkAttrIgpMetric implements BGPValueType {
75 * 75 *
76 * @param cb Channel buffer 76 * @param cb Channel buffer
77 * @return object of type BgpLinkAttrIgpMetric 77 * @return object of type BgpLinkAttrIgpMetric
78 - * @throws BGPParseException while parsing BgpLinkAttrIgpMetric 78 + * @throws BgpParseException while parsing BgpLinkAttrIgpMetric
79 */ 79 */
80 public static BgpLinkAttrIgpMetric read(ChannelBuffer cb) 80 public static BgpLinkAttrIgpMetric read(ChannelBuffer cb)
81 - throws BGPParseException { 81 + throws BgpParseException {
82 82
83 short linkigp; 83 short linkigp;
84 int igpMetric = 0; 84 int igpMetric = 0;
...@@ -88,8 +88,8 @@ public class BgpLinkAttrIgpMetric implements BGPValueType { ...@@ -88,8 +88,8 @@ public class BgpLinkAttrIgpMetric implements BGPValueType {
88 88
89 if (cb.readableBytes() < lsAttrLength 89 if (cb.readableBytes() < lsAttrLength
90 || lsAttrLength > ATTRLINK_MAX_LEN) { 90 || lsAttrLength > ATTRLINK_MAX_LEN) {
91 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 91 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
92 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 92 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
93 lsAttrLength); 93 lsAttrLength);
94 } 94 }
95 95
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP attribute Is Is Administrative area. 31 * Implements BGP attribute Is Is Administrative area.
32 */ 32 */
33 -public final class BgpLinkAttrIsIsAdminstGrp implements BGPValueType { 33 +public final class BgpLinkAttrIsIsAdminstGrp implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrIsIsAdminstGrp.class); 36 .getLogger(BgpLinkAttrIsIsAdminstGrp.class);
...@@ -65,17 +65,17 @@ public final class BgpLinkAttrIsIsAdminstGrp implements BGPValueType { ...@@ -65,17 +65,17 @@ public final class BgpLinkAttrIsIsAdminstGrp implements BGPValueType {
65 * 65 *
66 * @param cb Channel buffer 66 * @param cb Channel buffer
67 * @return object of type BgpLinkAttrIsIsAdminstGrp 67 * @return object of type BgpLinkAttrIsIsAdminstGrp
68 - * @throws BGPParseException while parsing BgpLinkAttrIsIsAdminstGrp 68 + * @throws BgpParseException while parsing BgpLinkAttrIsIsAdminstGrp
69 */ 69 */
70 public static BgpLinkAttrIsIsAdminstGrp read(ChannelBuffer cb) 70 public static BgpLinkAttrIsIsAdminstGrp read(ChannelBuffer cb)
71 - throws BGPParseException { 71 + throws BgpParseException {
72 long isisAdminGrp; 72 long isisAdminGrp;
73 short lsAttrLength = cb.readShort(); 73 short lsAttrLength = cb.readShort();
74 74
75 if ((lsAttrLength != ISIS_ADMIN_DATA_LEN) 75 if ((lsAttrLength != ISIS_ADMIN_DATA_LEN)
76 || (cb.readableBytes() < lsAttrLength)) { 76 || (cb.readableBytes() < lsAttrLength)) {
77 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 77 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
78 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 78 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
79 lsAttrLength); 79 lsAttrLength);
80 } 80 }
81 81
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP attribute Max Link bandwidth. 31 * Implements BGP attribute Max Link bandwidth.
32 */ 32 */
33 -public final class BgpLinkAttrMaxLinkBandwidth implements BGPValueType { 33 +public final class BgpLinkAttrMaxLinkBandwidth implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrMaxLinkBandwidth.class); 36 .getLogger(BgpLinkAttrMaxLinkBandwidth.class);
...@@ -72,17 +72,17 @@ public final class BgpLinkAttrMaxLinkBandwidth implements BGPValueType { ...@@ -72,17 +72,17 @@ public final class BgpLinkAttrMaxLinkBandwidth implements BGPValueType {
72 * @param cb Channel buffer 72 * @param cb Channel buffer
73 * @param type type of this tlv 73 * @param type type of this tlv
74 * @return object of type BgpLinkAttrMaxLinkBandwidth 74 * @return object of type BgpLinkAttrMaxLinkBandwidth
75 - * @throws BGPParseException while parsing BgpLinkAttrMaxLinkBandwidth 75 + * @throws BgpParseException while parsing BgpLinkAttrMaxLinkBandwidth
76 */ 76 */
77 public static BgpLinkAttrMaxLinkBandwidth read(ChannelBuffer cb, short type) 77 public static BgpLinkAttrMaxLinkBandwidth read(ChannelBuffer cb, short type)
78 - throws BGPParseException { 78 + throws BgpParseException {
79 float maxBandwidth; 79 float maxBandwidth;
80 short lsAttrLength = cb.readShort(); 80 short lsAttrLength = cb.readShort();
81 81
82 if ((lsAttrLength != MAX_BANDWIDTH_LEN) 82 if ((lsAttrLength != MAX_BANDWIDTH_LEN)
83 || (cb.readableBytes() < lsAttrLength)) { 83 || (cb.readableBytes() < lsAttrLength)) {
84 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 84 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
85 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 85 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
86 lsAttrLength); 86 lsAttrLength);
87 } 87 }
88 88
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP MPLS protocol mask attribute. 31 * Implements BGP MPLS protocol mask attribute.
32 */ 32 */
33 -public class BgpLinkAttrMplsProtocolMask implements BGPValueType { 33 +public class BgpLinkAttrMplsProtocolMask implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrMplsProtocolMask.class); 36 .getLogger(BgpLinkAttrMplsProtocolMask.class);
...@@ -72,10 +72,10 @@ public class BgpLinkAttrMplsProtocolMask implements BGPValueType { ...@@ -72,10 +72,10 @@ public class BgpLinkAttrMplsProtocolMask implements BGPValueType {
72 * 72 *
73 * @param cb Channel buffer 73 * @param cb Channel buffer
74 * @return object of type BgpLinkAttrMPLSProtocolMask 74 * @return object of type BgpLinkAttrMPLSProtocolMask
75 - * @throws BGPParseException while parsing BgpLinkAttrMplsProtocolMask 75 + * @throws BgpParseException while parsing BgpLinkAttrMplsProtocolMask
76 */ 76 */
77 public static BgpLinkAttrMplsProtocolMask read(ChannelBuffer cb) 77 public static BgpLinkAttrMplsProtocolMask read(ChannelBuffer cb)
78 - throws BGPParseException { 78 + throws BgpParseException {
79 boolean bLdp = false; 79 boolean bLdp = false;
80 boolean bRsvpTe = false; 80 boolean bRsvpTe = false;
81 81
...@@ -83,8 +83,8 @@ public class BgpLinkAttrMplsProtocolMask implements BGPValueType { ...@@ -83,8 +83,8 @@ public class BgpLinkAttrMplsProtocolMask implements BGPValueType {
83 83
84 if ((lsAttrLength != MASK_BYTE_LEN) 84 if ((lsAttrLength != MASK_BYTE_LEN)
85 || (cb.readableBytes() < lsAttrLength)) { 85 || (cb.readableBytes() < lsAttrLength)) {
86 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 86 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
87 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 87 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
88 lsAttrLength); 88 lsAttrLength);
89 } 89 }
90 90
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Arrays; 18 import java.util.Arrays;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP link name attribute. 31 * Implements BGP link name attribute.
32 */ 32 */
33 -public class BgpLinkAttrName implements BGPValueType { 33 +public class BgpLinkAttrName implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrName.class); 36 .getLogger(BgpLinkAttrName.class);
...@@ -64,16 +64,16 @@ public class BgpLinkAttrName implements BGPValueType { ...@@ -64,16 +64,16 @@ public class BgpLinkAttrName implements BGPValueType {
64 * 64 *
65 * @param cb Channel buffer 65 * @param cb Channel buffer
66 * @return object of type BgpLinkAttrName 66 * @return object of type BgpLinkAttrName
67 - * @throws BGPParseException while parsing BgpLinkAttrName 67 + * @throws BgpParseException while parsing BgpLinkAttrName
68 */ 68 */
69 public static BgpLinkAttrName read(ChannelBuffer cb) 69 public static BgpLinkAttrName read(ChannelBuffer cb)
70 - throws BGPParseException { 70 + throws BgpParseException {
71 byte[] linkName; 71 byte[] linkName;
72 short lsAttrLength = cb.readShort(); 72 short lsAttrLength = cb.readShort();
73 73
74 if (cb.readableBytes() < lsAttrLength) { 74 if (cb.readableBytes() < lsAttrLength) {
75 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 75 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
76 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 76 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
77 lsAttrLength); 77 lsAttrLength);
78 } 78 }
79 79
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Arrays; 18 import java.util.Arrays;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP link opaque attribute. 31 * Implements BGP link opaque attribute.
32 */ 32 */
33 -public final class BgpLinkAttrOpaqLnkAttrib implements BGPValueType { 33 +public final class BgpLinkAttrOpaqLnkAttrib implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrOpaqLnkAttrib.class); 36 .getLogger(BgpLinkAttrOpaqLnkAttrib.class);
...@@ -65,18 +65,18 @@ public final class BgpLinkAttrOpaqLnkAttrib implements BGPValueType { ...@@ -65,18 +65,18 @@ public final class BgpLinkAttrOpaqLnkAttrib implements BGPValueType {
65 * 65 *
66 * @param cb Channel buffer 66 * @param cb Channel buffer
67 * @return object of type BgpLinkAttrOpaqLnkAttrib 67 * @return object of type BgpLinkAttrOpaqLnkAttrib
68 - * @throws BGPParseException while parsing BgpLinkAttrOpaqLnkAttrib 68 + * @throws BgpParseException while parsing BgpLinkAttrOpaqLnkAttrib
69 */ 69 */
70 public static BgpLinkAttrOpaqLnkAttrib read(ChannelBuffer cb) 70 public static BgpLinkAttrOpaqLnkAttrib read(ChannelBuffer cb)
71 - throws BGPParseException { 71 + throws BgpParseException {
72 72
73 byte[] opaqueLinkAttribute; 73 byte[] opaqueLinkAttribute;
74 74
75 short lsAttrLength = cb.readShort(); 75 short lsAttrLength = cb.readShort();
76 76
77 if (cb.readableBytes() < lsAttrLength) { 77 if (cb.readableBytes() < lsAttrLength) {
78 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 78 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
79 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 79 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
80 lsAttrLength); 80 lsAttrLength);
81 } 81 }
82 82
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP link protection type attribute. 31 * Implements BGP link protection type attribute.
32 */ 32 */
33 -public final class BgpLinkAttrProtectionType implements BGPValueType { 33 +public final class BgpLinkAttrProtectionType implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrProtectionType.class); 36 .getLogger(BgpLinkAttrProtectionType.class);
...@@ -102,10 +102,10 @@ public final class BgpLinkAttrProtectionType implements BGPValueType { ...@@ -102,10 +102,10 @@ public final class BgpLinkAttrProtectionType implements BGPValueType {
102 * 102 *
103 * @param cb Channel buffer 103 * @param cb Channel buffer
104 * @return object of type BgpLinkAttrProtectionType 104 * @return object of type BgpLinkAttrProtectionType
105 - * @throws BGPParseException while parsing BgpLinkAttrProtectionType 105 + * @throws BgpParseException while parsing BgpLinkAttrProtectionType
106 */ 106 */
107 public static BgpLinkAttrProtectionType read(ChannelBuffer cb) 107 public static BgpLinkAttrProtectionType read(ChannelBuffer cb)
108 - throws BGPParseException { 108 + throws BgpParseException {
109 short linkProtectionType; 109 short linkProtectionType;
110 byte higherByte; 110 byte higherByte;
111 short lsAttrLength = cb.readShort(); 111 short lsAttrLength = cb.readShort();
...@@ -119,8 +119,8 @@ public final class BgpLinkAttrProtectionType implements BGPValueType { ...@@ -119,8 +119,8 @@ public final class BgpLinkAttrProtectionType implements BGPValueType {
119 119
120 if ((lsAttrLength != LINK_PROTECTION_LEN) 120 if ((lsAttrLength != LINK_PROTECTION_LEN)
121 || (cb.readableBytes() < lsAttrLength)) { 121 || (cb.readableBytes() < lsAttrLength)) {
122 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 122 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
123 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 123 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
124 lsAttrLength); 124 lsAttrLength);
125 } 125 }
126 126
......
...@@ -20,9 +20,9 @@ import java.util.List; ...@@ -20,9 +20,9 @@ import java.util.List;
20 import java.util.Objects; 20 import java.util.Objects;
21 21
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.types.BGPErrorType; 24 +import org.onosproject.bgpio.types.BgpErrorType;
25 -import org.onosproject.bgpio.types.BGPValueType; 25 +import org.onosproject.bgpio.types.BgpValueType;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 27
28 import com.google.common.base.MoreObjects; 28 import com.google.common.base.MoreObjects;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP link Shared Risk Link Group attribute. 31 * Implements BGP link Shared Risk Link Group attribute.
32 */ 32 */
33 -public class BgpLinkAttrSrlg implements BGPValueType { 33 +public class BgpLinkAttrSrlg implements BgpValueType {
34 34
35 public static final short ATTRNODE_SRLG = 1097; 35 public static final short ATTRNODE_SRLG = 1097;
36 36
...@@ -61,10 +61,10 @@ public class BgpLinkAttrSrlg implements BGPValueType { ...@@ -61,10 +61,10 @@ public class BgpLinkAttrSrlg implements BGPValueType {
61 * 61 *
62 * @param cb Channel buffer 62 * @param cb Channel buffer
63 * @return object of type BgpLinkAttrSrlg 63 * @return object of type BgpLinkAttrSrlg
64 - * @throws BGPParseException while parsing BgpLinkAttrSrlg 64 + * @throws BgpParseException while parsing BgpLinkAttrSrlg
65 */ 65 */
66 public static BgpLinkAttrSrlg read(ChannelBuffer cb) 66 public static BgpLinkAttrSrlg read(ChannelBuffer cb)
67 - throws BGPParseException { 67 + throws BgpParseException {
68 int tempSrlg; 68 int tempSrlg;
69 ArrayList<Integer> sRlg = new ArrayList<Integer>(); 69 ArrayList<Integer> sRlg = new ArrayList<Integer>();
70 70
...@@ -72,8 +72,8 @@ public class BgpLinkAttrSrlg implements BGPValueType { ...@@ -72,8 +72,8 @@ public class BgpLinkAttrSrlg implements BGPValueType {
72 int len = lsAttrLength / Integer.SIZE; // each element is of 4 octets 72 int len = lsAttrLength / Integer.SIZE; // each element is of 4 octets
73 73
74 if (cb.readableBytes() < lsAttrLength) { 74 if (cb.readableBytes() < lsAttrLength) {
75 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 75 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
76 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 76 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
77 lsAttrLength); 77 lsAttrLength);
78 } 78 }
79 79
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP link state Default TE metric link attribute. 31 * Implements BGP link state Default TE metric link attribute.
32 */ 32 */
33 -public class BgpLinkAttrTeDefaultMetric implements BGPValueType { 33 +public class BgpLinkAttrTeDefaultMetric implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpLinkAttrTeDefaultMetric.class); 36 .getLogger(BgpLinkAttrTeDefaultMetric.class);
...@@ -66,18 +66,18 @@ public class BgpLinkAttrTeDefaultMetric implements BGPValueType { ...@@ -66,18 +66,18 @@ public class BgpLinkAttrTeDefaultMetric implements BGPValueType {
66 * 66 *
67 * @param cb Channel buffer 67 * @param cb Channel buffer
68 * @return object of type BgpLinkAttrTeDefaultMetric 68 * @return object of type BgpLinkAttrTeDefaultMetric
69 - * @throws BGPParseException while parsing BgpLinkAttrTeDefaultMetric 69 + * @throws BgpParseException while parsing BgpLinkAttrTeDefaultMetric
70 */ 70 */
71 public static BgpLinkAttrTeDefaultMetric read(ChannelBuffer cb) 71 public static BgpLinkAttrTeDefaultMetric read(ChannelBuffer cb)
72 - throws BGPParseException { 72 + throws BgpParseException {
73 int linkTeMetric; 73 int linkTeMetric;
74 74
75 short lsAttrLength = cb.readShort(); 75 short lsAttrLength = cb.readShort();
76 76
77 if ((lsAttrLength != TE_DATA_LEN) 77 if ((lsAttrLength != TE_DATA_LEN)
78 || (cb.readableBytes() < lsAttrLength)) { 78 || (cb.readableBytes() < lsAttrLength)) {
79 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 79 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
80 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 80 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
81 lsAttrLength); 81 lsAttrLength);
82 } 82 }
83 83
......
...@@ -20,9 +20,9 @@ import java.util.List; ...@@ -20,9 +20,9 @@ import java.util.List;
20 import java.util.Objects; 20 import java.util.Objects;
21 21
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.types.BGPErrorType; 24 +import org.onosproject.bgpio.types.BgpErrorType;
25 -import org.onosproject.bgpio.types.BGPValueType; 25 +import org.onosproject.bgpio.types.BgpValueType;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects; ...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects;
32 /** 32 /**
33 * Implements BGP unreserved bandwidth attribute. 33 * Implements BGP unreserved bandwidth attribute.
34 */ 34 */
35 -public class BgpLinkAttrUnRsrvdLinkBandwidth implements BGPValueType { 35 +public class BgpLinkAttrUnRsrvdLinkBandwidth implements BgpValueType {
36 36
37 protected static final Logger log = LoggerFactory 37 protected static final Logger log = LoggerFactory
38 .getLogger(BgpLinkAttrUnRsrvdLinkBandwidth.class); 38 .getLogger(BgpLinkAttrUnRsrvdLinkBandwidth.class);
...@@ -74,19 +74,19 @@ public class BgpLinkAttrUnRsrvdLinkBandwidth implements BGPValueType { ...@@ -74,19 +74,19 @@ public class BgpLinkAttrUnRsrvdLinkBandwidth implements BGPValueType {
74 * 74 *
75 * @param cb Channel buffer 75 * @param cb Channel buffer
76 * @return object of type BgpLinkAttrMaxLinkBandwidth 76 * @return object of type BgpLinkAttrMaxLinkBandwidth
77 - * @throws BGPParseException while parsing BgpLinkAttrMaxLinkBandwidth 77 + * @throws BgpParseException while parsing BgpLinkAttrMaxLinkBandwidth
78 */ 78 */
79 public static BgpLinkAttrUnRsrvdLinkBandwidth read(ChannelBuffer cb, 79 public static BgpLinkAttrUnRsrvdLinkBandwidth read(ChannelBuffer cb,
80 short sType) 80 short sType)
81 - throws BGPParseException { 81 + throws BgpParseException {
82 ArrayList<Float> maxUnResBandwidth = new ArrayList<Float>(); 82 ArrayList<Float> maxUnResBandwidth = new ArrayList<Float>();
83 float tmp; 83 float tmp;
84 short lsAttrLength = cb.readShort(); 84 short lsAttrLength = cb.readShort();
85 85
86 if ((lsAttrLength != MAX_BANDWIDTH_LEN * NO_OF_PRIORITY) 86 if ((lsAttrLength != MAX_BANDWIDTH_LEN * NO_OF_PRIORITY)
87 || (cb.readableBytes() < lsAttrLength)) { 87 || (cb.readableBytes() < lsAttrLength)) {
88 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 88 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
89 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 89 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
90 lsAttrLength); 90 lsAttrLength);
91 } 91 }
92 92
......
...@@ -22,9 +22,9 @@ import java.util.List; ...@@ -22,9 +22,9 @@ import java.util.List;
22 import java.util.Objects; 22 import java.util.Objects;
23 23
24 import org.jboss.netty.buffer.ChannelBuffer; 24 import org.jboss.netty.buffer.ChannelBuffer;
25 -import org.onosproject.bgpio.exceptions.BGPParseException; 25 +import org.onosproject.bgpio.exceptions.BgpParseException;
26 -import org.onosproject.bgpio.types.BGPErrorType; 26 +import org.onosproject.bgpio.types.BgpErrorType;
27 -import org.onosproject.bgpio.types.BGPValueType; 27 +import org.onosproject.bgpio.types.BgpValueType;
28 import org.onosproject.bgpio.util.Validation; 28 import org.onosproject.bgpio.util.Validation;
29 import org.slf4j.Logger; 29 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory; 30 import org.slf4j.LoggerFactory;
...@@ -34,7 +34,7 @@ import com.google.common.base.MoreObjects; ...@@ -34,7 +34,7 @@ import com.google.common.base.MoreObjects;
34 /** 34 /**
35 * Implements BGP prefix route Extended tag attribute. 35 * Implements BGP prefix route Extended tag attribute.
36 */ 36 */
37 -public class BgpPrefixAttrExtRouteTag implements BGPValueType { 37 +public class BgpPrefixAttrExtRouteTag implements BgpValueType {
38 38
39 protected static final Logger log = LoggerFactory 39 protected static final Logger log = LoggerFactory
40 .getLogger(BgpPrefixAttrExtRouteTag.class); 40 .getLogger(BgpPrefixAttrExtRouteTag.class);
...@@ -69,10 +69,10 @@ public class BgpPrefixAttrExtRouteTag implements BGPValueType { ...@@ -69,10 +69,10 @@ public class BgpPrefixAttrExtRouteTag implements BGPValueType {
69 * 69 *
70 * @param cb ChannelBuffer 70 * @param cb ChannelBuffer
71 * @return object of BgpPrefixAttrExtRouteTag 71 * @return object of BgpPrefixAttrExtRouteTag
72 - * @throws BGPParseException while parsing BgpPrefixAttrExtRouteTag 72 + * @throws BgpParseException while parsing BgpPrefixAttrExtRouteTag
73 */ 73 */
74 public static BgpPrefixAttrExtRouteTag read(ChannelBuffer cb) 74 public static BgpPrefixAttrExtRouteTag read(ChannelBuffer cb)
75 - throws BGPParseException { 75 + throws BgpParseException {
76 ArrayList<Long> pfxExtRouteTag = new ArrayList<Long>(); 76 ArrayList<Long> pfxExtRouteTag = new ArrayList<Long>();
77 long temp; 77 long temp;
78 78
...@@ -80,8 +80,8 @@ public class BgpPrefixAttrExtRouteTag implements BGPValueType { ...@@ -80,8 +80,8 @@ public class BgpPrefixAttrExtRouteTag implements BGPValueType {
80 int len = lsAttrLength / ATTR_PREFIX_EXT_LEN; 80 int len = lsAttrLength / ATTR_PREFIX_EXT_LEN;
81 81
82 if (cb.readableBytes() < lsAttrLength) { 82 if (cb.readableBytes() < lsAttrLength) {
83 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 83 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
84 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 84 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
85 lsAttrLength); 85 lsAttrLength);
86 } 86 }
87 87
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP prefix IGP Flag attribute. 31 * Implements BGP prefix IGP Flag attribute.
32 */ 32 */
33 -public final class BgpPrefixAttrIgpFlags implements BGPValueType { 33 +public final class BgpPrefixAttrIgpFlags implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpPrefixAttrIgpFlags.class); 36 .getLogger(BgpPrefixAttrIgpFlags.class);
...@@ -88,10 +88,10 @@ public final class BgpPrefixAttrIgpFlags implements BGPValueType { ...@@ -88,10 +88,10 @@ public final class BgpPrefixAttrIgpFlags implements BGPValueType {
88 * 88 *
89 * @param cb ChannelBuffer 89 * @param cb ChannelBuffer
90 * @return object of BgpPrefixAttrIGPFlags 90 * @return object of BgpPrefixAttrIGPFlags
91 - * @throws BGPParseException while parsing BgpPrefixAttrIGPFlags 91 + * @throws BgpParseException while parsing BgpPrefixAttrIGPFlags
92 */ 92 */
93 public static BgpPrefixAttrIgpFlags read(ChannelBuffer cb) 93 public static BgpPrefixAttrIgpFlags read(ChannelBuffer cb)
94 - throws BGPParseException { 94 + throws BgpParseException {
95 boolean bisisUpDownBit = false; 95 boolean bisisUpDownBit = false;
96 boolean bOspfNoUnicastBit = false; 96 boolean bOspfNoUnicastBit = false;
97 boolean bOspfLclAddrBit = false; 97 boolean bOspfLclAddrBit = false;
...@@ -101,8 +101,8 @@ public final class BgpPrefixAttrIgpFlags implements BGPValueType { ...@@ -101,8 +101,8 @@ public final class BgpPrefixAttrIgpFlags implements BGPValueType {
101 101
102 if ((lsAttrLength != ATTR_PREFIX_FLAG_LEN) 102 if ((lsAttrLength != ATTR_PREFIX_FLAG_LEN)
103 || (cb.readableBytes() < lsAttrLength)) { 103 || (cb.readableBytes() < lsAttrLength)) {
104 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 104 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
105 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 105 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
106 lsAttrLength); 106 lsAttrLength);
107 } 107 }
108 108
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Objects; 18 import java.util.Objects;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP prefix metric attribute. 31 * Implements BGP prefix metric attribute.
32 */ 32 */
33 -public class BgpPrefixAttrMetric implements BGPValueType { 33 +public class BgpPrefixAttrMetric implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpPrefixAttrMetric.class); 36 .getLogger(BgpPrefixAttrMetric.class);
...@@ -65,18 +65,18 @@ public class BgpPrefixAttrMetric implements BGPValueType { ...@@ -65,18 +65,18 @@ public class BgpPrefixAttrMetric implements BGPValueType {
65 * 65 *
66 * @param cb ChannelBuffer 66 * @param cb ChannelBuffer
67 * @return object of BgpPrefixAttrMetric 67 * @return object of BgpPrefixAttrMetric
68 - * @throws BGPParseException while parsing BgpPrefixAttrMetric 68 + * @throws BgpParseException while parsing BgpPrefixAttrMetric
69 */ 69 */
70 public static BgpPrefixAttrMetric read(ChannelBuffer cb) 70 public static BgpPrefixAttrMetric read(ChannelBuffer cb)
71 - throws BGPParseException { 71 + throws BgpParseException {
72 int linkPfxMetric; 72 int linkPfxMetric;
73 73
74 short lsAttrLength = cb.readShort(); // 4 Bytes 74 short lsAttrLength = cb.readShort(); // 4 Bytes
75 75
76 if ((lsAttrLength != ATTR_PREFIX_LEN) 76 if ((lsAttrLength != ATTR_PREFIX_LEN)
77 || (cb.readableBytes() < lsAttrLength)) { 77 || (cb.readableBytes() < lsAttrLength)) {
78 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 78 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
79 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 79 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
80 lsAttrLength); 80 lsAttrLength);
81 } 81 }
82 82
......
...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr; ...@@ -18,9 +18,9 @@ package org.onosproject.bgpio.types.attr;
18 import java.util.Arrays; 18 import java.util.Arrays;
19 19
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPErrorType; 22 +import org.onosproject.bgpio.types.BgpErrorType;
23 -import org.onosproject.bgpio.types.BGPValueType; 23 +import org.onosproject.bgpio.types.BgpValueType;
24 import org.onosproject.bgpio.util.Validation; 24 import org.onosproject.bgpio.util.Validation;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects; ...@@ -30,7 +30,7 @@ import com.google.common.base.MoreObjects;
30 /** 30 /**
31 * Implements BGP prefix opaque data attribute. 31 * Implements BGP prefix opaque data attribute.
32 */ 32 */
33 -public final class BgpPrefixAttrOpaqueData implements BGPValueType { 33 +public final class BgpPrefixAttrOpaqueData implements BgpValueType {
34 34
35 protected static final Logger log = LoggerFactory 35 protected static final Logger log = LoggerFactory
36 .getLogger(BgpPrefixAttrOpaqueData.class); 36 .getLogger(BgpPrefixAttrOpaqueData.class);
...@@ -65,18 +65,18 @@ public final class BgpPrefixAttrOpaqueData implements BGPValueType { ...@@ -65,18 +65,18 @@ public final class BgpPrefixAttrOpaqueData implements BGPValueType {
65 * 65 *
66 * @param cb ChannelBuffer 66 * @param cb ChannelBuffer
67 * @return object of BgpPrefixAttrOpaqueData 67 * @return object of BgpPrefixAttrOpaqueData
68 - * @throws BGPParseException while parsing BgpPrefixAttrOpaqueData 68 + * @throws BgpParseException while parsing BgpPrefixAttrOpaqueData
69 */ 69 */
70 public static BgpPrefixAttrOpaqueData read(ChannelBuffer cb) 70 public static BgpPrefixAttrOpaqueData read(ChannelBuffer cb)
71 - throws BGPParseException { 71 + throws BgpParseException {
72 byte[] opaquePrefixAttribute; 72 byte[] opaquePrefixAttribute;
73 73
74 short lsAttrLength = cb.readShort(); 74 short lsAttrLength = cb.readShort();
75 opaquePrefixAttribute = new byte[lsAttrLength]; 75 opaquePrefixAttribute = new byte[lsAttrLength];
76 76
77 if (cb.readableBytes() < lsAttrLength) { 77 if (cb.readableBytes() < lsAttrLength) {
78 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 78 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
79 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 79 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
80 lsAttrLength); 80 lsAttrLength);
81 } 81 }
82 82
......
...@@ -20,9 +20,9 @@ import java.util.Objects; ...@@ -20,9 +20,9 @@ import java.util.Objects;
20 import org.jboss.netty.buffer.ChannelBuffer; 20 import org.jboss.netty.buffer.ChannelBuffer;
21 import org.onlab.packet.Ip4Address; 21 import org.onlab.packet.Ip4Address;
22 import org.onlab.packet.Ip6Address; 22 import org.onlab.packet.Ip6Address;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.types.BGPErrorType; 24 +import org.onosproject.bgpio.types.BgpErrorType;
25 -import org.onosproject.bgpio.types.BGPValueType; 25 +import org.onosproject.bgpio.types.BgpValueType;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects; ...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects;
32 /** 32 /**
33 * Implements BGP prefix OSPF Forwarding address attribute. 33 * Implements BGP prefix OSPF Forwarding address attribute.
34 */ 34 */
35 -public class BgpPrefixAttrOspfFwdAddr implements BGPValueType { 35 +public class BgpPrefixAttrOspfFwdAddr implements BgpValueType {
36 36
37 protected static final Logger log = LoggerFactory 37 protected static final Logger log = LoggerFactory
38 .getLogger(BgpPrefixAttrOspfFwdAddr.class); 38 .getLogger(BgpPrefixAttrOspfFwdAddr.class);
...@@ -80,10 +80,10 @@ public class BgpPrefixAttrOspfFwdAddr implements BGPValueType { ...@@ -80,10 +80,10 @@ public class BgpPrefixAttrOspfFwdAddr implements BGPValueType {
80 * 80 *
81 * @param cb ChannelBuffer 81 * @param cb ChannelBuffer
82 * @return object of BgpPrefixAttrOSPFFwdAddr 82 * @return object of BgpPrefixAttrOSPFFwdAddr
83 - * @throws BGPParseException while parsing BgpPrefixAttrOspfFwdAddr 83 + * @throws BgpParseException while parsing BgpPrefixAttrOspfFwdAddr
84 */ 84 */
85 public static BgpPrefixAttrOspfFwdAddr read(ChannelBuffer cb) 85 public static BgpPrefixAttrOspfFwdAddr read(ChannelBuffer cb)
86 - throws BGPParseException { 86 + throws BgpParseException {
87 short lsAttrLength; 87 short lsAttrLength;
88 byte[] ipBytes; 88 byte[] ipBytes;
89 Ip4Address ip4RouterId = null; 89 Ip4Address ip4RouterId = null;
...@@ -93,8 +93,8 @@ public class BgpPrefixAttrOspfFwdAddr implements BGPValueType { ...@@ -93,8 +93,8 @@ public class BgpPrefixAttrOspfFwdAddr implements BGPValueType {
93 ipBytes = new byte[lsAttrLength]; 93 ipBytes = new byte[lsAttrLength];
94 94
95 if ((cb.readableBytes() < lsAttrLength)) { 95 if ((cb.readableBytes() < lsAttrLength)) {
96 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 96 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
97 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 97 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
98 lsAttrLength); 98 lsAttrLength);
99 } 99 }
100 100
......
...@@ -20,9 +20,9 @@ import java.util.List; ...@@ -20,9 +20,9 @@ import java.util.List;
20 import java.util.Objects; 20 import java.util.Objects;
21 21
22 import org.jboss.netty.buffer.ChannelBuffer; 22 import org.jboss.netty.buffer.ChannelBuffer;
23 -import org.onosproject.bgpio.exceptions.BGPParseException; 23 +import org.onosproject.bgpio.exceptions.BgpParseException;
24 -import org.onosproject.bgpio.types.BGPErrorType; 24 +import org.onosproject.bgpio.types.BgpErrorType;
25 -import org.onosproject.bgpio.types.BGPValueType; 25 +import org.onosproject.bgpio.types.BgpValueType;
26 import org.onosproject.bgpio.util.Validation; 26 import org.onosproject.bgpio.util.Validation;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects; ...@@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects;
32 /** 32 /**
33 * Implements BGP prefix route tag attribute. 33 * Implements BGP prefix route tag attribute.
34 */ 34 */
35 -public class BgpPrefixAttrRouteTag implements BGPValueType { 35 +public class BgpPrefixAttrRouteTag implements BgpValueType {
36 36
37 protected static final Logger log = LoggerFactory 37 protected static final Logger log = LoggerFactory
38 .getLogger(BgpPrefixAttrRouteTag.class); 38 .getLogger(BgpPrefixAttrRouteTag.class);
...@@ -66,10 +66,10 @@ public class BgpPrefixAttrRouteTag implements BGPValueType { ...@@ -66,10 +66,10 @@ public class BgpPrefixAttrRouteTag implements BGPValueType {
66 * 66 *
67 * @param cb ChannelBuffer 67 * @param cb ChannelBuffer
68 * @return object of BgpPrefixAttrRouteTag 68 * @return object of BgpPrefixAttrRouteTag
69 - * @throws BGPParseException while parsing BgpPrefixAttrRouteTag 69 + * @throws BgpParseException while parsing BgpPrefixAttrRouteTag
70 */ 70 */
71 public static BgpPrefixAttrRouteTag read(ChannelBuffer cb) 71 public static BgpPrefixAttrRouteTag read(ChannelBuffer cb)
72 - throws BGPParseException { 72 + throws BgpParseException {
73 int tmp; 73 int tmp;
74 ArrayList<Integer> pfxRouteTag = new ArrayList<Integer>(); 74 ArrayList<Integer> pfxRouteTag = new ArrayList<Integer>();
75 75
...@@ -77,8 +77,8 @@ public class BgpPrefixAttrRouteTag implements BGPValueType { ...@@ -77,8 +77,8 @@ public class BgpPrefixAttrRouteTag implements BGPValueType {
77 int len = lsAttrLength / Integer.SIZE; 77 int len = lsAttrLength / Integer.SIZE;
78 78
79 if (cb.readableBytes() < lsAttrLength) { 79 if (cb.readableBytes() < lsAttrLength) {
80 - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, 80 + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
81 - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, 81 + BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
82 lsAttrLength); 82 lsAttrLength);
83 } 83 }
84 84
......
...@@ -24,7 +24,7 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -24,7 +24,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
24 import org.jboss.netty.buffer.ChannelBuffers; 24 import org.jboss.netty.buffer.ChannelBuffers;
25 import org.onlab.packet.IpAddress; 25 import org.onlab.packet.IpAddress;
26 import org.onlab.packet.IpPrefix; 26 import org.onlab.packet.IpPrefix;
27 -import org.onosproject.bgpio.exceptions.BGPParseException; 27 +import org.onosproject.bgpio.exceptions.BgpParseException;
28 import org.slf4j.Logger; 28 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory; 29 import org.slf4j.LoggerFactory;
30 30
...@@ -109,13 +109,13 @@ public class Validation { ...@@ -109,13 +109,13 @@ public class Validation {
109 * @param errorCode Error code 109 * @param errorCode Error code
110 * @param subErrCode Sub Error Code 110 * @param subErrCode Sub Error Code
111 * @param length erroneous length 111 * @param length erroneous length
112 - * @throws BGPParseException for erroneous length 112 + * @throws BgpParseException for erroneous length
113 */ 113 */
114 - public static void validateLen(byte errorCode, byte subErrCode, int length) throws BGPParseException { 114 + public static void validateLen(byte errorCode, byte subErrCode, int length) throws BgpParseException {
115 byte[] errLen = Ints.toByteArray(length); 115 byte[] errLen = Ints.toByteArray(length);
116 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 116 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
117 buffer.writeBytes(errLen); 117 buffer.writeBytes(errLen);
118 - throw new BGPParseException(errorCode, subErrCode, buffer); 118 + throw new BgpParseException(errorCode, subErrCode, buffer);
119 } 119 }
120 120
121 /** 121 /**
...@@ -124,13 +124,13 @@ public class Validation { ...@@ -124,13 +124,13 @@ public class Validation {
124 * @param errorCode Error code 124 * @param errorCode Error code
125 * @param subErrCode Sub Error Code 125 * @param subErrCode Sub Error Code
126 * @param type erroneous type 126 * @param type erroneous type
127 - * @throws BGPParseException for erroneous type 127 + * @throws BgpParseException for erroneous type
128 */ 128 */
129 - public static void validateType(byte errorCode, byte subErrCode, int type) throws BGPParseException { 129 + public static void validateType(byte errorCode, byte subErrCode, int type) throws BgpParseException {
130 byte[] errType = Ints.toByteArray(type); 130 byte[] errType = Ints.toByteArray(type);
131 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 131 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
132 buffer.writeBytes(errType); 132 buffer.writeBytes(errType);
133 - throw new BGPParseException(errorCode, subErrCode, buffer); 133 + throw new BgpParseException(errorCode, subErrCode, buffer);
134 } 134 }
135 135
136 /** 136 /**
......
...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol; ...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPHeader; 22 +import org.onosproject.bgpio.types.BgpHeader;
23 23
24 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
25 import static org.hamcrest.Matchers.instanceOf; 25 import static org.hamcrest.Matchers.instanceOf;
...@@ -28,13 +28,13 @@ import static org.hamcrest.core.Is.is; ...@@ -28,13 +28,13 @@ import static org.hamcrest.core.Is.is;
28 /** 28 /**
29 * Test case for BGP KEEPALIVE Message. 29 * Test case for BGP KEEPALIVE Message.
30 */ 30 */
31 -public class BGPKeepaliveMsgTest { 31 +public class BgpKeepaliveMsgTest {
32 32
33 /** 33 /**
34 * This test case checks BGP Keepalive message. 34 * This test case checks BGP Keepalive message.
35 */ 35 */
36 @Test 36 @Test
37 - public void keepaliveMessageTest1() throws BGPParseException { 37 + public void keepaliveMessageTest1() throws BgpParseException {
38 38
39 // BGP KEEPALIVE Message 39 // BGP KEEPALIVE Message
40 byte[] keepaliveMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 40 byte[] keepaliveMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -47,13 +47,13 @@ public class BGPKeepaliveMsgTest { ...@@ -47,13 +47,13 @@ public class BGPKeepaliveMsgTest {
47 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 47 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
48 buffer.writeBytes(keepaliveMsg); 48 buffer.writeBytes(keepaliveMsg);
49 49
50 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 50 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
51 - BGPMessage message; 51 + BgpMessage message;
52 - BGPHeader bgpHeader = new BGPHeader(); 52 + BgpHeader bgpHeader = new BgpHeader();
53 53
54 message = reader.readFrom(buffer, bgpHeader); 54 message = reader.readFrom(buffer, bgpHeader);
55 55
56 - assertThat(message, instanceOf(BGPKeepaliveMsg.class)); 56 + assertThat(message, instanceOf(BgpKeepaliveMsg.class));
57 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 57 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
58 message.writeTo(buf); 58 message.writeTo(buf);
59 59
......
...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol; ...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPHeader; 22 +import org.onosproject.bgpio.types.BgpHeader;
23 23
24 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
25 import static org.hamcrest.Matchers.instanceOf; 25 import static org.hamcrest.Matchers.instanceOf;
...@@ -33,10 +33,10 @@ public class BgpNotificationMsgTest { ...@@ -33,10 +33,10 @@ public class BgpNotificationMsgTest {
33 /** 33 /**
34 * Notification message with error code, error subcode and data. 34 * Notification message with error code, error subcode and data.
35 * 35 *
36 - * @throws BGPParseException while decoding and encoding notification message 36 + * @throws BgpParseException while decoding and encoding notification message
37 */ 37 */
38 @Test 38 @Test
39 - public void bgpNotificationMessageTest1() throws BGPParseException { 39 + public void bgpNotificationMessageTest1() throws BgpParseException {
40 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff, 40 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff,
41 (byte) 0xff, (byte) 0xff, 41 (byte) 0xff, (byte) 0xff,
42 (byte) 0xff, (byte) 0xff, 42 (byte) 0xff, (byte) 0xff,
...@@ -52,12 +52,12 @@ public class BgpNotificationMsgTest { ...@@ -52,12 +52,12 @@ public class BgpNotificationMsgTest {
52 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 52 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
53 buffer.writeBytes(notificationMsg); 53 buffer.writeBytes(notificationMsg);
54 54
55 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 55 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
56 - BGPMessage message = null; 56 + BgpMessage message = null;
57 - BGPHeader bgpHeader = new BGPHeader(); 57 + BgpHeader bgpHeader = new BgpHeader();
58 58
59 message = reader.readFrom(buffer, bgpHeader); 59 message = reader.readFrom(buffer, bgpHeader);
60 - assertThat(message, instanceOf(BGPNotificationMsg.class)); 60 + assertThat(message, instanceOf(BgpNotificationMsg.class));
61 61
62 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 62 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
63 message.writeTo(buf); 63 message.writeTo(buf);
...@@ -72,10 +72,10 @@ public class BgpNotificationMsgTest { ...@@ -72,10 +72,10 @@ public class BgpNotificationMsgTest {
72 /** 72 /**
73 * Notification message without data. 73 * Notification message without data.
74 * 74 *
75 - * @throws BGPParseException while decoding and encoding notification message 75 + * @throws BgpParseException while decoding and encoding notification message
76 */ 76 */
77 @Test 77 @Test
78 - public void bgpNotificationMessageTest2() throws BGPParseException { 78 + public void bgpNotificationMessageTest2() throws BgpParseException {
79 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff, 79 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff,
80 (byte) 0xff, (byte) 0xff, 80 (byte) 0xff, (byte) 0xff,
81 (byte) 0xff, (byte) 0xff, 81 (byte) 0xff, (byte) 0xff,
...@@ -90,12 +90,12 @@ public class BgpNotificationMsgTest { ...@@ -90,12 +90,12 @@ public class BgpNotificationMsgTest {
90 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 90 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
91 buffer.writeBytes(notificationMsg); 91 buffer.writeBytes(notificationMsg);
92 92
93 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 93 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
94 - BGPMessage message = null; 94 + BgpMessage message = null;
95 - BGPHeader bgpHeader = new BGPHeader(); 95 + BgpHeader bgpHeader = new BgpHeader();
96 96
97 message = reader.readFrom(buffer, bgpHeader); 97 message = reader.readFrom(buffer, bgpHeader);
98 - assertThat(message, instanceOf(BGPNotificationMsg.class)); 98 + assertThat(message, instanceOf(BgpNotificationMsg.class));
99 99
100 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 100 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
101 message.writeTo(buf); 101 message.writeTo(buf);
...@@ -111,10 +111,10 @@ public class BgpNotificationMsgTest { ...@@ -111,10 +111,10 @@ public class BgpNotificationMsgTest {
111 /** 111 /**
112 * Notification message with wrong maker value. 112 * Notification message with wrong maker value.
113 * 113 *
114 - * @throws BGPParseException while decoding and encoding notification message 114 + * @throws BgpParseException while decoding and encoding notification message
115 */ 115 */
116 - @Test(expected = BGPParseException.class) 116 + @Test(expected = BgpParseException.class)
117 - public void bgpNotificationMessageTest3() throws BGPParseException { 117 + public void bgpNotificationMessageTest3() throws BgpParseException {
118 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff, 118 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff,
119 (byte) 0xff, (byte) 0xff, 119 (byte) 0xff, (byte) 0xff,
120 (byte) 0xff, (byte) 0xff, 120 (byte) 0xff, (byte) 0xff,
...@@ -129,12 +129,12 @@ public class BgpNotificationMsgTest { ...@@ -129,12 +129,12 @@ public class BgpNotificationMsgTest {
129 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 129 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
130 buffer.writeBytes(notificationMsg); 130 buffer.writeBytes(notificationMsg);
131 131
132 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 132 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
133 - BGPMessage message = null; 133 + BgpMessage message = null;
134 - BGPHeader bgpHeader = new BGPHeader(); 134 + BgpHeader bgpHeader = new BgpHeader();
135 135
136 message = reader.readFrom(buffer, bgpHeader); 136 message = reader.readFrom(buffer, bgpHeader);
137 - assertThat(message, instanceOf(BGPNotificationMsg.class)); 137 + assertThat(message, instanceOf(BgpNotificationMsg.class));
138 138
139 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 139 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
140 message.writeTo(buf); 140 message.writeTo(buf);
...@@ -149,10 +149,10 @@ public class BgpNotificationMsgTest { ...@@ -149,10 +149,10 @@ public class BgpNotificationMsgTest {
149 /** 149 /**
150 * Notification message without error subcode. 150 * Notification message without error subcode.
151 * 151 *
152 - * @throws BGPParseException while decoding and encoding notification message 152 + * @throws BgpParseException while decoding and encoding notification message
153 */ 153 */
154 - @Test(expected = BGPParseException.class) 154 + @Test(expected = BgpParseException.class)
155 - public void bgpNotificationMessageTest4() throws BGPParseException { 155 + public void bgpNotificationMessageTest4() throws BgpParseException {
156 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff, 156 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff,
157 (byte) 0xff, (byte) 0xff, 157 (byte) 0xff, (byte) 0xff,
158 (byte) 0xff, (byte) 0xff, 158 (byte) 0xff, (byte) 0xff,
...@@ -167,12 +167,12 @@ public class BgpNotificationMsgTest { ...@@ -167,12 +167,12 @@ public class BgpNotificationMsgTest {
167 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 167 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
168 buffer.writeBytes(notificationMsg); 168 buffer.writeBytes(notificationMsg);
169 169
170 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 170 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
171 - BGPMessage message = null; 171 + BgpMessage message = null;
172 - BGPHeader bgpHeader = new BGPHeader(); 172 + BgpHeader bgpHeader = new BgpHeader();
173 173
174 message = reader.readFrom(buffer, bgpHeader); 174 message = reader.readFrom(buffer, bgpHeader);
175 - assertThat(message, instanceOf(BGPNotificationMsg.class)); 175 + assertThat(message, instanceOf(BgpNotificationMsg.class));
176 176
177 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 177 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
178 message.writeTo(buf); 178 message.writeTo(buf);
...@@ -187,10 +187,10 @@ public class BgpNotificationMsgTest { ...@@ -187,10 +187,10 @@ public class BgpNotificationMsgTest {
187 /** 187 /**
188 * Notification message with wrong message length. 188 * Notification message with wrong message length.
189 * 189 *
190 - * @throws BGPParseException while decoding and encoding notification message 190 + * @throws BgpParseException while decoding and encoding notification message
191 */ 191 */
192 - @Test(expected = BGPParseException.class) 192 + @Test(expected = BgpParseException.class)
193 - public void bgpNotificationMessageTest5() throws BGPParseException { 193 + public void bgpNotificationMessageTest5() throws BgpParseException {
194 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff, 194 byte[] notificationMsg = new byte[] {(byte) 0xff, (byte) 0xff,
195 (byte) 0xff, (byte) 0xff, 195 (byte) 0xff, (byte) 0xff,
196 (byte) 0xff, (byte) 0xff, 196 (byte) 0xff, (byte) 0xff,
...@@ -205,12 +205,12 @@ public class BgpNotificationMsgTest { ...@@ -205,12 +205,12 @@ public class BgpNotificationMsgTest {
205 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 205 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
206 buffer.writeBytes(notificationMsg); 206 buffer.writeBytes(notificationMsg);
207 207
208 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 208 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
209 - BGPMessage message = null; 209 + BgpMessage message = null;
210 - BGPHeader bgpHeader = new BGPHeader(); 210 + BgpHeader bgpHeader = new BgpHeader();
211 211
212 message = reader.readFrom(buffer, bgpHeader); 212 message = reader.readFrom(buffer, bgpHeader);
213 - assertThat(message, instanceOf(BGPNotificationMsg.class)); 213 + assertThat(message, instanceOf(BgpNotificationMsg.class));
214 214
215 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 215 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
216 message.writeTo(buf); 216 message.writeTo(buf);
......
...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol; ...@@ -18,8 +18,8 @@ package org.onosproject.bgpio.protocol;
18 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
19 import org.jboss.netty.buffer.ChannelBuffers; 19 import org.jboss.netty.buffer.ChannelBuffers;
20 import org.junit.Test; 20 import org.junit.Test;
21 -import org.onosproject.bgpio.exceptions.BGPParseException; 21 +import org.onosproject.bgpio.exceptions.BgpParseException;
22 -import org.onosproject.bgpio.types.BGPHeader; 22 +import org.onosproject.bgpio.types.BgpHeader;
23 23
24 import static org.hamcrest.MatcherAssert.assertThat; 24 import static org.hamcrest.MatcherAssert.assertThat;
25 import static org.hamcrest.Matchers.instanceOf; 25 import static org.hamcrest.Matchers.instanceOf;
...@@ -28,13 +28,13 @@ import static org.hamcrest.core.Is.is; ...@@ -28,13 +28,13 @@ import static org.hamcrest.core.Is.is;
28 /** 28 /**
29 * Test cases for BGP Open Message. 29 * Test cases for BGP Open Message.
30 */ 30 */
31 -public class BGPOpenMsgTest { 31 +public class BgpOpenMsgTest {
32 32
33 /** 33 /**
34 * This test case checks open message without optional parameter. 34 * This test case checks open message without optional parameter.
35 */ 35 */
36 @Test 36 @Test
37 - public void openMessageTest1() throws BGPParseException { 37 + public void openMessageTest1() throws BgpParseException {
38 //Open message without optional parameter 38 //Open message without optional parameter
39 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 39 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
40 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 40 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -48,12 +48,12 @@ public class BGPOpenMsgTest { ...@@ -48,12 +48,12 @@ public class BGPOpenMsgTest {
48 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 48 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
49 buffer.writeBytes(openMsg); 49 buffer.writeBytes(openMsg);
50 50
51 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 51 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
52 - BGPMessage message; 52 + BgpMessage message;
53 - BGPHeader bgpHeader = new BGPHeader(); 53 + BgpHeader bgpHeader = new BgpHeader();
54 message = reader.readFrom(buffer, bgpHeader); 54 message = reader.readFrom(buffer, bgpHeader);
55 55
56 - assertThat(message, instanceOf(BGPOpenMsg.class)); 56 + assertThat(message, instanceOf(BgpOpenMsg.class));
57 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 57 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
58 message.writeTo(buf); 58 message.writeTo(buf);
59 59
...@@ -69,7 +69,7 @@ public class BGPOpenMsgTest { ...@@ -69,7 +69,7 @@ public class BGPOpenMsgTest {
69 * capability. 69 * capability.
70 */ 70 */
71 @Test 71 @Test
72 - public void openMessageTest2() throws BGPParseException { 72 + public void openMessageTest2() throws BgpParseException {
73 73
74 // OPEN Message (MultiProtocolExtension-CAPABILITY). 74 // OPEN Message (MultiProtocolExtension-CAPABILITY).
75 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 75 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -91,13 +91,13 @@ public class BGPOpenMsgTest { ...@@ -91,13 +91,13 @@ public class BGPOpenMsgTest {
91 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 91 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
92 buffer.writeBytes(openMsg); 92 buffer.writeBytes(openMsg);
93 93
94 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 94 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
95 - BGPMessage message; 95 + BgpMessage message;
96 - BGPHeader bgpHeader = new BGPHeader(); 96 + BgpHeader bgpHeader = new BgpHeader();
97 97
98 message = reader.readFrom(buffer, bgpHeader); 98 message = reader.readFrom(buffer, bgpHeader);
99 99
100 - assertThat(message, instanceOf(BGPOpenMsg.class)); 100 + assertThat(message, instanceOf(BgpOpenMsg.class));
101 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 101 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
102 message.writeTo(buf); 102 message.writeTo(buf);
103 103
...@@ -113,7 +113,7 @@ public class BGPOpenMsgTest { ...@@ -113,7 +113,7 @@ public class BGPOpenMsgTest {
113 * capability. 113 * capability.
114 */ 114 */
115 @Test 115 @Test
116 - public void openMessageTest3() throws BGPParseException { 116 + public void openMessageTest3() throws BgpParseException {
117 117
118 // OPEN Message (Four-Octet AS number capability). 118 // OPEN Message (Four-Octet AS number capability).
119 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 119 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -135,13 +135,13 @@ public class BGPOpenMsgTest { ...@@ -135,13 +135,13 @@ public class BGPOpenMsgTest {
135 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 135 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
136 buffer.writeBytes(openMsg); 136 buffer.writeBytes(openMsg);
137 137
138 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 138 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
139 - BGPMessage message; 139 + BgpMessage message;
140 - BGPHeader bgpHeader = new BGPHeader(); 140 + BgpHeader bgpHeader = new BgpHeader();
141 141
142 message = reader.readFrom(buffer, bgpHeader); 142 message = reader.readFrom(buffer, bgpHeader);
143 143
144 - assertThat(message, instanceOf(BGPOpenMsg.class)); 144 + assertThat(message, instanceOf(BgpOpenMsg.class));
145 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 145 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
146 message.writeTo(buf); 146 message.writeTo(buf);
147 147
...@@ -156,7 +156,7 @@ public class BGPOpenMsgTest { ...@@ -156,7 +156,7 @@ public class BGPOpenMsgTest {
156 * This test case checks open message with capabilities. 156 * This test case checks open message with capabilities.
157 */ 157 */
158 @Test 158 @Test
159 - public void openMessageTest4() throws BGPParseException { 159 + public void openMessageTest4() throws BgpParseException {
160 160
161 // OPEN Message with capabilities. 161 // OPEN Message with capabilities.
162 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 162 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -178,13 +178,13 @@ public class BGPOpenMsgTest { ...@@ -178,13 +178,13 @@ public class BGPOpenMsgTest {
178 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 178 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
179 buffer.writeBytes(openMsg); 179 buffer.writeBytes(openMsg);
180 180
181 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 181 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
182 - BGPMessage message; 182 + BgpMessage message;
183 - BGPHeader bgpHeader = new BGPHeader(); 183 + BgpHeader bgpHeader = new BgpHeader();
184 184
185 message = reader.readFrom(buffer, bgpHeader); 185 message = reader.readFrom(buffer, bgpHeader);
186 186
187 - assertThat(message, instanceOf(BGPOpenMsg.class)); 187 + assertThat(message, instanceOf(BgpOpenMsg.class));
188 188
189 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 189 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
190 message.writeTo(buf); 190 message.writeTo(buf);
...@@ -200,8 +200,8 @@ public class BGPOpenMsgTest { ...@@ -200,8 +200,8 @@ public class BGPOpenMsgTest {
200 * In this test case, Invalid version is given as input and expecting 200 * In this test case, Invalid version is given as input and expecting
201 * an exception. 201 * an exception.
202 */ 202 */
203 - @Test(expected = BGPParseException.class) 203 + @Test(expected = BgpParseException.class)
204 - public void openMessageTest5() throws BGPParseException { 204 + public void openMessageTest5() throws BgpParseException {
205 205
206 // OPEN Message with invalid version number. 206 // OPEN Message with invalid version number.
207 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 207 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -217,20 +217,20 @@ public class BGPOpenMsgTest { ...@@ -217,20 +217,20 @@ public class BGPOpenMsgTest {
217 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 217 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
218 buffer.writeBytes(openMsg); 218 buffer.writeBytes(openMsg);
219 219
220 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 220 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
221 - BGPMessage message; 221 + BgpMessage message;
222 - BGPHeader bgpHeader = new BGPHeader(); 222 + BgpHeader bgpHeader = new BgpHeader();
223 message = reader.readFrom(buffer, bgpHeader); 223 message = reader.readFrom(buffer, bgpHeader);
224 224
225 - assertThat(message, instanceOf(BGPOpenMsg.class)); 225 + assertThat(message, instanceOf(BgpOpenMsg.class));
226 } 226 }
227 227
228 /** 228 /**
229 * In this test case, Marker is set as 0 in input and expecting 229 * In this test case, Marker is set as 0 in input and expecting
230 * an exception. 230 * an exception.
231 */ 231 */
232 - @Test(expected = BGPParseException.class) 232 + @Test(expected = BgpParseException.class)
233 - public void openMessageTest6() throws BGPParseException { 233 + public void openMessageTest6() throws BgpParseException {
234 234
235 // OPEN Message with marker set to 0. 235 // OPEN Message with marker set to 0.
236 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 236 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -246,20 +246,20 @@ public class BGPOpenMsgTest { ...@@ -246,20 +246,20 @@ public class BGPOpenMsgTest {
246 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 246 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
247 buffer.writeBytes(openMsg); 247 buffer.writeBytes(openMsg);
248 248
249 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 249 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
250 - BGPMessage message; 250 + BgpMessage message;
251 - BGPHeader bgpHeader = new BGPHeader(); 251 + BgpHeader bgpHeader = new BgpHeader();
252 message = reader.readFrom(buffer, bgpHeader); 252 message = reader.readFrom(buffer, bgpHeader);
253 253
254 - assertThat(message, instanceOf(BGPOpenMsg.class)); 254 + assertThat(message, instanceOf(BgpOpenMsg.class));
255 } 255 }
256 256
257 /** 257 /**
258 * In this test case, Invalid message length is given as input and expecting 258 * In this test case, Invalid message length is given as input and expecting
259 * an exception. 259 * an exception.
260 */ 260 */
261 - @Test(expected = BGPParseException.class) 261 + @Test(expected = BgpParseException.class)
262 - public void openMessageTest7() throws BGPParseException { 262 + public void openMessageTest7() throws BgpParseException {
263 263
264 // OPEN Message with invalid header length. 264 // OPEN Message with invalid header length.
265 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 265 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -275,20 +275,20 @@ public class BGPOpenMsgTest { ...@@ -275,20 +275,20 @@ public class BGPOpenMsgTest {
275 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 275 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
276 buffer.writeBytes(openMsg); 276 buffer.writeBytes(openMsg);
277 277
278 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 278 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
279 - BGPMessage message; 279 + BgpMessage message;
280 - BGPHeader bgpHeader = new BGPHeader(); 280 + BgpHeader bgpHeader = new BgpHeader();
281 message = reader.readFrom(buffer, bgpHeader); 281 message = reader.readFrom(buffer, bgpHeader);
282 282
283 - assertThat(message, instanceOf(BGPOpenMsg.class)); 283 + assertThat(message, instanceOf(BgpOpenMsg.class));
284 } 284 }
285 285
286 /** 286 /**
287 * In this test case, Invalid message type is given as input and expecting 287 * In this test case, Invalid message type is given as input and expecting
288 * an exception. 288 * an exception.
289 */ 289 */
290 - @Test(expected = BGPParseException.class) 290 + @Test(expected = BgpParseException.class)
291 - public void openMessageTest8() throws BGPParseException { 291 + public void openMessageTest8() throws BgpParseException {
292 292
293 // OPEN Message with invalid message type. 293 // OPEN Message with invalid message type.
294 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, 294 byte[] openMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff,
...@@ -304,11 +304,11 @@ public class BGPOpenMsgTest { ...@@ -304,11 +304,11 @@ public class BGPOpenMsgTest {
304 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 304 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
305 buffer.writeBytes(openMsg); 305 buffer.writeBytes(openMsg);
306 306
307 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 307 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
308 - BGPMessage message; 308 + BgpMessage message;
309 - BGPHeader bgpHeader = new BGPHeader(); 309 + BgpHeader bgpHeader = new BgpHeader();
310 message = reader.readFrom(buffer, bgpHeader); 310 message = reader.readFrom(buffer, bgpHeader);
311 311
312 - assertThat(message, instanceOf(BGPOpenMsg.class)); 312 + assertThat(message, instanceOf(BgpOpenMsg.class));
313 } 313 }
314 } 314 }
......
...@@ -22,12 +22,12 @@ import com.google.common.testing.EqualsTester; ...@@ -22,12 +22,12 @@ import com.google.common.testing.EqualsTester;
22 /** 22 /**
23 * Test for BGPLSIdentifier Tlv. 23 * Test for BGPLSIdentifier Tlv.
24 */ 24 */
25 -public class BGPLSIdentifierTest { 25 +public class BgpLSIdentifierTest {
26 private final int value1 = 8738; 26 private final int value1 = 8738;
27 private final int value2 = 13107; 27 private final int value2 = 13107;
28 - private final BGPLSIdentifierTlv tlv1 = BGPLSIdentifierTlv.of(value1); 28 + private final BgpLSIdentifierTlv tlv1 = BgpLSIdentifierTlv.of(value1);
29 - private final BGPLSIdentifierTlv sameAsTlv1 = new BGPLSIdentifierTlv(value1); 29 + private final BgpLSIdentifierTlv sameAsTlv1 = new BgpLSIdentifierTlv(value1);
30 - private final BGPLSIdentifierTlv tlv2 = new BGPLSIdentifierTlv(value2); 30 + private final BgpLSIdentifierTlv tlv2 = new BgpLSIdentifierTlv(value2);
31 31
32 @Test 32 @Test
33 public void basics() { 33 public void basics() {
......
...@@ -13,10 +13,9 @@ ...@@ -13,10 +13,9 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.bgpio; 16 +package org.onosproject.bgpio.types;
17 17
18 import org.junit.Test; 18 import org.junit.Test;
19 -import org.onosproject.bgpio.types.LocalPref;
20 19
21 import com.google.common.testing.EqualsTester; 20 import com.google.common.testing.EqualsTester;
22 21
...@@ -32,9 +31,6 @@ public class LocalPrefTest { ...@@ -32,9 +31,6 @@ public class LocalPrefTest {
32 31
33 @Test 32 @Test
34 public void testEquality() { 33 public void testEquality() {
35 - new EqualsTester() 34 + new EqualsTester().addEqualityGroup(attr1, sameAsAttr1).addEqualityGroup(attr2).testEquals();
36 - .addEqualityGroup(attr1, sameAsAttr1)
37 - .addEqualityGroup(attr2)
38 - .testEquals();
39 } 35 }
40 } 36 }
......
...@@ -13,10 +13,9 @@ ...@@ -13,10 +13,9 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.bgpio; 16 +package org.onosproject.bgpio.types;
17 17
18 import org.junit.Test; 18 import org.junit.Test;
19 -import org.onosproject.bgpio.types.Med;
20 19
21 import com.google.common.testing.EqualsTester; 20 import com.google.common.testing.EqualsTester;
22 21
...@@ -32,9 +31,6 @@ public class MedTest { ...@@ -32,9 +31,6 @@ public class MedTest {
32 31
33 @Test 32 @Test
34 public void testEquality() { 33 public void testEquality() {
35 - new EqualsTester() 34 + new EqualsTester().addEqualityGroup(attr1, sameAsAttr1).addEqualityGroup(attr2).testEquals();
36 - .addEqualityGroup(attr1, sameAsAttr1)
37 - .addEqualityGroup(attr2)
38 - .testEquals();
39 } 35 }
40 } 36 }
......
...@@ -19,13 +19,13 @@ package org.onosproject.bgp.controller.impl; ...@@ -19,13 +19,13 @@ package org.onosproject.bgp.controller.impl;
19 import java.util.Map; 19 import java.util.Map;
20 import java.util.TreeMap; 20 import java.util.TreeMap;
21 21
22 -import org.onosproject.bgpio.protocol.BGPLSNlri; 22 +import org.onosproject.bgpio.protocol.BgpLSNlri;
23 -import org.onosproject.bgpio.protocol.linkstate.BGPLinkLSIdentifier; 23 +import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier;
24 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 24 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
25 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSIdentifier; 25 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier;
26 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 26 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
27 -import org.onosproject.bgpio.protocol.linkstate.BGPPrefixIPv4LSNlriVer4; 27 +import org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4;
28 -import org.onosproject.bgpio.protocol.linkstate.BGPPrefixLSIdentifier; 28 +import org.onosproject.bgpio.protocol.linkstate.BgpPrefixLSIdentifier;
29 import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; 29 import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
30 30
31 import com.google.common.base.MoreObjects; 31 import com.google.common.base.MoreObjects;
...@@ -34,16 +34,16 @@ import com.google.common.base.MoreObjects; ...@@ -34,16 +34,16 @@ import com.google.common.base.MoreObjects;
34 * Implementation of Adj-RIB-In for each peer. 34 * Implementation of Adj-RIB-In for each peer.
35 */ 35 */
36 public class AdjRibIn { 36 public class AdjRibIn {
37 - private Map<BGPNodeLSIdentifier, PathAttrNlriDetails> nodeTree = new TreeMap<>(); 37 + private Map<BgpNodeLSIdentifier, PathAttrNlriDetails> nodeTree = new TreeMap<>();
38 - private Map<BGPLinkLSIdentifier, PathAttrNlriDetails> linkTree = new TreeMap<>(); 38 + private Map<BgpLinkLSIdentifier, PathAttrNlriDetails> linkTree = new TreeMap<>();
39 - private Map<BGPPrefixLSIdentifier, PathAttrNlriDetails> prefixTree = new TreeMap<>(); 39 + private Map<BgpPrefixLSIdentifier, PathAttrNlriDetails> prefixTree = new TreeMap<>();
40 40
41 /** 41 /**
42 * Returns the adjacency node. 42 * Returns the adjacency node.
43 * 43 *
44 * @return node adjacency RIB node 44 * @return node adjacency RIB node
45 */ 45 */
46 - public Map<BGPNodeLSIdentifier, PathAttrNlriDetails> nodeTree() { 46 + public Map<BgpNodeLSIdentifier, PathAttrNlriDetails> nodeTree() {
47 return nodeTree; 47 return nodeTree;
48 } 48 }
49 49
...@@ -52,7 +52,7 @@ public class AdjRibIn { ...@@ -52,7 +52,7 @@ public class AdjRibIn {
52 * 52 *
53 * @return link adjacency RIB node 53 * @return link adjacency RIB node
54 */ 54 */
55 - public Map<BGPLinkLSIdentifier, PathAttrNlriDetails> linkTree() { 55 + public Map<BgpLinkLSIdentifier, PathAttrNlriDetails> linkTree() {
56 return linkTree; 56 return linkTree;
57 } 57 }
58 58
...@@ -61,7 +61,7 @@ public class AdjRibIn { ...@@ -61,7 +61,7 @@ public class AdjRibIn {
61 * 61 *
62 * @return prefix adjacency RIB node 62 * @return prefix adjacency RIB node
63 */ 63 */
64 - public Map<BGPPrefixLSIdentifier, PathAttrNlriDetails> prefixTree() { 64 + public Map<BgpPrefixLSIdentifier, PathAttrNlriDetails> prefixTree() {
65 return prefixTree; 65 return prefixTree;
66 } 66 }
67 67
...@@ -71,23 +71,23 @@ public class AdjRibIn { ...@@ -71,23 +71,23 @@ public class AdjRibIn {
71 * @param nlri NLRI Info 71 * @param nlri NLRI Info
72 * @param details has pathattribute , protocolID and identifier 72 * @param details has pathattribute , protocolID and identifier
73 */ 73 */
74 - public void add(BGPLSNlri nlri, PathAttrNlriDetails details) { 74 + public void add(BgpLSNlri nlri, PathAttrNlriDetails details) {
75 - if (nlri instanceof BGPNodeLSNlriVer4) { 75 + if (nlri instanceof BgpNodeLSNlriVer4) {
76 - BGPNodeLSIdentifier nodeLSIdentifier = ((BGPNodeLSNlriVer4) nlri).getLocalNodeDescriptors(); 76 + BgpNodeLSIdentifier nodeLSIdentifier = ((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors();
77 if (nodeTree.containsKey(nodeLSIdentifier)) { 77 if (nodeTree.containsKey(nodeLSIdentifier)) {
78 nodeTree.replace(nodeLSIdentifier, details); 78 nodeTree.replace(nodeLSIdentifier, details);
79 } else { 79 } else {
80 nodeTree.put(nodeLSIdentifier, details); 80 nodeTree.put(nodeLSIdentifier, details);
81 } 81 }
82 } else if (nlri instanceof BgpLinkLsNlriVer4) { 82 } else if (nlri instanceof BgpLinkLsNlriVer4) {
83 - BGPLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier(); 83 + BgpLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier();
84 if (linkTree.containsKey(linkLSIdentifier)) { 84 if (linkTree.containsKey(linkLSIdentifier)) {
85 linkTree.replace(linkLSIdentifier, details); 85 linkTree.replace(linkLSIdentifier, details);
86 } else { 86 } else {
87 linkTree.put(linkLSIdentifier, details); 87 linkTree.put(linkLSIdentifier, details);
88 } 88 }
89 - } else if (nlri instanceof BGPPrefixIPv4LSNlriVer4) { 89 + } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) {
90 - BGPPrefixLSIdentifier prefixIdentifier = ((BGPPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier(); 90 + BgpPrefixLSIdentifier prefixIdentifier = ((BgpPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier();
91 if (prefixTree.containsKey(prefixIdentifier)) { 91 if (prefixTree.containsKey(prefixIdentifier)) {
92 prefixTree.replace(prefixIdentifier, details); 92 prefixTree.replace(prefixIdentifier, details);
93 } else { 93 } else {
...@@ -101,19 +101,19 @@ public class AdjRibIn { ...@@ -101,19 +101,19 @@ public class AdjRibIn {
101 * 101 *
102 * @param nlri NLRI Info 102 * @param nlri NLRI Info
103 */ 103 */
104 - public void remove(BGPLSNlri nlri) { 104 + public void remove(BgpLSNlri nlri) {
105 - if (nlri instanceof BGPNodeLSNlriVer4) { 105 + if (nlri instanceof BgpNodeLSNlriVer4) {
106 - BGPNodeLSIdentifier nodeLSIdentifier = ((BGPNodeLSNlriVer4) nlri).getLocalNodeDescriptors(); 106 + BgpNodeLSIdentifier nodeLSIdentifier = ((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors();
107 if (nodeTree.containsKey(nodeLSIdentifier)) { 107 if (nodeTree.containsKey(nodeLSIdentifier)) {
108 nodeTree.remove(nodeLSIdentifier); 108 nodeTree.remove(nodeLSIdentifier);
109 } 109 }
110 } else if (nlri instanceof BgpLinkLsNlriVer4) { 110 } else if (nlri instanceof BgpLinkLsNlriVer4) {
111 - BGPLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier(); 111 + BgpLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier();
112 if (linkTree.containsKey(linkLSIdentifier)) { 112 if (linkTree.containsKey(linkLSIdentifier)) {
113 linkTree.remove(linkLSIdentifier); 113 linkTree.remove(linkLSIdentifier);
114 } 114 }
115 - } else if (nlri instanceof BGPPrefixIPv4LSNlriVer4) { 115 + } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) {
116 - BGPPrefixLSIdentifier prefixIdentifier = ((BGPPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier(); 116 + BgpPrefixLSIdentifier prefixIdentifier = ((BgpPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier();
117 if (prefixTree.containsKey(prefixIdentifier)) { 117 if (prefixTree.containsKey(prefixIdentifier)) {
118 prefixTree.remove(prefixIdentifier); 118 prefixTree.remove(prefixIdentifier);
119 } 119 }
......
...@@ -40,20 +40,20 @@ import org.jboss.netty.handler.timeout.ReadTimeoutException; ...@@ -40,20 +40,20 @@ import org.jboss.netty.handler.timeout.ReadTimeoutException;
40 import org.jboss.netty.handler.timeout.ReadTimeoutHandler; 40 import org.jboss.netty.handler.timeout.ReadTimeoutHandler;
41 import org.onlab.packet.Ip4Address; 41 import org.onlab.packet.Ip4Address;
42 import org.onlab.packet.IpAddress; 42 import org.onlab.packet.IpAddress;
43 -import org.onosproject.bgp.controller.BGPCfg; 43 +import org.onosproject.bgp.controller.BgpCfg;
44 -import org.onosproject.bgp.controller.BGPController; 44 +import org.onosproject.bgp.controller.BgpController;
45 -import org.onosproject.bgp.controller.BGPId; 45 +import org.onosproject.bgp.controller.BgpId;
46 -import org.onosproject.bgp.controller.BGPPeer; 46 +import org.onosproject.bgp.controller.BgpPeer;
47 -import org.onosproject.bgp.controller.BGPPeerCfg; 47 +import org.onosproject.bgp.controller.BgpPeerCfg;
48 -import org.onosproject.bgp.controller.impl.BGPControllerImpl.BGPPeerManagerImpl; 48 +import org.onosproject.bgp.controller.impl.BgpControllerImpl.BgpPeerManagerImpl;
49 -import org.onosproject.bgpio.exceptions.BGPParseException; 49 +import org.onosproject.bgpio.exceptions.BgpParseException;
50 -import org.onosproject.bgpio.protocol.BGPFactory; 50 +import org.onosproject.bgpio.protocol.BgpFactory;
51 -import org.onosproject.bgpio.protocol.BGPMessage; 51 +import org.onosproject.bgpio.protocol.BgpMessage;
52 -import org.onosproject.bgpio.protocol.BGPOpenMsg; 52 +import org.onosproject.bgpio.protocol.BgpOpenMsg;
53 -import org.onosproject.bgpio.protocol.BGPType; 53 +import org.onosproject.bgpio.protocol.BgpType;
54 -import org.onosproject.bgpio.protocol.BGPVersion; 54 +import org.onosproject.bgpio.protocol.BgpVersion;
55 -import org.onosproject.bgpio.types.BGPErrorType; 55 +import org.onosproject.bgpio.types.BgpErrorType;
56 -import org.onosproject.bgpio.types.BGPValueType; 56 +import org.onosproject.bgpio.types.BgpValueType;
57 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv; 57 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv;
58 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv; 58 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv;
59 import org.slf4j.Logger; 59 import org.slf4j.Logger;
...@@ -62,20 +62,20 @@ import org.slf4j.LoggerFactory; ...@@ -62,20 +62,20 @@ import org.slf4j.LoggerFactory;
62 /** 62 /**
63 * Channel handler deals with the bgp peer connection and dispatches messages from peer to the appropriate locations. 63 * Channel handler deals with the bgp peer connection and dispatches messages from peer to the appropriate locations.
64 */ 64 */
65 -class BGPChannelHandler extends IdleStateAwareChannelHandler { 65 +class BgpChannelHandler extends IdleStateAwareChannelHandler {
66 66
67 - private static final Logger log = LoggerFactory.getLogger(BGPChannelHandler.class); 67 + private static final Logger log = LoggerFactory.getLogger(BgpChannelHandler.class);
68 static final int BGP_MIN_HOLDTIME = 3; 68 static final int BGP_MIN_HOLDTIME = 3;
69 static final int BGP_MAX_KEEPALIVE_INTERVAL = 3; 69 static final int BGP_MAX_KEEPALIVE_INTERVAL = 3;
70 - private BGPPeer bgpPeer; 70 + private BgpPeer bgpPeer;
71 - private BGPId thisbgpId; 71 + private BgpId thisbgpId;
72 private Channel channel; 72 private Channel channel;
73 - private BGPKeepAliveTimer keepAliveTimer = null; 73 + private BgpKeepAliveTimer keepAliveTimer = null;
74 private short peerHoldTime = 0; 74 private short peerHoldTime = 0;
75 private short negotiatedHoldTime = 0; 75 private short negotiatedHoldTime = 0;
76 private long peerAsNum; 76 private long peerAsNum;
77 private int peerIdentifier; 77 private int peerIdentifier;
78 - private BGPPacketStatsImpl bgpPacketStats; 78 + private BgpPacketStatsImpl bgpPacketStats;
79 static final int MAX_WRONG_COUNT_PACKET = 5; 79 static final int MAX_WRONG_COUNT_PACKET = 5;
80 static final byte MULTI_PROTOCOL_EXTN_CAPA_TYPE = 1; 80 static final byte MULTI_PROTOCOL_EXTN_CAPA_TYPE = 1;
81 static final byte FOUR_OCTET_AS_NUM_CAPA_TYPE = 65; 81 static final byte FOUR_OCTET_AS_NUM_CAPA_TYPE = 65;
...@@ -97,30 +97,30 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -97,30 +97,30 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
97 // peer state for the older (still connected) peer 97 // peer state for the older (still connected) peer
98 private volatile Boolean duplicateBGPIdFound; 98 private volatile Boolean duplicateBGPIdFound;
99 // Indicates the bgp version used by this bgp peer 99 // Indicates the bgp version used by this bgp peer
100 - protected BGPVersion bgpVersion; 100 + protected BgpVersion bgpVersion;
101 - private BGPController bgpController; 101 + private BgpController bgpController;
102 - protected BGPFactory factory4; 102 + protected BgpFactory factory4;
103 private boolean isIbgpSession; 103 private boolean isIbgpSession;
104 private BgpSessionInfoImpl sessionInfo; 104 private BgpSessionInfoImpl sessionInfo;
105 - private BGPPeerManagerImpl peerManager; 105 + private BgpPeerManagerImpl peerManager;
106 private InetSocketAddress inetAddress; 106 private InetSocketAddress inetAddress;
107 private IpAddress ipAddress; 107 private IpAddress ipAddress;
108 private SocketAddress address; 108 private SocketAddress address;
109 private String peerAddr; 109 private String peerAddr;
110 - private BGPCfg bgpconfig; 110 + private BgpCfg bgpconfig;
111 111
112 /** 112 /**
113 * Create a new unconnected BGPChannelHandler. 113 * Create a new unconnected BGPChannelHandler.
114 * 114 *
115 * @param bgpController bgp controller 115 * @param bgpController bgp controller
116 */ 116 */
117 - BGPChannelHandler(BGPController bgpController) { 117 + BgpChannelHandler(BgpController bgpController) {
118 this.bgpController = bgpController; 118 this.bgpController = bgpController;
119 - this.peerManager = (BGPPeerManagerImpl) bgpController.peerManager(); 119 + this.peerManager = (BgpPeerManagerImpl) bgpController.peerManager();
120 this.state = ChannelState.IDLE; 120 this.state = ChannelState.IDLE;
121 - this.factory4 = Controller.getBGPMessageFactory4(); 121 + this.factory4 = Controller.getBgpMessageFactory4();
122 this.duplicateBGPIdFound = Boolean.FALSE; 122 this.duplicateBGPIdFound = Boolean.FALSE;
123 - this.bgpPacketStats = new BGPPacketStatsImpl(); 123 + this.bgpPacketStats = new BgpPacketStatsImpl();
124 this.bgpconfig = bgpController.getConfig(); 124 this.bgpconfig = bgpController.getConfig();
125 } 125 }
126 126
...@@ -147,25 +147,25 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -147,25 +147,25 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
147 147
148 OPENSENT(false) { 148 OPENSENT(false) {
149 @Override 149 @Override
150 - void processBGPMessage(BGPChannelHandler h, BGPMessage m) throws IOException, BGPParseException { 150 + void processBgpMessage(BgpChannelHandler h, BgpMessage m) throws IOException, BgpParseException {
151 log.debug("message received in OPENSENT state"); 151 log.debug("message received in OPENSENT state");
152 // check for OPEN message 152 // check for OPEN message
153 - if (m.getType() != BGPType.OPEN) { 153 + if (m.getType() != BgpType.OPEN) {
154 // When the message type is not keep alive message increment the wrong packet statistics 154 // When the message type is not keep alive message increment the wrong packet statistics
155 - h.processUnknownMsg(BGPErrorType.FINITE_STATE_MACHINE_ERROR, 155 + h.processUnknownMsg(BgpErrorType.FINITE_STATE_MACHINE_ERROR,
156 - BGPErrorType.RECEIVE_UNEXPECTED_MESSAGE_IN_OPENSENT_STATE, 156 + BgpErrorType.RECEIVE_UNEXPECTED_MESSAGE_IN_OPENSENT_STATE,
157 m.getType().getType()); 157 m.getType().getType());
158 log.debug("Message is not OPEN message"); 158 log.debug("Message is not OPEN message");
159 } else { 159 } else {
160 log.debug("Sending keep alive message in OPENSENT state"); 160 log.debug("Sending keep alive message in OPENSENT state");
161 h.bgpPacketStats.addInPacket(); 161 h.bgpPacketStats.addInPacket();
162 162
163 - BGPOpenMsg pOpenmsg = (BGPOpenMsg) m; 163 + BgpOpenMsg pOpenmsg = (BgpOpenMsg) m;
164 h.peerIdentifier = pOpenmsg.getBgpId(); 164 h.peerIdentifier = pOpenmsg.getBgpId();
165 165
166 // validate capabilities and open msg 166 // validate capabilities and open msg
167 if (h.openMsgValidation(h, pOpenmsg)) { 167 if (h.openMsgValidation(h, pOpenmsg)) {
168 - if (h.connectionCollisionDetection(BGPPeerCfg.State.OPENCONFIRM, 168 + if (h.connectionCollisionDetection(BgpPeerCfg.State.OPENCONFIRM,
169 h.peerIdentifier, h.peerAddr)) { 169 h.peerIdentifier, h.peerAddr)) {
170 h.channel.close(); 170 h.channel.close();
171 return; 171 return;
...@@ -181,7 +181,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -181,7 +181,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
181 if (h.peerHoldTime < h.bgpconfig.getHoldTime()) { 181 if (h.peerHoldTime < h.bgpconfig.getHoldTime()) {
182 h.channel.getPipeline().replace("holdTime", 182 h.channel.getPipeline().replace("holdTime",
183 "holdTime", 183 "holdTime",
184 - new ReadTimeoutHandler(BGPPipelineFactory.TIMER, 184 + new ReadTimeoutHandler(BgpPipelineFactory.TIMER,
185 h.peerHoldTime)); 185 h.peerHoldTime));
186 } 186 }
187 187
...@@ -195,31 +195,31 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -195,31 +195,31 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
195 h.sendKeepAliveMessage(); 195 h.sendKeepAliveMessage();
196 h.bgpPacketStats.addOutPacket(); 196 h.bgpPacketStats.addOutPacket();
197 h.setState(OPENCONFIRM); 197 h.setState(OPENCONFIRM);
198 - h.bgpconfig.setPeerConnState(h.peerAddr, BGPPeerCfg.State.OPENCONFIRM); 198 + h.bgpconfig.setPeerConnState(h.peerAddr, BgpPeerCfg.State.OPENCONFIRM);
199 } 199 }
200 } 200 }
201 }, 201 },
202 202
203 OPENWAIT(false) { 203 OPENWAIT(false) {
204 @Override 204 @Override
205 - void processBGPMessage(BGPChannelHandler h, BGPMessage m) throws IOException, BGPParseException { 205 + void processBgpMessage(BgpChannelHandler h, BgpMessage m) throws IOException, BgpParseException {
206 log.debug("Message received in OPEN WAIT State"); 206 log.debug("Message received in OPEN WAIT State");
207 207
208 // check for open message 208 // check for open message
209 - if (m.getType() != BGPType.OPEN) { 209 + if (m.getType() != BgpType.OPEN) {
210 // When the message type is not open message increment the wrong packet statistics 210 // When the message type is not open message increment the wrong packet statistics
211 - h.processUnknownMsg(BGPErrorType.FINITE_STATE_MACHINE_ERROR, BGPErrorType.UNSPECIFIED_ERROR, 211 + h.processUnknownMsg(BgpErrorType.FINITE_STATE_MACHINE_ERROR, BgpErrorType.UNSPECIFIED_ERROR,
212 m.getType().getType()); 212 m.getType().getType());
213 log.debug("Message is not OPEN message"); 213 log.debug("Message is not OPEN message");
214 } else { 214 } else {
215 h.bgpPacketStats.addInPacket(); 215 h.bgpPacketStats.addInPacket();
216 216
217 - BGPOpenMsg pOpenmsg = (BGPOpenMsg) m; 217 + BgpOpenMsg pOpenmsg = (BgpOpenMsg) m;
218 h.peerIdentifier = pOpenmsg.getBgpId(); 218 h.peerIdentifier = pOpenmsg.getBgpId();
219 219
220 // Validate open message 220 // Validate open message
221 if (h.openMsgValidation(h, pOpenmsg)) { 221 if (h.openMsgValidation(h, pOpenmsg)) {
222 - if (h.connectionCollisionDetection(BGPPeerCfg.State.OPENSENT, 222 + if (h.connectionCollisionDetection(BgpPeerCfg.State.OPENSENT,
223 h.peerIdentifier, h.peerAddr)) { 223 h.peerIdentifier, h.peerAddr)) {
224 h.channel.close(); 224 h.channel.close();
225 return; 225 return;
...@@ -235,7 +235,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -235,7 +235,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
235 if (h.peerHoldTime < h.bgpconfig.getHoldTime()) { 235 if (h.peerHoldTime < h.bgpconfig.getHoldTime()) {
236 h.channel.getPipeline().replace("holdTime", 236 h.channel.getPipeline().replace("holdTime",
237 "holdTime", 237 "holdTime",
238 - new ReadTimeoutHandler(BGPPipelineFactory.TIMER, 238 + new ReadTimeoutHandler(BgpPipelineFactory.TIMER,
239 h.peerHoldTime)); 239 h.peerHoldTime));
240 } 240 }
241 241
...@@ -247,7 +247,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -247,7 +247,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
247 h.sendHandshakeOpenMessage(); 247 h.sendHandshakeOpenMessage();
248 h.bgpPacketStats.addOutPacket(); 248 h.bgpPacketStats.addOutPacket();
249 h.setState(OPENCONFIRM); 249 h.setState(OPENCONFIRM);
250 - h.bgpconfig.setPeerConnState(h.peerAddr, BGPPeerCfg.State.OPENCONFIRM); 250 + h.bgpconfig.setPeerConnState(h.peerAddr, BgpPeerCfg.State.OPENCONFIRM);
251 } 251 }
252 } 252 }
253 } 253 }
...@@ -255,13 +255,13 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -255,13 +255,13 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
255 255
256 OPENCONFIRM(false) { 256 OPENCONFIRM(false) {
257 @Override 257 @Override
258 - void processBGPMessage(BGPChannelHandler h, BGPMessage m) throws IOException, BGPParseException { 258 + void processBgpMessage(BgpChannelHandler h, BgpMessage m) throws IOException, BgpParseException {
259 log.debug("Message received in OPENCONFIRM state"); 259 log.debug("Message received in OPENCONFIRM state");
260 // check for keep alive message 260 // check for keep alive message
261 - if (m.getType() != BGPType.KEEP_ALIVE) { 261 + if (m.getType() != BgpType.KEEP_ALIVE) {
262 // When the message type is not keep alive message handle the wrong packet 262 // When the message type is not keep alive message handle the wrong packet
263 - h.processUnknownMsg(BGPErrorType.FINITE_STATE_MACHINE_ERROR, 263 + h.processUnknownMsg(BgpErrorType.FINITE_STATE_MACHINE_ERROR,
264 - BGPErrorType.RECEIVE_UNEXPECTED_MESSAGE_IN_OPENCONFIRM_STATE, 264 + BgpErrorType.RECEIVE_UNEXPECTED_MESSAGE_IN_OPENCONFIRM_STATE,
265 m.getType().getType()); 265 m.getType().getType());
266 log.debug("Message is not KEEPALIVE message"); 266 log.debug("Message is not KEEPALIVE message");
267 } else { 267 } else {
...@@ -271,7 +271,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -271,7 +271,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
271 log.debug("Sending keep alive message in OPENCONFIRM state"); 271 log.debug("Sending keep alive message in OPENCONFIRM state");
272 272
273 final InetSocketAddress inetAddress = (InetSocketAddress) h.address; 273 final InetSocketAddress inetAddress = (InetSocketAddress) h.address;
274 - h.thisbgpId = BGPId.bgpId(IpAddress.valueOf(inetAddress.getAddress())); 274 + h.thisbgpId = BgpId.bgpId(IpAddress.valueOf(inetAddress.getAddress()));
275 275
276 // set session parameters 276 // set session parameters
277 h.negotiatedHoldTime = (h.peerHoldTime < h.bgpconfig.getHoldTime()) ? h.peerHoldTime 277 h.negotiatedHoldTime = (h.peerHoldTime < h.bgpconfig.getHoldTime()) ? h.peerHoldTime
...@@ -279,7 +279,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -279,7 +279,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
279 h.sessionInfo = new BgpSessionInfoImpl(h.thisbgpId, h.bgpVersion, h.peerAsNum, h.peerHoldTime, 279 h.sessionInfo = new BgpSessionInfoImpl(h.thisbgpId, h.bgpVersion, h.peerAsNum, h.peerHoldTime,
280 h.peerIdentifier, h.negotiatedHoldTime, h.isIbgpSession); 280 h.peerIdentifier, h.negotiatedHoldTime, h.isIbgpSession);
281 281
282 - h.bgpPeer = h.peerManager.getBGPPeerInstance(h.bgpController, h.sessionInfo, h.bgpPacketStats); 282 + h.bgpPeer = h.peerManager.getBgpPeerInstance(h.bgpController, h.sessionInfo, h.bgpPacketStats);
283 // set the status of bgp as connected 283 // set the status of bgp as connected
284 h.bgpPeer.setConnected(true); 284 h.bgpPeer.setConnected(true);
285 h.bgpPeer.setChannel(h.channel); 285 h.bgpPeer.setChannel(h.channel);
...@@ -291,7 +291,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -291,7 +291,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
291 */ 291 */
292 292
293 if (h.negotiatedHoldTime != 0) { 293 if (h.negotiatedHoldTime != 0) {
294 - h.keepAliveTimer = new BGPKeepAliveTimer(h, 294 + h.keepAliveTimer = new BgpKeepAliveTimer(h,
295 (h.negotiatedHoldTime / BGP_MAX_KEEPALIVE_INTERVAL)); 295 (h.negotiatedHoldTime / BGP_MAX_KEEPALIVE_INTERVAL));
296 } else { 296 } else {
297 h.sendKeepAliveMessage(); 297 h.sendKeepAliveMessage();
...@@ -306,7 +306,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -306,7 +306,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
306 disconnectDuplicate(h); 306 disconnectDuplicate(h);
307 } else { 307 } else {
308 h.setState(ESTABLISHED); 308 h.setState(ESTABLISHED);
309 - h.bgpconfig.setPeerConnState(h.peerAddr, BGPPeerCfg.State.ESTABLISHED); 309 + h.bgpconfig.setPeerConnState(h.peerAddr, BgpPeerCfg.State.ESTABLISHED);
310 } 310 }
311 } 311 }
312 } 312 }
...@@ -314,7 +314,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -314,7 +314,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
314 314
315 ESTABLISHED(true) { 315 ESTABLISHED(true) {
316 @Override 316 @Override
317 - void processBGPMessage(BGPChannelHandler h, BGPMessage m) throws IOException, BGPParseException { 317 + void processBgpMessage(BgpChannelHandler h, BgpMessage m) throws IOException, BgpParseException {
318 log.debug("Message received in established state " + m.getType()); 318 log.debug("Message received in established state " + m.getType());
319 // dispatch the message 319 // dispatch the message
320 h.dispatchMessage(m); 320 h.dispatchMessage(m);
...@@ -341,7 +341,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -341,7 +341,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
341 * 341 *
342 * @param h channel handler 342 * @param h channel handler
343 */ 343 */
344 - protected void disconnectDuplicate(BGPChannelHandler h) { 344 + protected void disconnectDuplicate(BgpChannelHandler h) {
345 log.error("Duplicated BGP IP or incompleted cleanup - " + "" + "disconnecting channel {}", 345 log.error("Duplicated BGP IP or incompleted cleanup - " + "" + "disconnecting channel {}",
346 h.getPeerInfoString()); 346 h.getPeerInfoString());
347 h.duplicateBGPIdFound = Boolean.TRUE; 347 h.duplicateBGPIdFound = Boolean.TRUE;
...@@ -353,8 +353,8 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -353,8 +353,8 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
353 this.handshakeComplete = handshakeComplete; 353 this.handshakeComplete = handshakeComplete;
354 } 354 }
355 355
356 - void processBGPMessage(BGPChannelHandler bgpChannelHandler, BGPMessage pm) 356 + void processBgpMessage(BgpChannelHandler bgpChannelHandler, BgpMessage pm)
357 - throws IOException, BGPParseException { 357 + throws IOException, BgpParseException {
358 // TODO Auto-generated method stub 358 // TODO Auto-generated method stub
359 log.debug("BGP message stub"); 359 log.debug("BGP message stub");
360 } 360 }
...@@ -377,8 +377,8 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -377,8 +377,8 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
377 } 377 }
378 378
379 // Connection should establish only if local ip and Autonomous system number is configured. 379 // Connection should establish only if local ip and Autonomous system number is configured.
380 - if (bgpconfig.getState() != BGPCfg.State.IP_AS_CONFIGURED) { 380 + if (bgpconfig.getState() != BgpCfg.State.IP_AS_CONFIGURED) {
381 - sendNotification(BGPErrorType.CEASE, BGPErrorType.CONNECTION_REJECTED, null); 381 + sendNotification(BgpErrorType.CEASE, BgpErrorType.CONNECTION_REJECTED, null);
382 channel.close(); 382 channel.close();
383 log.info("BGP local AS and router ID not configured"); 383 log.info("BGP local AS and router ID not configured");
384 return; 384 return;
...@@ -390,13 +390,13 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -390,13 +390,13 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
390 // if peer is not configured disconnect session 390 // if peer is not configured disconnect session
391 if (!bgpconfig.isPeerConfigured(peerAddr)) { 391 if (!bgpconfig.isPeerConfigured(peerAddr)) {
392 log.debug("Peer is not configured {}", peerAddr); 392 log.debug("Peer is not configured {}", peerAddr);
393 - sendNotification(BGPErrorType.CEASE, BGPErrorType.CONNECTION_REJECTED, null); 393 + sendNotification(BgpErrorType.CEASE, BgpErrorType.CONNECTION_REJECTED, null);
394 channel.close(); 394 channel.close();
395 return; 395 return;
396 } 396 }
397 397
398 // if connection is already established close channel 398 // if connection is already established close channel
399 - if (peerManager.isPeerConnected(BGPId.bgpId(IpAddress.valueOf(peerAddr)))) { 399 + if (peerManager.isPeerConnected(BgpId.bgpId(IpAddress.valueOf(peerAddr)))) {
400 log.debug("Duplicate connection received, peer {}", peerAddr); 400 log.debug("Duplicate connection received, peer {}", peerAddr);
401 channel.close(); 401 channel.close();
402 return; 402 return;
...@@ -412,7 +412,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -412,7 +412,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
412 sendHandshakeOpenMessage(); 412 sendHandshakeOpenMessage();
413 bgpPacketStats.addOutPacket(); 413 bgpPacketStats.addOutPacket();
414 setState(ChannelState.OPENSENT); 414 setState(ChannelState.OPENSENT);
415 - bgpconfig.setPeerConnState(peerAddr, BGPPeerCfg.State.OPENSENT); 415 + bgpconfig.setPeerConnState(peerAddr, BgpPeerCfg.State.OPENSENT);
416 } 416 }
417 } 417 }
418 418
...@@ -446,20 +446,20 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -446,20 +446,20 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
446 // Retry connection if connection is lost to bgp speaker/peer 446 // Retry connection if connection is lost to bgp speaker/peer
447 if ((channel != null) && (null != channel.getPipeline().get("ActiveHandler"))) { 447 if ((channel != null) && (null != channel.getPipeline().get("ActiveHandler"))) {
448 BgpConnectPeerImpl connectPeer; 448 BgpConnectPeerImpl connectPeer;
449 - BGPPeerCfg.State peerCfgState; 449 + BgpPeerCfg.State peerCfgState;
450 450
451 peerCfgState = bgpconfig.getPeerConnState(peerAddr); 451 peerCfgState = bgpconfig.getPeerConnState(peerAddr);
452 // on session disconnect using configuration, do not retry 452 // on session disconnect using configuration, do not retry
453 - if (!peerCfgState.equals(BGPPeerCfg.State.IDLE)) { 453 + if (!peerCfgState.equals(BgpPeerCfg.State.IDLE)) {
454 log.debug("Connection reset by peer, retry, STATE:{}", peerCfgState); 454 log.debug("Connection reset by peer, retry, STATE:{}", peerCfgState);
455 - BGPPeerConfig peerConfig = (BGPPeerConfig) bgpconfig.displayPeers(peerAddr); 455 + BgpPeerConfig peerConfig = (BgpPeerConfig) bgpconfig.displayPeers(peerAddr);
456 456
457 - bgpconfig.setPeerConnState(peerAddr, BGPPeerCfg.State.IDLE); 457 + bgpconfig.setPeerConnState(peerAddr, BgpPeerCfg.State.IDLE);
458 connectPeer = new BgpConnectPeerImpl(bgpController, peerAddr, Controller.getBgpPortNum()); 458 connectPeer = new BgpConnectPeerImpl(bgpController, peerAddr, Controller.getBgpPortNum());
459 peerConfig.setConnectPeer(connectPeer); 459 peerConfig.setConnectPeer(connectPeer);
460 } 460 }
461 } else { 461 } else {
462 - bgpconfig.setPeerConnState(peerAddr, BGPPeerCfg.State.IDLE); 462 + bgpconfig.setPeerConnState(peerAddr, BgpPeerCfg.State.IDLE);
463 } 463 }
464 } else { 464 } else {
465 // A duplicate was disconnected on this ChannelHandler, 465 // A duplicate was disconnected on this ChannelHandler,
...@@ -473,7 +473,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -473,7 +473,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
473 keepAliveTimer.getKeepAliveTimer().cancel(); 473 keepAliveTimer.getKeepAliveTimer().cancel();
474 } 474 }
475 } else { 475 } else {
476 - bgpconfig.setPeerConnState(peerAddr, BGPPeerCfg.State.IDLE); 476 + bgpconfig.setPeerConnState(peerAddr, BgpPeerCfg.State.IDLE);
477 log.warn("No bgp ip in channelHandler registered for " + "disconnected peer {}", getPeerInfoString()); 477 log.warn("No bgp ip in channelHandler registered for " + "disconnected peer {}", getPeerInfoString());
478 } 478 }
479 } 479 }
...@@ -487,14 +487,14 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -487,14 +487,14 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
487 if ((ChannelState.OPENWAIT == state) || (ChannelState.OPENSENT == state)) { 487 if ((ChannelState.OPENWAIT == state) || (ChannelState.OPENSENT == state)) {
488 488
489 // When ReadTimeout timer is expired in OPENWAIT/OPENSENT state, it is considered 489 // When ReadTimeout timer is expired in OPENWAIT/OPENSENT state, it is considered
490 - sendNotification(BGPErrorType.HOLD_TIMER_EXPIRED, (byte) 0, null); 490 + sendNotification(BgpErrorType.HOLD_TIMER_EXPIRED, (byte) 0, null);
491 channel.close(); 491 channel.close();
492 state = ChannelState.IDLE; 492 state = ChannelState.IDLE;
493 return; 493 return;
494 } else if (ChannelState.OPENCONFIRM == state) { 494 } else if (ChannelState.OPENCONFIRM == state) {
495 495
496 // When ReadTimeout timer is expired in OPENCONFIRM state. 496 // When ReadTimeout timer is expired in OPENCONFIRM state.
497 - sendNotification(BGPErrorType.HOLD_TIMER_EXPIRED, (byte) 0, null); 497 + sendNotification(BgpErrorType.HOLD_TIMER_EXPIRED, (byte) 0, null);
498 channel.close(); 498 channel.close();
499 state = ChannelState.IDLE; 499 state = ChannelState.IDLE;
500 return; 500 return;
...@@ -508,9 +508,9 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -508,9 +508,9 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
508 log.debug("StackTrace for previous Exception: ", e.getCause()); 508 log.debug("StackTrace for previous Exception: ", e.getCause());
509 } 509 }
510 channel.close(); 510 channel.close();
511 - } else if (e.getCause() instanceof BGPParseException) { 511 + } else if (e.getCause() instanceof BgpParseException) {
512 byte[] data = new byte[] {}; 512 byte[] data = new byte[] {};
513 - BGPParseException errMsg = (BGPParseException) e.getCause(); 513 + BgpParseException errMsg = (BgpParseException) e.getCause();
514 byte errorCode = errMsg.getErrorCode(); 514 byte errorCode = errMsg.getErrorCode();
515 byte errorSubCode = errMsg.getErrorSubCode(); 515 byte errorSubCode = errMsg.getErrorSubCode();
516 ChannelBuffer tempCb = errMsg.getData(); 516 ChannelBuffer tempCb = errMsg.getData();
...@@ -537,13 +537,13 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -537,13 +537,13 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
537 public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 537 public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
538 if (e.getMessage() instanceof List) { 538 if (e.getMessage() instanceof List) {
539 @SuppressWarnings("Unchecked") 539 @SuppressWarnings("Unchecked")
540 - List<BGPMessage> msglist = (List<BGPMessage>) e.getMessage(); 540 + List<BgpMessage> msglist = (List<BgpMessage>) e.getMessage();
541 - for (BGPMessage pm : msglist) { 541 + for (BgpMessage pm : msglist) {
542 // Do the actual packet processing 542 // Do the actual packet processing
543 - state.processBGPMessage(this, pm); 543 + state.processBgpMessage(this, pm);
544 } 544 }
545 } else { 545 } else {
546 - state.processBGPMessage(this, (BGPMessage) e.getMessage()); 546 + state.processBgpMessage(this, (BgpMessage) e.getMessage());
547 } 547 }
548 } 548 }
549 549
...@@ -554,22 +554,22 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -554,22 +554,22 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
554 * @param peerIdentifier BGP peer identifier 554 * @param peerIdentifier BGP peer identifier
555 * @param peerAddr BGP peer address 555 * @param peerAddr BGP peer address
556 * @return true if bgp spreakers initiated connection 556 * @return true if bgp spreakers initiated connection
557 - * @throws BGPParseException on error while procession collision detection 557 + * @throws BgpParseException on error while procession collision detection
558 * @throws IOException on error while procession collision detection 558 * @throws IOException on error while procession collision detection
559 */ 559 */
560 - public boolean connectionCollisionDetection(BGPPeerCfg.State state, int peerIdentifier, String peerAddr) 560 + public boolean connectionCollisionDetection(BgpPeerCfg.State state, int peerIdentifier, String peerAddr)
561 - throws IOException, BGPParseException { 561 + throws IOException, BgpParseException {
562 /* 562 /*
563 * RFC 4271, Section 6.8, Based on the value of the BGP identifier, a convention is established for detecting 563 * RFC 4271, Section 6.8, Based on the value of the BGP identifier, a convention is established for detecting
564 * which BGP connection is to be preserved when a collision occurs. The convention is to compare the BGP 564 * which BGP connection is to be preserved when a collision occurs. The convention is to compare the BGP
565 * Identifiers of the peers involved in the collision and to retain only the connection initiated by the BGP 565 * Identifiers of the peers involved in the collision and to retain only the connection initiated by the BGP
566 * speaker with the higher-valued BGP Identifier.. 566 * speaker with the higher-valued BGP Identifier..
567 */ 567 */
568 - BGPPeerCfg.State currentState = bgpconfig.getPeerConnState(peerAddr); 568 + BgpPeerCfg.State currentState = bgpconfig.getPeerConnState(peerAddr);
569 if (currentState.equals(state)) { 569 if (currentState.equals(state)) {
570 if (((Ip4Address.valueOf(bgpconfig.getRouterId())).compareTo(Ip4Address.valueOf(peerIdentifier))) > 0) { 570 if (((Ip4Address.valueOf(bgpconfig.getRouterId())).compareTo(Ip4Address.valueOf(peerIdentifier))) > 0) {
571 // send notification 571 // send notification
572 - sendNotification(BGPErrorType.CEASE, BGPErrorType.CONNECTION_COLLISION_RESOLUTION, null); 572 + sendNotification(BgpErrorType.CEASE, BgpErrorType.CONNECTION_COLLISION_RESOLUTION, null);
573 log.debug("Connection collision detected, local id: {}, peer id: {}, peer state:{}, in state:{}", 573 log.debug("Connection collision detected, local id: {}, peer id: {}, peer state:{}, in state:{}",
574 (Ip4Address.valueOf(bgpconfig.getRouterId())), (Ip4Address.valueOf(peerIdentifier)), 574 (Ip4Address.valueOf(bgpconfig.getRouterId())), (Ip4Address.valueOf(peerIdentifier)),
575 currentState, state); 575 currentState, state);
...@@ -605,9 +605,9 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -605,9 +605,9 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
605 * To handle the BGP message. 605 * To handle the BGP message.
606 * 606 *
607 * @param m bgp message 607 * @param m bgp message
608 - * @throws BGPParseException throw exception 608 + * @throws BgpParseException throw exception
609 */ 609 */
610 - private void dispatchMessage(BGPMessage m) throws BGPParseException { 610 + private void dispatchMessage(BgpMessage m) throws BgpParseException {
611 bgpPacketStats.addInPacket(); 611 bgpPacketStats.addInPacket();
612 bgpController.processBGPPacket(thisbgpId, m); 612 bgpController.processBGPPacket(thisbgpId, m);
613 } 613 }
...@@ -648,20 +648,20 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -648,20 +648,20 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
648 * 648 *
649 * @return packet statistics 649 * @return packet statistics
650 */ 650 */
651 - public BGPPacketStatsImpl getBgpPacketStats() { 651 + public BgpPacketStatsImpl getBgpPacketStats() {
652 return bgpPacketStats; 652 return bgpPacketStats;
653 } 653 }
654 654
655 /** 655 /**
656 * Send handshake open message to the peer. 656 * Send handshake open message to the peer.
657 * 657 *
658 - * @throws IOException, BGPParseException 658 + * @throws IOException, BgpParseException
659 */ 659 */
660 - private void sendHandshakeOpenMessage() throws IOException, BGPParseException { 660 + private void sendHandshakeOpenMessage() throws IOException, BgpParseException {
661 int bgpId; 661 int bgpId;
662 662
663 bgpId = Ip4Address.valueOf(bgpconfig.getRouterId()).toInt(); 663 bgpId = Ip4Address.valueOf(bgpconfig.getRouterId()).toInt();
664 - BGPMessage msg = factory4.openMessageBuilder().setAsNumber((short) bgpconfig.getAsNumber()) 664 + BgpMessage msg = factory4.openMessageBuilder().setAsNumber((short) bgpconfig.getAsNumber())
665 .setHoldTime(bgpconfig.getHoldTime()).setBgpId(bgpId).setLsCapabilityTlv(bgpconfig.getLsCapability()) 665 .setHoldTime(bgpconfig.getHoldTime()).setBgpId(bgpId).setLsCapabilityTlv(bgpconfig.getLsCapability())
666 .setLargeAsCapabilityTlv(bgpconfig.getLargeASCapability()).build(); 666 .setLargeAsCapabilityTlv(bgpconfig.getLargeASCapability()).build();
667 log.debug("Sending open message to {}", channel.getRemoteAddress()); 667 log.debug("Sending open message to {}", channel.getRemoteAddress());
...@@ -675,11 +675,11 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -675,11 +675,11 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
675 * @param errorCode error code send in notification 675 * @param errorCode error code send in notification
676 * @param errorSubCode sub error code send in notification 676 * @param errorSubCode sub error code send in notification
677 * @param data data to send in notification 677 * @param data data to send in notification
678 - * @throws IOException, BGPParseException while building message 678 + * @throws IOException, BgpParseException while building message
679 */ 679 */
680 private void sendNotification(byte errorCode, byte errorSubCode, byte[] data) 680 private void sendNotification(byte errorCode, byte errorSubCode, byte[] data)
681 - throws IOException, BGPParseException { 681 + throws IOException, BgpParseException {
682 - BGPMessage msg = factory4.notificationMessageBuilder().setErrorCode(errorCode) 682 + BgpMessage msg = factory4.notificationMessageBuilder().setErrorCode(errorCode)
683 .setErrorSubCode(errorSubCode).setData(data).build(); 683 .setErrorSubCode(errorSubCode).setData(data).build();
684 log.debug("Sending notification message to {}", channel.getRemoteAddress()); 684 log.debug("Sending notification message to {}", channel.getRemoteAddress());
685 channel.write(Collections.singletonList(msg)); 685 channel.write(Collections.singletonList(msg));
...@@ -689,11 +689,11 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -689,11 +689,11 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
689 * Send keep alive message. 689 * Send keep alive message.
690 * 690 *
691 * @throws IOException when channel is disconnected 691 * @throws IOException when channel is disconnected
692 - * @throws BGPParseException while building keep alive message 692 + * @throws BgpParseException while building keep alive message
693 */ 693 */
694 - synchronized void sendKeepAliveMessage() throws IOException, BGPParseException { 694 + synchronized void sendKeepAliveMessage() throws IOException, BgpParseException {
695 695
696 - BGPMessage msg = factory4.keepaliveMessageBuilder().build(); 696 + BgpMessage msg = factory4.keepaliveMessageBuilder().build();
697 log.debug("Sending keepalive message to {}", channel.getRemoteAddress()); 697 log.debug("Sending keepalive message to {}", channel.getRemoteAddress());
698 channel.write(Collections.singletonList(msg)); 698 channel.write(Collections.singletonList(msg));
699 } 699 }
...@@ -704,10 +704,10 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -704,10 +704,10 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
704 * @param errorCode error code 704 * @param errorCode error code
705 * @param errorSubCode error sub code 705 * @param errorSubCode error sub code
706 * @param data message type 706 * @param data message type
707 - * @throws BGPParseException while processing error messsage 707 + * @throws BgpParseException while processing error messsage
708 * @throws IOException while processing error message 708 * @throws IOException while processing error message
709 */ 709 */
710 - public void processUnknownMsg(byte errorCode, byte errorSubCode, byte data) throws BGPParseException, IOException { 710 + public void processUnknownMsg(byte errorCode, byte errorSubCode, byte data) throws BgpParseException, IOException {
711 log.debug("UNKNOWN message received"); 711 log.debug("UNKNOWN message received");
712 byte[] byteArray = new byte[1]; 712 byte[] byteArray = new byte[1];
713 byteArray[0] = data; 713 byteArray[0] = data;
...@@ -721,26 +721,26 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -721,26 +721,26 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
721 * @param h channel handler 721 * @param h channel handler
722 * @param openMsg open message 722 * @param openMsg open message
723 * @return true if valid message, otherwise false 723 * @return true if valid message, otherwise false
724 - * @throws BGPParseException throw exception 724 + * @throws BgpParseException throw exception
725 */ 725 */
726 - public boolean openMsgValidation(BGPChannelHandler h, BGPOpenMsg openMsg) throws BGPParseException { 726 + public boolean openMsgValidation(BgpChannelHandler h, BgpOpenMsg openMsg) throws BgpParseException {
727 boolean result; 727 boolean result;
728 728
729 // Validate BGP ID 729 // Validate BGP ID
730 result = bgpIdValidation(openMsg); 730 result = bgpIdValidation(openMsg);
731 if (!result) { 731 if (!result) {
732 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.BAD_BGP_IDENTIFIER, null); 732 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.BAD_BGP_IDENTIFIER, null);
733 } 733 }
734 734
735 // Validate AS number 735 // Validate AS number
736 result = asNumberValidation(h, openMsg); 736 result = asNumberValidation(h, openMsg);
737 if (!result) { 737 if (!result) {
738 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.BAD_PEER_AS, null); 738 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.BAD_PEER_AS, null);
739 } 739 }
740 740
741 // Validate hold timer 741 // Validate hold timer
742 if ((openMsg.getHoldTime() != 0) && (openMsg.getHoldTime() < BGP_MIN_HOLDTIME)) { 742 if ((openMsg.getHoldTime() != 0) && (openMsg.getHoldTime() < BGP_MIN_HOLDTIME)) {
743 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.UNACCEPTABLE_HOLD_TIME, null); 743 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.UNACCEPTABLE_HOLD_TIME, null);
744 } 744 }
745 745
746 // Validate capabilities 746 // Validate capabilities
...@@ -754,25 +754,25 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -754,25 +754,25 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
754 * @param h channel handler 754 * @param h channel handler
755 * @param openmsg open message 755 * @param openmsg open message
756 * @return success or failure 756 * @return success or failure
757 - * @throws BGPParseException 757 + * @throws BgpParseException
758 */ 758 */
759 - private boolean capabilityValidation(BGPChannelHandler h, BGPOpenMsg openmsg) throws BGPParseException { 759 + private boolean capabilityValidation(BgpChannelHandler h, BgpOpenMsg openmsg) throws BgpParseException {
760 log.debug("capabilityValidation"); 760 log.debug("capabilityValidation");
761 761
762 boolean isMultiProtocolcapabilityExists = false; 762 boolean isMultiProtocolcapabilityExists = false;
763 boolean isFourOctetCapabilityExits = false; 763 boolean isFourOctetCapabilityExits = false;
764 int capAsNum = 0; 764 int capAsNum = 0;
765 765
766 - List<BGPValueType> capabilityTlv = openmsg.getCapabilityTlv(); 766 + List<BgpValueType> capabilityTlv = openmsg.getCapabilityTlv();
767 - ListIterator<BGPValueType> listIterator = capabilityTlv.listIterator(); 767 + ListIterator<BgpValueType> listIterator = capabilityTlv.listIterator();
768 - List<BGPValueType> unSupportedCapabilityTlv = new LinkedList<>(); 768 + List<BgpValueType> unSupportedCapabilityTlv = new LinkedList<>();
769 - ListIterator<BGPValueType> unSupportedCaplistIterator = unSupportedCapabilityTlv.listIterator(); 769 + ListIterator<BgpValueType> unSupportedCaplistIterator = unSupportedCapabilityTlv.listIterator();
770 - BGPValueType tempTlv; 770 + BgpValueType tempTlv;
771 boolean isLargeAsCapabilityCfg = h.bgpconfig.getLargeASCapability(); 771 boolean isLargeAsCapabilityCfg = h.bgpconfig.getLargeASCapability();
772 boolean isLsCapabilityCfg = h.bgpconfig.getLsCapability(); 772 boolean isLsCapabilityCfg = h.bgpconfig.getLsCapability();
773 773
774 while (listIterator.hasNext()) { 774 while (listIterator.hasNext()) {
775 - BGPValueType tlv = listIterator.next(); 775 + BgpValueType tlv = listIterator.next();
776 if (tlv.getType() == MULTI_PROTOCOL_EXTN_CAPA_TYPE) { 776 if (tlv.getType() == MULTI_PROTOCOL_EXTN_CAPA_TYPE) {
777 isMultiProtocolcapabilityExists = true; 777 isMultiProtocolcapabilityExists = true;
778 } 778 }
...@@ -785,11 +785,11 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -785,11 +785,11 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
785 if (isFourOctetCapabilityExits) { 785 if (isFourOctetCapabilityExits) {
786 if (capAsNum > MAX_AS2_NUM) { 786 if (capAsNum > MAX_AS2_NUM) {
787 if (openmsg.getAsNumber() != AS_TRANS) { 787 if (openmsg.getAsNumber() != AS_TRANS) {
788 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.BAD_PEER_AS, null); 788 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.BAD_PEER_AS, null);
789 } 789 }
790 } else { 790 } else {
791 if (capAsNum != openmsg.getAsNumber()) { 791 if (capAsNum != openmsg.getAsNumber()) {
792 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.BAD_PEER_AS, null); 792 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.BAD_PEER_AS, null);
793 } 793 }
794 } 794 }
795 } 795 }
...@@ -811,10 +811,10 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -811,10 +811,10 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
811 if (unSupportedCaplistIterator.hasNext()) { 811 if (unSupportedCaplistIterator.hasNext()) {
812 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); 812 ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
813 while (unSupportedCaplistIterator.hasNext()) { 813 while (unSupportedCaplistIterator.hasNext()) {
814 - BGPValueType tlv = unSupportedCaplistIterator.next(); 814 + BgpValueType tlv = unSupportedCaplistIterator.next();
815 tlv.write(buffer); 815 tlv.write(buffer);
816 } 816 }
817 - throw new BGPParseException(BGPErrorType.OPEN_MESSAGE_ERROR, BGPErrorType.UNSUPPORTED_CAPABILITY, buffer); 817 + throw new BgpParseException(BgpErrorType.OPEN_MESSAGE_ERROR, BgpErrorType.UNSUPPORTED_CAPABILITY, buffer);
818 } else { 818 } else {
819 return true; 819 return true;
820 } 820 }
...@@ -827,18 +827,18 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -827,18 +827,18 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
827 * @param openMsg open message 827 * @param openMsg open message
828 * @return true or false 828 * @return true or false
829 */ 829 */
830 - private boolean asNumberValidation(BGPChannelHandler h, BGPOpenMsg openMsg) { 830 + private boolean asNumberValidation(BgpChannelHandler h, BgpOpenMsg openMsg) {
831 log.debug("AS Num validation"); 831 log.debug("AS Num validation");
832 832
833 int capAsNum = 0; 833 int capAsNum = 0;
834 boolean isFourOctetCapabilityExits = false; 834 boolean isFourOctetCapabilityExits = false;
835 835
836 - BGPPeerCfg peerCfg = h.bgpconfig.displayPeers(peerAddr); 836 + BgpPeerCfg peerCfg = h.bgpconfig.displayPeers(peerAddr);
837 - List<BGPValueType> capabilityTlv = openMsg.getCapabilityTlv(); 837 + List<BgpValueType> capabilityTlv = openMsg.getCapabilityTlv();
838 - ListIterator<BGPValueType> listIterator = capabilityTlv.listIterator(); 838 + ListIterator<BgpValueType> listIterator = capabilityTlv.listIterator();
839 839
840 while (listIterator.hasNext()) { 840 while (listIterator.hasNext()) {
841 - BGPValueType tlv = listIterator.next(); 841 + BgpValueType tlv = listIterator.next();
842 if (tlv.getType() == FOUR_OCTET_AS_NUM_CAPA_TYPE) { 842 if (tlv.getType() == FOUR_OCTET_AS_NUM_CAPA_TYPE) {
843 isFourOctetCapabilityExits = true; 843 isFourOctetCapabilityExits = true;
844 capAsNum = ((FourOctetAsNumCapabilityTlv) tlv).getInt(); 844 capAsNum = ((FourOctetAsNumCapabilityTlv) tlv).getInt();
...@@ -894,7 +894,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler { ...@@ -894,7 +894,7 @@ class BGPChannelHandler extends IdleStateAwareChannelHandler {
894 * @param openMsg open message 894 * @param openMsg open message
895 * @return true or false 895 * @return true or false
896 */ 896 */
897 - private boolean bgpIdValidation(BGPOpenMsg openMsg) { 897 + private boolean bgpIdValidation(BgpOpenMsg openMsg) {
898 String openMsgBgpId = Ip4Address.valueOf(openMsg.getBgpId()).toString(); 898 String openMsgBgpId = Ip4Address.valueOf(openMsg.getBgpId()).toString();
899 899
900 InetAddress ipAddress; 900 InetAddress ipAddress;
......
...@@ -21,17 +21,17 @@ import java.util.Set; ...@@ -21,17 +21,17 @@ import java.util.Set;
21 import java.util.TreeMap; 21 import java.util.TreeMap;
22 22
23 import org.onlab.packet.Ip4Address; 23 import org.onlab.packet.Ip4Address;
24 -import org.onosproject.bgp.controller.BGPCfg; 24 +import org.onosproject.bgp.controller.BgpCfg;
25 -import org.onosproject.bgp.controller.BGPPeerCfg; 25 +import org.onosproject.bgp.controller.BgpPeerCfg;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 27 import org.slf4j.LoggerFactory;
28 28
29 /** 29 /**
30 * Provides BGP configuration of this BGP speaker. 30 * Provides BGP configuration of this BGP speaker.
31 */ 31 */
32 -public class BGPConfig implements BGPCfg { 32 +public class BgpConfig implements BgpCfg {
33 33
34 - protected static final Logger log = LoggerFactory.getLogger(BGPConfig.class); 34 + protected static final Logger log = LoggerFactory.getLogger(BgpConfig.class);
35 35
36 private static final short DEFAULT_HOLD_TIMER = 120; 36 private static final short DEFAULT_HOLD_TIMER = 120;
37 private static final short DEFAULT_CONN_RETRY_TIME = 120; 37 private static final short DEFAULT_CONN_RETRY_TIME = 120;
...@@ -47,12 +47,12 @@ public class BGPConfig implements BGPCfg { ...@@ -47,12 +47,12 @@ public class BGPConfig implements BGPCfg {
47 private int maxConnRetryCount; 47 private int maxConnRetryCount;
48 48
49 private Ip4Address routerId = null; 49 private Ip4Address routerId = null;
50 - private TreeMap<String, BGPPeerCfg> bgpPeerTree = new TreeMap<>(); 50 + private TreeMap<String, BgpPeerCfg> bgpPeerTree = new TreeMap<>();
51 51
52 /** 52 /**
53 * Constructor to initialize the values. 53 * Constructor to initialize the values.
54 */ 54 */
55 - public BGPConfig() { 55 + public BgpConfig() {
56 56
57 this.holdTime = DEFAULT_HOLD_TIMER; 57 this.holdTime = DEFAULT_HOLD_TIMER;
58 this.maxConnRetryTime = DEFAULT_CONN_RETRY_TIME; 58 this.maxConnRetryTime = DEFAULT_CONN_RETRY_TIME;
...@@ -142,13 +142,13 @@ public class BGPConfig implements BGPCfg { ...@@ -142,13 +142,13 @@ public class BGPConfig implements BGPCfg {
142 142
143 @Override 143 @Override
144 public boolean addPeer(String routerid, int remoteAs, short holdTime) { 144 public boolean addPeer(String routerid, int remoteAs, short holdTime) {
145 - BGPPeerConfig lspeer = new BGPPeerConfig(); 145 + BgpPeerConfig lspeer = new BgpPeerConfig();
146 if (this.bgpPeerTree.get(routerid) == null) { 146 if (this.bgpPeerTree.get(routerid) == null) {
147 147
148 lspeer.setPeerRouterId(routerid); 148 lspeer.setPeerRouterId(routerid);
149 lspeer.setAsNumber(remoteAs); 149 lspeer.setAsNumber(remoteAs);
150 lspeer.setHoldtime(holdTime); 150 lspeer.setHoldtime(holdTime);
151 - lspeer.setState(BGPPeerCfg.State.IDLE); 151 + lspeer.setState(BgpPeerCfg.State.IDLE);
152 lspeer.setSelfInnitConnection(false); 152 lspeer.setSelfInnitConnection(false);
153 153
154 if (this.getAsNumber() == remoteAs) { 154 if (this.getAsNumber() == remoteAs) {
...@@ -168,7 +168,7 @@ public class BGPConfig implements BGPCfg { ...@@ -168,7 +168,7 @@ public class BGPConfig implements BGPCfg {
168 168
169 @Override 169 @Override
170 public boolean connectPeer(String routerid) { 170 public boolean connectPeer(String routerid) {
171 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 171 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
172 172
173 if (lspeer != null) { 173 if (lspeer != null) {
174 lspeer.setSelfInnitConnection(true); 174 lspeer.setSelfInnitConnection(true);
...@@ -181,7 +181,7 @@ public class BGPConfig implements BGPCfg { ...@@ -181,7 +181,7 @@ public class BGPConfig implements BGPCfg {
181 181
182 @Override 182 @Override
183 public boolean removePeer(String routerid) { 183 public boolean removePeer(String routerid) {
184 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 184 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
185 185
186 if (lspeer != null) { 186 if (lspeer != null) {
187 187
...@@ -200,12 +200,12 @@ public class BGPConfig implements BGPCfg { ...@@ -200,12 +200,12 @@ public class BGPConfig implements BGPCfg {
200 200
201 @Override 201 @Override
202 public boolean disconnectPeer(String routerid) { 202 public boolean disconnectPeer(String routerid) {
203 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 203 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
204 204
205 if (lspeer != null) { 205 if (lspeer != null) {
206 206
207 //TODO DISCONNECT PEER 207 //TODO DISCONNECT PEER
208 - lspeer.setState(BGPPeerCfg.State.IDLE); 208 + lspeer.setState(BgpPeerCfg.State.IDLE);
209 lspeer.setSelfInnitConnection(false); 209 lspeer.setSelfInnitConnection(false);
210 log.debug("Disconnected : " + routerid + " successfully"); 210 log.debug("Disconnected : " + routerid + " successfully");
211 211
...@@ -217,8 +217,8 @@ public class BGPConfig implements BGPCfg { ...@@ -217,8 +217,8 @@ public class BGPConfig implements BGPCfg {
217 } 217 }
218 218
219 @Override 219 @Override
220 - public void setPeerConnState(String routerid, BGPPeerCfg.State state) { 220 + public void setPeerConnState(String routerid, BgpPeerCfg.State state) {
221 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 221 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
222 222
223 if (lspeer != null) { 223 if (lspeer != null) {
224 lspeer.setState(state); 224 lspeer.setState(state);
...@@ -232,21 +232,21 @@ public class BGPConfig implements BGPCfg { ...@@ -232,21 +232,21 @@ public class BGPConfig implements BGPCfg {
232 } 232 }
233 233
234 @Override 234 @Override
235 - public BGPPeerCfg.State getPeerConnState(String routerid) { 235 + public BgpPeerCfg.State getPeerConnState(String routerid) {
236 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 236 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
237 237
238 if (lspeer != null) { 238 if (lspeer != null) {
239 return lspeer.getState(); 239 return lspeer.getState();
240 } else { 240 } else {
241 - return BGPPeerCfg.State.INVALID; //No instance 241 + return BgpPeerCfg.State.INVALID; //No instance
242 } 242 }
243 } 243 }
244 244
245 @Override 245 @Override
246 public boolean isPeerConnectable(String routerid) { 246 public boolean isPeerConnectable(String routerid) {
247 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 247 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
248 248
249 - if ((lspeer != null) && lspeer.getState().equals(BGPPeerCfg.State.IDLE)) { 249 + if ((lspeer != null) && lspeer.getState().equals(BgpPeerCfg.State.IDLE)) {
250 return true; 250 return true;
251 } 251 }
252 252
...@@ -254,21 +254,21 @@ public class BGPConfig implements BGPCfg { ...@@ -254,21 +254,21 @@ public class BGPConfig implements BGPCfg {
254 } 254 }
255 255
256 @Override 256 @Override
257 - public TreeMap<String, BGPPeerCfg> getPeerTree() { 257 + public TreeMap<String, BgpPeerCfg> getPeerTree() {
258 return this.bgpPeerTree; 258 return this.bgpPeerTree;
259 } 259 }
260 260
261 @Override 261 @Override
262 - public TreeMap<String, BGPPeerCfg> displayPeers() { 262 + public TreeMap<String, BgpPeerCfg> displayPeers() {
263 if (this.bgpPeerTree.isEmpty()) { 263 if (this.bgpPeerTree.isEmpty()) {
264 log.debug("There are no BGP peers"); 264 log.debug("There are no BGP peers");
265 } else { 265 } else {
266 - Set<Entry<String, BGPPeerCfg>> set = this.bgpPeerTree.entrySet(); 266 + Set<Entry<String, BgpPeerCfg>> set = this.bgpPeerTree.entrySet();
267 - Iterator<Entry<String, BGPPeerCfg>> list = set.iterator(); 267 + Iterator<Entry<String, BgpPeerCfg>> list = set.iterator();
268 - BGPPeerCfg lspeer; 268 + BgpPeerCfg lspeer;
269 269
270 while (list.hasNext()) { 270 while (list.hasNext()) {
271 - Entry<String, BGPPeerCfg> me = list.next(); 271 + Entry<String, BgpPeerCfg> me = list.next();
272 lspeer = me.getValue(); 272 lspeer = me.getValue();
273 log.debug("Peer neighbor IP :" + me.getKey()); 273 log.debug("Peer neighbor IP :" + me.getKey());
274 log.debug(", AS Number : " + lspeer.getAsNumber()); 274 log.debug(", AS Number : " + lspeer.getAsNumber());
...@@ -280,10 +280,10 @@ public class BGPConfig implements BGPCfg { ...@@ -280,10 +280,10 @@ public class BGPConfig implements BGPCfg {
280 } 280 }
281 281
282 @Override 282 @Override
283 - public BGPPeerCfg displayPeers(String routerid) { 283 + public BgpPeerCfg displayPeers(String routerid) {
284 284
285 if (this.bgpPeerTree.isEmpty()) { 285 if (this.bgpPeerTree.isEmpty()) {
286 - log.debug("There are no BGP peers"); 286 + log.debug("There are no Bgp peers");
287 } else { 287 } else {
288 return this.bgpPeerTree.get(routerid); 288 return this.bgpPeerTree.get(routerid);
289 } 289 }
...@@ -312,7 +312,7 @@ public class BGPConfig implements BGPCfg { ...@@ -312,7 +312,7 @@ public class BGPConfig implements BGPCfg {
312 312
313 @Override 313 @Override
314 public boolean isPeerConfigured(String routerid) { 314 public boolean isPeerConfigured(String routerid) {
315 - BGPPeerCfg lspeer = this.bgpPeerTree.get(routerid); 315 + BgpPeerCfg lspeer = this.bgpPeerTree.get(routerid);
316 return (lspeer != null) ? true : false; 316 return (lspeer != null) ? true : false;
317 } 317 }
318 318
......
...@@ -21,9 +21,9 @@ import org.jboss.netty.bootstrap.ClientBootstrap; ...@@ -21,9 +21,9 @@ import org.jboss.netty.bootstrap.ClientBootstrap;
21 import org.jboss.netty.channel.ChannelFuture; 21 import org.jboss.netty.channel.ChannelFuture;
22 import org.jboss.netty.channel.ChannelFutureListener; 22 import org.jboss.netty.channel.ChannelFutureListener;
23 import org.jboss.netty.channel.ChannelPipelineFactory; 23 import org.jboss.netty.channel.ChannelPipelineFactory;
24 -import org.onosproject.bgp.controller.BGPCfg; 24 +import org.onosproject.bgp.controller.BgpCfg;
25 -import org.onosproject.bgp.controller.BGPController; 25 +import org.onosproject.bgp.controller.BgpController;
26 -import org.onosproject.bgp.controller.BGPPeerCfg; 26 +import org.onosproject.bgp.controller.BgpPeerCfg;
27 import org.onosproject.bgp.controller.BgpConnectPeer; 27 import org.onosproject.bgp.controller.BgpConnectPeer;
28 import org.slf4j.Logger; 28 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory; 29 import org.slf4j.LoggerFactory;
...@@ -42,7 +42,7 @@ public class BgpConnectPeerImpl implements BgpConnectPeer { ...@@ -42,7 +42,7 @@ public class BgpConnectPeerImpl implements BgpConnectPeer {
42 private int connectRetryTime; 42 private int connectRetryTime;
43 private ChannelPipelineFactory pfact; 43 private ChannelPipelineFactory pfact;
44 private ClientBootstrap peerBootstrap; 44 private ClientBootstrap peerBootstrap;
45 - private BGPCfg bgpconfig; 45 + private BgpCfg bgpconfig;
46 46
47 /** 47 /**
48 * Initialize timer and initiate pipeline factory. 48 * Initialize timer and initiate pipeline factory.
...@@ -51,10 +51,10 @@ public class BgpConnectPeerImpl implements BgpConnectPeer { ...@@ -51,10 +51,10 @@ public class BgpConnectPeerImpl implements BgpConnectPeer {
51 * @param remoteHost remote host to connect 51 * @param remoteHost remote host to connect
52 * @param remotePort remote port to connect 52 * @param remotePort remote port to connect
53 */ 53 */
54 - public BgpConnectPeerImpl(BGPController bgpController, String remoteHost, int remotePort) { 54 + public BgpConnectPeerImpl(BgpController bgpController, String remoteHost, int remotePort) {
55 55
56 this.bgpconfig = bgpController.getConfig(); 56 this.bgpconfig = bgpController.getConfig();
57 - this.pfact = new BGPPipelineFactory(bgpController, false); 57 + this.pfact = new BgpPipelineFactory(bgpController, false);
58 this.peerBootstrap = Controller.peerBootstrap(); 58 this.peerBootstrap = Controller.peerBootstrap();
59 this.peerBootstrap.setPipelineFactory(pfact); 59 this.peerBootstrap.setPipelineFactory(pfact);
60 this.peerHost = remoteHost; 60 this.peerHost = remoteHost;
...@@ -98,12 +98,12 @@ public class BgpConnectPeerImpl implements BgpConnectPeer { ...@@ -98,12 +98,12 @@ public class BgpConnectPeerImpl implements BgpConnectPeer {
98 InetSocketAddress connectToSocket = new InetSocketAddress(peerHost, peerPort); 98 InetSocketAddress connectToSocket = new InetSocketAddress(peerHost, peerPort);
99 99
100 try { 100 try {
101 - bgpconfig.setPeerConnState(peerHost, BGPPeerCfg.State.CONNECT); 101 + bgpconfig.setPeerConnState(peerHost, BgpPeerCfg.State.CONNECT);
102 peerBootstrap.connect(connectToSocket).addListener(new ChannelFutureListener() { 102 peerBootstrap.connect(connectToSocket).addListener(new ChannelFutureListener() {
103 @Override 103 @Override
104 public void operationComplete(ChannelFuture future) throws Exception { 104 public void operationComplete(ChannelFuture future) throws Exception {
105 if (!future.isSuccess()) { 105 if (!future.isSuccess()) {
106 - bgpconfig.setPeerConnState(peerHost, BGPPeerCfg.State.ACTIVE); 106 + bgpconfig.setPeerConnState(peerHost, BgpPeerCfg.State.ACTIVE);
107 connectRetryCounter++; 107 connectRetryCounter++;
108 log.error("Connection failed, ConnectRetryCounter {} remote host {}", connectRetryCounter, 108 log.error("Connection failed, ConnectRetryCounter {} remote host {}", connectRetryCounter,
109 peerHost); 109 peerHost);
......
...@@ -26,34 +26,34 @@ import org.apache.felix.scr.annotations.Activate; ...@@ -26,34 +26,34 @@ import org.apache.felix.scr.annotations.Activate;
26 import org.apache.felix.scr.annotations.Component; 26 import org.apache.felix.scr.annotations.Component;
27 import org.apache.felix.scr.annotations.Deactivate; 27 import org.apache.felix.scr.annotations.Deactivate;
28 import org.apache.felix.scr.annotations.Service; 28 import org.apache.felix.scr.annotations.Service;
29 -import org.onosproject.bgp.controller.BGPCfg; 29 +import org.onosproject.bgp.controller.BgpCfg;
30 -import org.onosproject.bgp.controller.BGPController; 30 +import org.onosproject.bgp.controller.BgpController;
31 -import org.onosproject.bgp.controller.BGPId; 31 +import org.onosproject.bgp.controller.BgpId;
32 -import org.onosproject.bgp.controller.BGPPeer; 32 +import org.onosproject.bgp.controller.BgpPeer;
33 import org.onosproject.bgp.controller.BgpLinkListener; 33 import org.onosproject.bgp.controller.BgpLinkListener;
34 import org.onosproject.bgp.controller.BgpNodeListener; 34 import org.onosproject.bgp.controller.BgpNodeListener;
35 import org.onosproject.bgp.controller.BgpPeerManager; 35 import org.onosproject.bgp.controller.BgpPeerManager;
36 -import org.onosproject.bgpio.exceptions.BGPParseException; 36 +import org.onosproject.bgpio.exceptions.BgpParseException;
37 -import org.onosproject.bgpio.protocol.BGPMessage; 37 +import org.onosproject.bgpio.protocol.BgpMessage;
38 import org.slf4j.Logger; 38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory; 39 import org.slf4j.LoggerFactory;
40 40
41 @Component(immediate = true) 41 @Component(immediate = true)
42 @Service 42 @Service
43 -public class BGPControllerImpl implements BGPController { 43 +public class BgpControllerImpl implements BgpController {
44 44
45 - private static final Logger log = LoggerFactory.getLogger(BGPControllerImpl.class); 45 + private static final Logger log = LoggerFactory.getLogger(BgpControllerImpl.class);
46 46
47 - protected ConcurrentHashMap<BGPId, BGPPeer> connectedPeers = new ConcurrentHashMap<BGPId, BGPPeer>(); 47 + protected ConcurrentHashMap<BgpId, BgpPeer> connectedPeers = new ConcurrentHashMap<BgpId, BgpPeer>();
48 48
49 - protected BGPPeerManagerImpl peerManager = new BGPPeerManagerImpl(); 49 + protected BgpPeerManagerImpl peerManager = new BgpPeerManagerImpl();
50 50
51 protected Set<BgpNodeListener> bgpNodeListener = new CopyOnWriteArraySet<>(); 51 protected Set<BgpNodeListener> bgpNodeListener = new CopyOnWriteArraySet<>();
52 protected Set<BgpLinkListener> bgpLinkListener = new CopyOnWriteArraySet<>(); 52 protected Set<BgpLinkListener> bgpLinkListener = new CopyOnWriteArraySet<>();
53 53
54 final Controller ctrl = new Controller(this); 54 final Controller ctrl = new Controller(this);
55 55
56 - private BGPConfig bgpconfig = new BGPConfig(); 56 + private BgpConfig bgpconfig = new BgpConfig();
57 57
58 @Activate 58 @Activate
59 public void activate() { 59 public void activate() {
...@@ -70,12 +70,12 @@ public class BGPControllerImpl implements BGPController { ...@@ -70,12 +70,12 @@ public class BGPControllerImpl implements BGPController {
70 } 70 }
71 71
72 @Override 72 @Override
73 - public Iterable<BGPPeer> getPeers() { 73 + public Iterable<BgpPeer> getPeers() {
74 return this.connectedPeers.values(); 74 return this.connectedPeers.values();
75 } 75 }
76 76
77 @Override 77 @Override
78 - public BGPPeer getPeer(BGPId bgpId) { 78 + public BgpPeer getPeer(BgpId bgpId) {
79 return this.connectedPeers.get(bgpId); 79 return this.connectedPeers.get(bgpId);
80 } 80 }
81 81
...@@ -110,12 +110,12 @@ public class BGPControllerImpl implements BGPController { ...@@ -110,12 +110,12 @@ public class BGPControllerImpl implements BGPController {
110 } 110 }
111 111
112 @Override 112 @Override
113 - public void writeMsg(BGPId bgpId, BGPMessage msg) { 113 + public void writeMsg(BgpId bgpId, BgpMessage msg) {
114 this.getPeer(bgpId).sendMessage(msg); 114 this.getPeer(bgpId).sendMessage(msg);
115 } 115 }
116 116
117 @Override 117 @Override
118 - public void processBGPPacket(BGPId bgpId, BGPMessage msg) throws BGPParseException { 118 + public void processBGPPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException {
119 119
120 switch (msg.getType()) { 120 switch (msg.getType()) {
121 case OPEN: 121 case OPEN:
...@@ -138,8 +138,8 @@ public class BGPControllerImpl implements BGPController { ...@@ -138,8 +138,8 @@ public class BGPControllerImpl implements BGPController {
138 138
139 @Override 139 @Override
140 public void closeConnectedPeers() { 140 public void closeConnectedPeers() {
141 - BGPPeer bgpPeer; 141 + BgpPeer bgpPeer;
142 - for (BGPId id : this.connectedPeers.keySet()) { 142 + for (BgpId id : this.connectedPeers.keySet()) {
143 bgpPeer = getPeer(id); 143 bgpPeer = getPeer(id);
144 bgpPeer.disconnectPeer(); 144 bgpPeer.disconnectPeer();
145 } 145 }
...@@ -149,13 +149,13 @@ public class BGPControllerImpl implements BGPController { ...@@ -149,13 +149,13 @@ public class BGPControllerImpl implements BGPController {
149 * Implementation of an BGP Peer which is responsible for keeping track of connected peers and the state in which 149 * Implementation of an BGP Peer which is responsible for keeping track of connected peers and the state in which
150 * they are. 150 * they are.
151 */ 151 */
152 - public class BGPPeerManagerImpl implements BgpPeerManager { 152 + public class BgpPeerManagerImpl implements BgpPeerManager {
153 153
154 - private final Logger log = LoggerFactory.getLogger(BGPPeerManagerImpl.class); 154 + private final Logger log = LoggerFactory.getLogger(BgpPeerManagerImpl.class);
155 private final Lock peerLock = new ReentrantLock(); 155 private final Lock peerLock = new ReentrantLock();
156 156
157 @Override 157 @Override
158 - public boolean addConnectedPeer(BGPId bgpId, BGPPeer bgpPeer) { 158 + public boolean addConnectedPeer(BgpId bgpId, BgpPeer bgpPeer) {
159 159
160 if (connectedPeers.get(bgpId) != null) { 160 if (connectedPeers.get(bgpId) != null) {
161 this.log.error("Trying to add connectedPeer but found previous " + "value for bgp ip: {}", 161 this.log.error("Trying to add connectedPeer but found previous " + "value for bgp ip: {}",
...@@ -169,7 +169,7 @@ public class BGPControllerImpl implements BGPController { ...@@ -169,7 +169,7 @@ public class BGPControllerImpl implements BGPController {
169 } 169 }
170 170
171 @Override 171 @Override
172 - public boolean isPeerConnected(BGPId bgpId) { 172 + public boolean isPeerConnected(BgpId bgpId) {
173 if (connectedPeers.get(bgpId) == null) { 173 if (connectedPeers.get(bgpId) == null) {
174 this.log.error("Is peer connected: bgpIp {}.", bgpId.toString()); 174 this.log.error("Is peer connected: bgpIp {}.", bgpId.toString());
175 return false; 175 return false;
...@@ -179,12 +179,12 @@ public class BGPControllerImpl implements BGPController { ...@@ -179,12 +179,12 @@ public class BGPControllerImpl implements BGPController {
179 } 179 }
180 180
181 @Override 181 @Override
182 - public void removeConnectedPeer(BGPId bgpId) { 182 + public void removeConnectedPeer(BgpId bgpId) {
183 connectedPeers.remove(bgpId); 183 connectedPeers.remove(bgpId);
184 } 184 }
185 185
186 @Override 186 @Override
187 - public BGPPeer getPeer(BGPId bgpId) { 187 + public BgpPeer getPeer(BgpId bgpId) {
188 return connectedPeers.get(bgpId); 188 return connectedPeers.get(bgpId);
189 } 189 }
190 190
...@@ -196,9 +196,9 @@ public class BGPControllerImpl implements BGPController { ...@@ -196,9 +196,9 @@ public class BGPControllerImpl implements BGPController {
196 * @param pktStats packet statistics. 196 * @param pktStats packet statistics.
197 * @return BGPPeer peer instance. 197 * @return BGPPeer peer instance.
198 */ 198 */
199 - public BGPPeer getBGPPeerInstance(BGPController bgpController, BgpSessionInfoImpl sessionInfo, 199 + public BgpPeer getBgpPeerInstance(BgpController bgpController, BgpSessionInfoImpl sessionInfo,
200 - BGPPacketStatsImpl pktStats) { 200 + BgpPacketStatsImpl pktStats) {
201 - BGPPeer bgpPeer = new BGPPeerImpl(bgpController, sessionInfo, pktStats); 201 + BgpPeer bgpPeer = new BgpPeerImpl(bgpController, sessionInfo, pktStats);
202 return bgpPeer; 202 return bgpPeer;
203 } 203 }
204 204
...@@ -214,17 +214,17 @@ public class BGPControllerImpl implements BGPController { ...@@ -214,17 +214,17 @@ public class BGPControllerImpl implements BGPController {
214 } 214 }
215 215
216 @Override 216 @Override
217 - public ConcurrentHashMap<BGPId, BGPPeer> connectedPeers() { 217 + public ConcurrentHashMap<BgpId, BgpPeer> connectedPeers() {
218 return connectedPeers; 218 return connectedPeers;
219 } 219 }
220 220
221 @Override 221 @Override
222 - public BGPPeerManagerImpl peerManager() { 222 + public BgpPeerManagerImpl peerManager() {
223 return peerManager; 223 return peerManager;
224 } 224 }
225 225
226 @Override 226 @Override
227 - public BGPCfg getConfig() { 227 + public BgpCfg getConfig() {
228 return this.bgpconfig; 228 return this.bgpconfig;
229 } 229 }
230 230
......
...@@ -25,11 +25,11 @@ import org.slf4j.LoggerFactory; ...@@ -25,11 +25,11 @@ import org.slf4j.LoggerFactory;
25 /** 25 /**
26 * Implement sending keepalive message to connected peer periodically based on negotiated holdtime. 26 * Implement sending keepalive message to connected peer periodically based on negotiated holdtime.
27 */ 27 */
28 -public class BGPKeepAliveTimer { 28 +public class BgpKeepAliveTimer {
29 29
30 private Timer keepAliveTimer; 30 private Timer keepAliveTimer;
31 - private BGPChannelHandler handler; 31 + private BgpChannelHandler handler;
32 - private static final Logger log = LoggerFactory.getLogger(BGPKeepAliveTimer.class); 32 + private static final Logger log = LoggerFactory.getLogger(BgpKeepAliveTimer.class);
33 33
34 /** 34 /**
35 * Gets keepalive timer object. 35 * Gets keepalive timer object.
...@@ -46,7 +46,7 @@ public class BGPKeepAliveTimer { ...@@ -46,7 +46,7 @@ public class BGPKeepAliveTimer {
46 * @param h channel handler 46 * @param h channel handler
47 * @param seconds time interval. 47 * @param seconds time interval.
48 */ 48 */
49 - public BGPKeepAliveTimer(BGPChannelHandler h, int seconds) { 49 + public BgpKeepAliveTimer(BgpChannelHandler h, int seconds) {
50 this.handler = h; 50 this.handler = h;
51 this.keepAliveTimer = new Timer(); 51 this.keepAliveTimer = new Timer();
52 this.keepAliveTimer.schedule(new SendKeepAlive(), 0, seconds * 1000); 52 this.keepAliveTimer.schedule(new SendKeepAlive(), 0, seconds * 1000);
......
...@@ -22,20 +22,20 @@ import org.jboss.netty.buffer.ChannelBuffer; ...@@ -22,20 +22,20 @@ import org.jboss.netty.buffer.ChannelBuffer;
22 import org.jboss.netty.channel.Channel; 22 import org.jboss.netty.channel.Channel;
23 import org.jboss.netty.channel.ChannelHandlerContext; 23 import org.jboss.netty.channel.ChannelHandlerContext;
24 import org.jboss.netty.handler.codec.frame.FrameDecoder; 24 import org.jboss.netty.handler.codec.frame.FrameDecoder;
25 -import org.onosproject.bgpio.protocol.BGPMessage; 25 +import org.onosproject.bgpio.protocol.BgpMessage;
26 import org.onlab.util.HexDump; 26 import org.onlab.util.HexDump;
27 -import org.onosproject.bgpio.protocol.BGPFactories; 27 +import org.onosproject.bgpio.protocol.BgpFactories;
28 -import org.onosproject.bgpio.protocol.BGPMessageReader; 28 +import org.onosproject.bgpio.protocol.BgpMessageReader;
29 -import org.onosproject.bgpio.types.BGPHeader; 29 +import org.onosproject.bgpio.types.BgpHeader;
30 import org.slf4j.Logger; 30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory; 31 import org.slf4j.LoggerFactory;
32 32
33 /** 33 /**
34 * Decode an bgp message from a Channel, for use in a netty pipeline. 34 * Decode an bgp message from a Channel, for use in a netty pipeline.
35 */ 35 */
36 -public class BGPMessageDecoder extends FrameDecoder { 36 +public class BgpMessageDecoder extends FrameDecoder {
37 37
38 - protected static final Logger log = LoggerFactory.getLogger(BGPMessageDecoder.class); 38 + protected static final Logger log = LoggerFactory.getLogger(BgpMessageDecoder.class);
39 39
40 @Override 40 @Override
41 protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { 41 protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
...@@ -47,12 +47,12 @@ public class BGPMessageDecoder extends FrameDecoder { ...@@ -47,12 +47,12 @@ public class BGPMessageDecoder extends FrameDecoder {
47 47
48 HexDump.dump(buffer); 48 HexDump.dump(buffer);
49 49
50 - BGPMessageReader<BGPMessage> reader = BGPFactories.getGenericReader(); 50 + BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
51 - List<BGPMessage> msgList = new LinkedList<BGPMessage>(); 51 + List<BgpMessage> msgList = new LinkedList<BgpMessage>();
52 52
53 while (buffer.readableBytes() > 0) { 53 while (buffer.readableBytes() > 0) {
54 - BGPHeader bgpHeader = new BGPHeader(); 54 + BgpHeader bgpHeader = new BgpHeader();
55 - BGPMessage message = reader.readFrom(buffer, bgpHeader); 55 + BgpMessage message = reader.readFrom(buffer, bgpHeader);
56 msgList.add(message); 56 msgList.add(message);
57 } 57 }
58 return msgList; 58 return msgList;
......
...@@ -22,7 +22,7 @@ import org.jboss.netty.buffer.ChannelBuffers; ...@@ -22,7 +22,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
22 import org.jboss.netty.channel.Channel; 22 import org.jboss.netty.channel.Channel;
23 import org.jboss.netty.channel.ChannelHandlerContext; 23 import org.jboss.netty.channel.ChannelHandlerContext;
24 import org.jboss.netty.handler.codec.oneone.OneToOneEncoder; 24 import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
25 -import org.onosproject.bgpio.protocol.BGPMessage; 25 +import org.onosproject.bgpio.protocol.BgpMessage;
26 import org.onlab.util.HexDump; 26 import org.onlab.util.HexDump;
27 27
28 import org.slf4j.Logger; 28 import org.slf4j.Logger;
...@@ -32,8 +32,8 @@ import org.slf4j.LoggerFactory; ...@@ -32,8 +32,8 @@ import org.slf4j.LoggerFactory;
32 * Encode an bgp message for output into a ChannelBuffer, for use in a 32 * Encode an bgp message for output into a ChannelBuffer, for use in a
33 * netty pipeline. 33 * netty pipeline.
34 */ 34 */
35 -public class BGPMessageEncoder extends OneToOneEncoder { 35 +public class BgpMessageEncoder extends OneToOneEncoder {
36 - protected static final Logger log = LoggerFactory.getLogger(BGPMessageEncoder.class); 36 + protected static final Logger log = LoggerFactory.getLogger(BgpMessageEncoder.class);
37 37
38 @Override 38 @Override
39 protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { 39 protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
...@@ -44,12 +44,12 @@ public class BGPMessageEncoder extends OneToOneEncoder { ...@@ -44,12 +44,12 @@ public class BGPMessageEncoder extends OneToOneEncoder {
44 } 44 }
45 45
46 @SuppressWarnings("unchecked") 46 @SuppressWarnings("unchecked")
47 - List<BGPMessage> msglist = (List<BGPMessage>) msg; 47 + List<BgpMessage> msglist = (List<BgpMessage>) msg;
48 48
49 ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); 49 ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
50 50
51 log.debug("SENDING MESSAGE"); 51 log.debug("SENDING MESSAGE");
52 - for (BGPMessage pm : msglist) { 52 + for (BgpMessage pm : msglist) {
53 pm.writeTo(buf); 53 pm.writeTo(buf);
54 } 54 }
55 55
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 */ 15 */
16 package org.onosproject.bgp.controller.impl; 16 package org.onosproject.bgp.controller.impl;
17 17
18 -import org.onosproject.bgp.controller.BGPPacketStats; 18 +import org.onosproject.bgp.controller.BgpPacketStats;
19 19
20 /** 20 /**
21 * A representation of a packet context which allows any provider 21 * A representation of a packet context which allows any provider
...@@ -23,7 +23,7 @@ import org.onosproject.bgp.controller.BGPPacketStats; ...@@ -23,7 +23,7 @@ import org.onosproject.bgp.controller.BGPPacketStats;
23 * event if blocked has been called. This packet context can be used 23 * event if blocked has been called. This packet context can be used
24 * to react to the packet in event with a packet out. 24 * to react to the packet in event with a packet out.
25 */ 25 */
26 -public class BGPPacketStatsImpl implements BGPPacketStats { 26 +public class BgpPacketStatsImpl implements BgpPacketStats {
27 27
28 private int inPacketCount; 28 private int inPacketCount;
29 private int outPacketCount; 29 private int outPacketCount;
...@@ -33,7 +33,7 @@ public class BGPPacketStatsImpl implements BGPPacketStats { ...@@ -33,7 +33,7 @@ public class BGPPacketStatsImpl implements BGPPacketStats {
33 /** 33 /**
34 * Resets parameter. 34 * Resets parameter.
35 */ 35 */
36 - public BGPPacketStatsImpl() { 36 + public BgpPacketStatsImpl() {
37 this.inPacketCount = 0; 37 this.inPacketCount = 0;
38 this.outPacketCount = 0; 38 this.outPacketCount = 0;
39 this.wrongPacketCount = 0; 39 this.wrongPacketCount = 0;
......
...@@ -17,12 +17,12 @@ package org.onosproject.bgp.controller.impl; ...@@ -17,12 +17,12 @@ package org.onosproject.bgp.controller.impl;
17 17
18 import org.onlab.packet.Ip4Address; 18 import org.onlab.packet.Ip4Address;
19 import org.onosproject.bgp.controller.BgpConnectPeer; 19 import org.onosproject.bgp.controller.BgpConnectPeer;
20 -import org.onosproject.bgp.controller.BGPPeerCfg; 20 +import org.onosproject.bgp.controller.BgpPeerCfg;
21 21
22 /** 22 /**
23 * BGP Peer configuration information. 23 * BGP Peer configuration information.
24 */ 24 */
25 -public class BGPPeerConfig implements BGPPeerCfg { 25 +public class BgpPeerConfig implements BgpPeerCfg {
26 private int asNumber; 26 private int asNumber;
27 private short holdTime; 27 private short holdTime;
28 private boolean isIBgp; 28 private boolean isIBgp;
...@@ -34,7 +34,7 @@ public class BGPPeerConfig implements BGPPeerCfg { ...@@ -34,7 +34,7 @@ public class BGPPeerConfig implements BGPPeerCfg {
34 /** 34 /**
35 * Constructor to initialize the values. 35 * Constructor to initialize the values.
36 */ 36 */
37 - BGPPeerConfig() { 37 + BgpPeerConfig() {
38 state = State.IDLE; 38 state = State.IDLE;
39 selfInitiated = false; 39 selfInitiated = false;
40 } 40 }
......
...@@ -24,12 +24,12 @@ import java.util.concurrent.RejectedExecutionException; ...@@ -24,12 +24,12 @@ import java.util.concurrent.RejectedExecutionException;
24 24
25 import org.jboss.netty.channel.Channel; 25 import org.jboss.netty.channel.Channel;
26 import org.onlab.packet.IpAddress; 26 import org.onlab.packet.IpAddress;
27 -import org.onosproject.bgp.controller.BGPController; 27 +import org.onosproject.bgp.controller.BgpController;
28 -import org.onosproject.bgp.controller.BGPPeer; 28 +import org.onosproject.bgp.controller.BgpPeer;
29 import org.onosproject.bgp.controller.BgpSessionInfo; 29 import org.onosproject.bgp.controller.BgpSessionInfo;
30 -import org.onosproject.bgpio.protocol.BGPFactories; 30 +import org.onosproject.bgpio.protocol.BgpFactories;
31 -import org.onosproject.bgpio.protocol.BGPFactory; 31 +import org.onosproject.bgpio.protocol.BgpFactory;
32 -import org.onosproject.bgpio.protocol.BGPMessage; 32 +import org.onosproject.bgpio.protocol.BgpMessage;
33 import org.slf4j.Logger; 33 import org.slf4j.Logger;
34 import org.slf4j.LoggerFactory; 34 import org.slf4j.LoggerFactory;
35 35
...@@ -38,19 +38,19 @@ import com.google.common.base.MoreObjects; ...@@ -38,19 +38,19 @@ import com.google.common.base.MoreObjects;
38 /** 38 /**
39 * BGPPeerImpl implements BGPPeer, maintains peer information and store updates in RIB . 39 * BGPPeerImpl implements BGPPeer, maintains peer information and store updates in RIB .
40 */ 40 */
41 -public class BGPPeerImpl implements BGPPeer { 41 +public class BgpPeerImpl implements BgpPeer {
42 42
43 - protected final Logger log = LoggerFactory.getLogger(BGPPeerImpl.class); 43 + protected final Logger log = LoggerFactory.getLogger(BgpPeerImpl.class);
44 44
45 private static final String SHUTDOWN_MSG = "Worker has already been shutdown"; 45 private static final String SHUTDOWN_MSG = "Worker has already been shutdown";
46 46
47 - private BGPController bgpController; 47 + private BgpController bgpController;
48 private Channel channel; 48 private Channel channel;
49 protected String channelId; 49 protected String channelId;
50 private boolean connected; 50 private boolean connected;
51 protected boolean isHandShakeComplete = false; 51 protected boolean isHandShakeComplete = false;
52 private BgpSessionInfo sessionInfo; 52 private BgpSessionInfo sessionInfo;
53 - private BGPPacketStatsImpl pktStats; 53 + private BgpPacketStatsImpl pktStats;
54 54
55 55
56 @Override 56 @Override
...@@ -65,7 +65,7 @@ public class BGPPeerImpl implements BGPPeer { ...@@ -65,7 +65,7 @@ public class BGPPeerImpl implements BGPPeer {
65 *@param sessionInfo bgp session info 65 *@param sessionInfo bgp session info
66 *@param pktStats packet statistics 66 *@param pktStats packet statistics
67 */ 67 */
68 - public BGPPeerImpl(BGPController bgpController, BgpSessionInfo sessionInfo, BGPPacketStatsImpl pktStats) { 68 + public BgpPeerImpl(BgpController bgpController, BgpSessionInfo sessionInfo, BgpPacketStatsImpl pktStats) {
69 this.bgpController = bgpController; 69 this.bgpController = bgpController;
70 this.sessionInfo = sessionInfo; 70 this.sessionInfo = sessionInfo;
71 this.pktStats = pktStats; 71 this.pktStats = pktStats;
...@@ -81,7 +81,7 @@ public class BGPPeerImpl implements BGPPeer { ...@@ -81,7 +81,7 @@ public class BGPPeerImpl implements BGPPeer {
81 } 81 }
82 82
83 @Override 83 @Override
84 - public final void sendMessage(BGPMessage m) { 84 + public final void sendMessage(BgpMessage m) {
85 log.debug("Sending message to {}", channel.getRemoteAddress()); 85 log.debug("Sending message to {}", channel.getRemoteAddress());
86 try { 86 try {
87 channel.write(Collections.singletonList(m)); 87 channel.write(Collections.singletonList(m));
...@@ -95,7 +95,7 @@ public class BGPPeerImpl implements BGPPeer { ...@@ -95,7 +95,7 @@ public class BGPPeerImpl implements BGPPeer {
95 } 95 }
96 96
97 @Override 97 @Override
98 - public final void sendMessage(List<BGPMessage> msgs) { 98 + public final void sendMessage(List<BgpMessage> msgs) {
99 try { 99 try {
100 channel.write(msgs); 100 channel.write(msgs);
101 this.pktStats.addOutPacket(msgs.size()); 101 this.pktStats.addOutPacket(msgs.size());
...@@ -143,8 +143,8 @@ public class BGPPeerImpl implements BGPPeer { ...@@ -143,8 +143,8 @@ public class BGPPeerImpl implements BGPPeer {
143 } 143 }
144 144
145 @Override 145 @Override
146 - public BGPFactory factory() { 146 + public BgpFactory factory() {
147 - return BGPFactories.getFactory(sessionInfo.remoteBgpVersion()); 147 + return BgpFactories.getFactory(sessionInfo.remoteBgpVersion());
148 } 148 }
149 149
150 @Override 150 @Override
......
...@@ -23,18 +23,18 @@ import org.jboss.netty.handler.timeout.ReadTimeoutHandler; ...@@ -23,18 +23,18 @@ import org.jboss.netty.handler.timeout.ReadTimeoutHandler;
23 import org.jboss.netty.util.ExternalResourceReleasable; 23 import org.jboss.netty.util.ExternalResourceReleasable;
24 import org.jboss.netty.util.HashedWheelTimer; 24 import org.jboss.netty.util.HashedWheelTimer;
25 import org.jboss.netty.util.Timer; 25 import org.jboss.netty.util.Timer;
26 -import org.onosproject.bgp.controller.BGPController; 26 +import org.onosproject.bgp.controller.BgpController;
27 27
28 /** 28 /**
29 * Creates a ChannelPipeline for a server-side bgp channel. 29 * Creates a ChannelPipeline for a server-side bgp channel.
30 */ 30 */
31 -public class BGPPipelineFactory 31 +public class BgpPipelineFactory
32 implements ChannelPipelineFactory, ExternalResourceReleasable { 32 implements ChannelPipelineFactory, ExternalResourceReleasable {
33 33
34 static final Timer TIMER = new HashedWheelTimer(); 34 static final Timer TIMER = new HashedWheelTimer();
35 protected ReadTimeoutHandler readTimeoutHandler; 35 protected ReadTimeoutHandler readTimeoutHandler;
36 private boolean isBgpServ; 36 private boolean isBgpServ;
37 - private BGPController bgpController; 37 + private BgpController bgpController;
38 38
39 /** 39 /**
40 * Constructor to initialize the values. 40 * Constructor to initialize the values.
...@@ -42,7 +42,7 @@ public class BGPPipelineFactory ...@@ -42,7 +42,7 @@ public class BGPPipelineFactory
42 * @param bgpController parent controller 42 * @param bgpController parent controller
43 * @param isBgpServ if it is a server or remote peer 43 * @param isBgpServ if it is a server or remote peer
44 */ 44 */
45 - public BGPPipelineFactory(BGPController bgpController, boolean isBgpServ) { 45 + public BgpPipelineFactory(BgpController bgpController, boolean isBgpServ) {
46 super(); 46 super();
47 this.isBgpServ = isBgpServ; 47 this.isBgpServ = isBgpServ;
48 this.bgpController = bgpController; 48 this.bgpController = bgpController;
...@@ -52,11 +52,11 @@ public class BGPPipelineFactory ...@@ -52,11 +52,11 @@ public class BGPPipelineFactory
52 52
53 @Override 53 @Override
54 public ChannelPipeline getPipeline() throws Exception { 54 public ChannelPipeline getPipeline() throws Exception {
55 - BGPChannelHandler handler = new BGPChannelHandler(bgpController); 55 + BgpChannelHandler handler = new BgpChannelHandler(bgpController);
56 56
57 ChannelPipeline pipeline = Channels.pipeline(); 57 ChannelPipeline pipeline = Channels.pipeline();
58 - pipeline.addLast("bgpmessagedecoder", new BGPMessageDecoder()); 58 + pipeline.addLast("bgpmessagedecoder", new BgpMessageDecoder());
59 - pipeline.addLast("bgpmessageencoder", new BGPMessageEncoder()); 59 + pipeline.addLast("bgpmessageencoder", new BgpMessageEncoder());
60 pipeline.addLast("holdTime", readTimeoutHandler); 60 pipeline.addLast("holdTime", readTimeoutHandler);
61 if (isBgpServ) { 61 if (isBgpServ) {
62 pipeline.addLast("PassiveHandler", handler); 62 pipeline.addLast("PassiveHandler", handler);
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
13 13
14 package org.onosproject.bgp.controller.impl; 14 package org.onosproject.bgp.controller.impl;
15 15
16 -import org.onosproject.bgp.controller.BGPId; 16 +import org.onosproject.bgp.controller.BgpId;
17 import org.onosproject.bgp.controller.BgpSessionInfo; 17 import org.onosproject.bgp.controller.BgpSessionInfo;
18 -import org.onosproject.bgpio.protocol.BGPVersion; 18 +import org.onosproject.bgpio.protocol.BgpVersion;
19 import org.slf4j.Logger; 19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory; 20 import org.slf4j.LoggerFactory;
21 21
...@@ -25,8 +25,8 @@ import org.slf4j.LoggerFactory; ...@@ -25,8 +25,8 @@ import org.slf4j.LoggerFactory;
25 public class BgpSessionInfoImpl implements BgpSessionInfo { 25 public class BgpSessionInfoImpl implements BgpSessionInfo {
26 26
27 protected final Logger log = LoggerFactory.getLogger(BgpSessionInfoImpl.class); 27 protected final Logger log = LoggerFactory.getLogger(BgpSessionInfoImpl.class);
28 - private BGPId remoteBgpId; 28 + private BgpId remoteBgpId;
29 - private BGPVersion remoteBgpVersion; 29 + private BgpVersion remoteBgpVersion;
30 private long remoteBgpASNum; 30 private long remoteBgpASNum;
31 private short remoteBgpholdTime; 31 private short remoteBgpholdTime;
32 private int remoteBgpIdentifier; 32 private int remoteBgpIdentifier;
...@@ -44,7 +44,7 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { ...@@ -44,7 +44,7 @@ public class BgpSessionInfoImpl implements BgpSessionInfo {
44 *@param negotiatedholdTime negotiated hold time 44 *@param negotiatedholdTime negotiated hold time
45 *@param isIbgpSession session type ibgp/ebgp 45 *@param isIbgpSession session type ibgp/ebgp
46 */ 46 */
47 - public BgpSessionInfoImpl(BGPId remoteBgpId, BGPVersion remoteBgpVersion, long remoteBgpASNum, 47 + public BgpSessionInfoImpl(BgpId remoteBgpId, BgpVersion remoteBgpVersion, long remoteBgpASNum,
48 short remoteBgpholdTime, int remoteBgpIdentifier, short negotiatedholdTime, 48 short remoteBgpholdTime, int remoteBgpIdentifier, short negotiatedholdTime,
49 boolean isIbgpSession) { 49 boolean isIbgpSession) {
50 this.remoteBgpId = remoteBgpId; 50 this.remoteBgpId = remoteBgpId;
...@@ -67,12 +67,12 @@ public class BgpSessionInfoImpl implements BgpSessionInfo { ...@@ -67,12 +67,12 @@ public class BgpSessionInfoImpl implements BgpSessionInfo {
67 } 67 }
68 68
69 @Override 69 @Override
70 - public BGPId remoteBgpId() { 70 + public BgpId remoteBgpId() {
71 return remoteBgpId; 71 return remoteBgpId;
72 } 72 }
73 73
74 @Override 74 @Override
75 - public BGPVersion remoteBgpVersion() { 75 + public BgpVersion remoteBgpVersion() {
76 return remoteBgpVersion; 76 return remoteBgpVersion;
77 } 77 }
78 78
......
...@@ -32,10 +32,10 @@ import org.jboss.netty.channel.group.ChannelGroup; ...@@ -32,10 +32,10 @@ import org.jboss.netty.channel.group.ChannelGroup;
32 import org.jboss.netty.channel.group.DefaultChannelGroup; 32 import org.jboss.netty.channel.group.DefaultChannelGroup;
33 import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory; 33 import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
34 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; 34 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
35 -import org.onosproject.bgp.controller.BGPController; 35 +import org.onosproject.bgp.controller.BgpController;
36 -import org.onosproject.bgpio.protocol.BGPFactories; 36 +import org.onosproject.bgpio.protocol.BgpFactories;
37 -import org.onosproject.bgpio.protocol.BGPFactory; 37 +import org.onosproject.bgpio.protocol.BgpFactory;
38 -import org.onosproject.bgpio.protocol.BGPVersion; 38 +import org.onosproject.bgpio.protocol.BgpVersion;
39 import org.slf4j.Logger; 39 import org.slf4j.Logger;
40 import org.slf4j.LoggerFactory; 40 import org.slf4j.LoggerFactory;
41 41
...@@ -47,7 +47,7 @@ public class Controller { ...@@ -47,7 +47,7 @@ public class Controller {
47 47
48 private static final Logger log = LoggerFactory.getLogger(Controller.class); 48 private static final Logger log = LoggerFactory.getLogger(Controller.class);
49 49
50 - private static final BGPFactory FACTORY4 = BGPFactories.getFactory(BGPVersion.BGP_4); 50 + private static final BgpFactory FACTORY4 = BgpFactories.getFactory(BgpVersion.BGP_4);
51 51
52 private ChannelGroup cg; 52 private ChannelGroup cg;
53 public Channel serverChannel; 53 public Channel serverChannel;
...@@ -65,7 +65,7 @@ public class Controller { ...@@ -65,7 +65,7 @@ public class Controller {
65 private NioServerSocketChannelFactory serverExecFactory; 65 private NioServerSocketChannelFactory serverExecFactory;
66 private NioClientSocketChannelFactory peerExecFactory; 66 private NioClientSocketChannelFactory peerExecFactory;
67 private static ClientBootstrap peerBootstrap; 67 private static ClientBootstrap peerBootstrap;
68 - private BGPController bgpController; 68 + private BgpController bgpController;
69 69
70 // Perf. related configuration 70 // Perf. related configuration
71 private static final int SEND_BUFFER_SIZE = 4 * 1024 * 1024; 71 private static final int SEND_BUFFER_SIZE = 4 * 1024 * 1024;
...@@ -75,7 +75,7 @@ public class Controller { ...@@ -75,7 +75,7 @@ public class Controller {
75 * 75 *
76 * @param bgpController bgp controller instance 76 * @param bgpController bgp controller instance
77 */ 77 */
78 - public Controller(BGPController bgpController) { 78 + public Controller(BgpController bgpController) {
79 this.bgpController = bgpController; 79 this.bgpController = bgpController;
80 } 80 }
81 81
...@@ -84,7 +84,7 @@ public class Controller { ...@@ -84,7 +84,7 @@ public class Controller {
84 * 84 *
85 * @return instance of factory version 85 * @return instance of factory version
86 */ 86 */
87 - static BGPFactory getBGPMessageFactory4() { 87 + static BgpFactory getBgpMessageFactory4() {
88 return FACTORY4; 88 return FACTORY4;
89 } 89 }
90 90
...@@ -118,7 +118,7 @@ public class Controller { ...@@ -118,7 +118,7 @@ public class Controller {
118 bootstrap.setOption("child.tcpNoDelay", true); 118 bootstrap.setOption("child.tcpNoDelay", true);
119 bootstrap.setOption("child.sendBufferSize", Controller.SEND_BUFFER_SIZE); 119 bootstrap.setOption("child.sendBufferSize", Controller.SEND_BUFFER_SIZE);
120 120
121 - ChannelPipelineFactory pfact = new BGPPipelineFactory(bgpController, true); 121 + ChannelPipelineFactory pfact = new BgpPipelineFactory(bgpController, true);
122 122
123 bootstrap.setPipelineFactory(pfact); 123 bootstrap.setPipelineFactory(pfact);
124 InetSocketAddress sa = new InetSocketAddress(getBgpPortNum()); 124 InetSocketAddress sa = new InetSocketAddress(getBgpPortNum());
......
...@@ -19,13 +19,13 @@ package org.onosproject.bgp.controller.impl; ...@@ -19,13 +19,13 @@ package org.onosproject.bgp.controller.impl;
19 import java.util.Map; 19 import java.util.Map;
20 import java.util.TreeMap; 20 import java.util.TreeMap;
21 21
22 -import org.onosproject.bgpio.protocol.BGPLSNlri; 22 +import org.onosproject.bgpio.protocol.BgpLSNlri;
23 -import org.onosproject.bgpio.protocol.linkstate.BGPLinkLSIdentifier; 23 +import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier;
24 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 24 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
25 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSIdentifier; 25 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier;
26 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 26 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
27 -import org.onosproject.bgpio.protocol.linkstate.BGPPrefixIPv4LSNlriVer4; 27 +import org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4;
28 -import org.onosproject.bgpio.protocol.linkstate.BGPPrefixLSIdentifier; 28 +import org.onosproject.bgpio.protocol.linkstate.BgpPrefixLSIdentifier;
29 import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails; 29 import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
30 import org.onosproject.bgpio.types.RouteDistinguisher; 30 import org.onosproject.bgpio.types.RouteDistinguisher;
31 31
...@@ -35,22 +35,22 @@ import com.google.common.base.MoreObjects; ...@@ -35,22 +35,22 @@ import com.google.common.base.MoreObjects;
35 * Implementation of Adj-RIB-In with VPN for each peer. 35 * Implementation of Adj-RIB-In with VPN for each peer.
36 */ 36 */
37 public class VpnAdjRibIn { 37 public class VpnAdjRibIn {
38 - private Map<BGPNodeLSIdentifier, PathAttrNlriDetails> nodeTree = new TreeMap<>(); 38 + private Map<BgpNodeLSIdentifier, PathAttrNlriDetails> nodeTree = new TreeMap<>();
39 - private Map<BGPLinkLSIdentifier, PathAttrNlriDetails> linkTree = new TreeMap<>(); 39 + private Map<BgpLinkLSIdentifier, PathAttrNlriDetails> linkTree = new TreeMap<>();
40 - private Map<BGPPrefixLSIdentifier, PathAttrNlriDetails> prefixTree = new TreeMap<>(); 40 + private Map<BgpPrefixLSIdentifier, PathAttrNlriDetails> prefixTree = new TreeMap<>();
41 41
42 - private Map<RouteDistinguisher, Map<BGPNodeLSIdentifier, PathAttrNlriDetails>> vpnNodeTree 42 + private Map<RouteDistinguisher, Map<BgpNodeLSIdentifier, PathAttrNlriDetails>> vpnNodeTree
43 = new TreeMap<>(); 43 = new TreeMap<>();
44 - private Map<RouteDistinguisher, Map<BGPLinkLSIdentifier, PathAttrNlriDetails>> vpnLinkTree 44 + private Map<RouteDistinguisher, Map<BgpLinkLSIdentifier, PathAttrNlriDetails>> vpnLinkTree
45 = new TreeMap<>(); 45 = new TreeMap<>();
46 - private Map<RouteDistinguisher, Map<BGPPrefixLSIdentifier, PathAttrNlriDetails>> vpnPrefixTree 46 + private Map<RouteDistinguisher, Map<BgpPrefixLSIdentifier, PathAttrNlriDetails>> vpnPrefixTree
47 = new TreeMap<>(); 47 = new TreeMap<>();
48 /** 48 /**
49 * Returns the adjacency node. 49 * Returns the adjacency node.
50 * 50 *
51 * @return node adjacency RIB node 51 * @return node adjacency RIB node
52 */ 52 */
53 - public Map<BGPNodeLSIdentifier, PathAttrNlriDetails> nodeTree() { 53 + public Map<BgpNodeLSIdentifier, PathAttrNlriDetails> nodeTree() {
54 return nodeTree; 54 return nodeTree;
55 } 55 }
56 56
...@@ -59,7 +59,7 @@ public class VpnAdjRibIn { ...@@ -59,7 +59,7 @@ public class VpnAdjRibIn {
59 * 59 *
60 * @return link adjacency RIB node 60 * @return link adjacency RIB node
61 */ 61 */
62 - public Map<BGPLinkLSIdentifier, PathAttrNlriDetails> linkTree() { 62 + public Map<BgpLinkLSIdentifier, PathAttrNlriDetails> linkTree() {
63 return linkTree; 63 return linkTree;
64 } 64 }
65 65
...@@ -68,7 +68,7 @@ public class VpnAdjRibIn { ...@@ -68,7 +68,7 @@ public class VpnAdjRibIn {
68 * 68 *
69 * @return prefix adjacency RIB node 69 * @return prefix adjacency RIB node
70 */ 70 */
71 - public Map<BGPPrefixLSIdentifier, PathAttrNlriDetails> prefixTree() { 71 + public Map<BgpPrefixLSIdentifier, PathAttrNlriDetails> prefixTree() {
72 return prefixTree; 72 return prefixTree;
73 } 73 }
74 74
...@@ -77,7 +77,7 @@ public class VpnAdjRibIn { ...@@ -77,7 +77,7 @@ public class VpnAdjRibIn {
77 * 77 *
78 * @return vpnNode adjacency RIB node 78 * @return vpnNode adjacency RIB node
79 */ 79 */
80 - public Map<RouteDistinguisher, Map<BGPNodeLSIdentifier, PathAttrNlriDetails>> vpnNodeTree() { 80 + public Map<RouteDistinguisher, Map<BgpNodeLSIdentifier, PathAttrNlriDetails>> vpnNodeTree() {
81 return vpnNodeTree; 81 return vpnNodeTree;
82 } 82 }
83 83
...@@ -86,7 +86,7 @@ public class VpnAdjRibIn { ...@@ -86,7 +86,7 @@ public class VpnAdjRibIn {
86 * 86 *
87 * @return vpnLink adjacency RIB node 87 * @return vpnLink adjacency RIB node
88 */ 88 */
89 - public Map<RouteDistinguisher, Map<BGPLinkLSIdentifier, PathAttrNlriDetails>> vpnLinkTree() { 89 + public Map<RouteDistinguisher, Map<BgpLinkLSIdentifier, PathAttrNlriDetails>> vpnLinkTree() {
90 return vpnLinkTree; 90 return vpnLinkTree;
91 } 91 }
92 92
...@@ -95,7 +95,7 @@ public class VpnAdjRibIn { ...@@ -95,7 +95,7 @@ public class VpnAdjRibIn {
95 * 95 *
96 * @return vpnPrefix adjacency RIB node 96 * @return vpnPrefix adjacency RIB node
97 */ 97 */
98 - public Map<RouteDistinguisher, Map<BGPPrefixLSIdentifier, PathAttrNlriDetails>> vpnPrefixTree() { 98 + public Map<RouteDistinguisher, Map<BgpPrefixLSIdentifier, PathAttrNlriDetails>> vpnPrefixTree() {
99 return vpnPrefixTree; 99 return vpnPrefixTree;
100 } 100 }
101 101
...@@ -105,23 +105,23 @@ public class VpnAdjRibIn { ...@@ -105,23 +105,23 @@ public class VpnAdjRibIn {
105 * @param nlri NLRI info 105 * @param nlri NLRI info
106 * @param details has pathattribute , protocolID and identifier 106 * @param details has pathattribute , protocolID and identifier
107 */ 107 */
108 - public void add(BGPLSNlri nlri, PathAttrNlriDetails details) { 108 + public void add(BgpLSNlri nlri, PathAttrNlriDetails details) {
109 - if (nlri instanceof BGPNodeLSNlriVer4) { 109 + if (nlri instanceof BgpNodeLSNlriVer4) {
110 - BGPNodeLSIdentifier nodeLSIdentifier = ((BGPNodeLSNlriVer4) nlri).getLocalNodeDescriptors(); 110 + BgpNodeLSIdentifier nodeLSIdentifier = ((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors();
111 if (nodeTree.containsKey(nodeLSIdentifier)) { 111 if (nodeTree.containsKey(nodeLSIdentifier)) {
112 nodeTree.replace(nodeLSIdentifier, details); 112 nodeTree.replace(nodeLSIdentifier, details);
113 } else { 113 } else {
114 nodeTree.put(nodeLSIdentifier, details); 114 nodeTree.put(nodeLSIdentifier, details);
115 } 115 }
116 } else if (nlri instanceof BgpLinkLsNlriVer4) { 116 } else if (nlri instanceof BgpLinkLsNlriVer4) {
117 - BGPLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier(); 117 + BgpLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier();
118 if (linkTree.containsKey(linkLSIdentifier)) { 118 if (linkTree.containsKey(linkLSIdentifier)) {
119 linkTree.replace(linkLSIdentifier, details); 119 linkTree.replace(linkLSIdentifier, details);
120 } else { 120 } else {
121 linkTree.put(linkLSIdentifier, details); 121 linkTree.put(linkLSIdentifier, details);
122 } 122 }
123 - } else if (nlri instanceof BGPPrefixIPv4LSNlriVer4) { 123 + } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) {
124 - BGPPrefixLSIdentifier prefixIdentifier = ((BGPPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier(); 124 + BgpPrefixLSIdentifier prefixIdentifier = ((BgpPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier();
125 if (prefixTree.containsKey(prefixIdentifier)) { 125 if (prefixTree.containsKey(prefixIdentifier)) {
126 prefixTree.replace(prefixIdentifier, details); 126 prefixTree.replace(prefixIdentifier, details);
127 } else { 127 } else {
...@@ -138,9 +138,9 @@ public class VpnAdjRibIn { ...@@ -138,9 +138,9 @@ public class VpnAdjRibIn {
138 * @param details has pathattribute , protocolID and identifier 138 * @param details has pathattribute , protocolID and identifier
139 * @param routeDistinguisher unique for for each vpn 139 * @param routeDistinguisher unique for for each vpn
140 */ 140 */
141 - public void addVpn(BGPLSNlri nlri, PathAttrNlriDetails details, RouteDistinguisher routeDistinguisher) { 141 + public void addVpn(BgpLSNlri nlri, PathAttrNlriDetails details, RouteDistinguisher routeDistinguisher) {
142 add(nlri, details); 142 add(nlri, details);
143 - if (nlri instanceof BGPNodeLSNlriVer4) { 143 + if (nlri instanceof BgpNodeLSNlriVer4) {
144 if (!vpnNodeTree.containsKey(routeDistinguisher)) { 144 if (!vpnNodeTree.containsKey(routeDistinguisher)) {
145 vpnNodeTree.put(routeDistinguisher, nodeTree); 145 vpnNodeTree.put(routeDistinguisher, nodeTree);
146 } 146 }
...@@ -148,7 +148,7 @@ public class VpnAdjRibIn { ...@@ -148,7 +148,7 @@ public class VpnAdjRibIn {
148 if (!vpnLinkTree.containsKey(routeDistinguisher)) { 148 if (!vpnLinkTree.containsKey(routeDistinguisher)) {
149 vpnLinkTree.put(routeDistinguisher, linkTree); 149 vpnLinkTree.put(routeDistinguisher, linkTree);
150 } 150 }
151 - } else if (nlri instanceof BGPPrefixIPv4LSNlriVer4) { 151 + } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) {
152 if (!vpnPrefixTree.containsKey(routeDistinguisher)) { 152 if (!vpnPrefixTree.containsKey(routeDistinguisher)) {
153 vpnPrefixTree.put(routeDistinguisher, prefixTree); 153 vpnPrefixTree.put(routeDistinguisher, prefixTree);
154 } 154 }
...@@ -161,10 +161,10 @@ public class VpnAdjRibIn { ...@@ -161,10 +161,10 @@ public class VpnAdjRibIn {
161 * @param nlri NLRI Info 161 * @param nlri NLRI Info
162 * @param routeDistinguisher unique for for each vpn 162 * @param routeDistinguisher unique for for each vpn
163 */ 163 */
164 - public void removeVpn(BGPLSNlri nlri, RouteDistinguisher routeDistinguisher) { 164 + public void removeVpn(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) {
165 - if (nlri instanceof BGPNodeLSNlriVer4) { 165 + if (nlri instanceof BgpNodeLSNlriVer4) {
166 if (vpnNodeTree.containsKey(routeDistinguisher)) { 166 if (vpnNodeTree.containsKey(routeDistinguisher)) {
167 - BGPNodeLSIdentifier nodeLSIdentifier = ((BGPNodeLSNlriVer4) nlri).getLocalNodeDescriptors(); 167 + BgpNodeLSIdentifier nodeLSIdentifier = ((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors();
168 if (nodeTree.containsKey(nodeLSIdentifier)) { 168 if (nodeTree.containsKey(nodeLSIdentifier)) {
169 nodeTree.remove(nodeLSIdentifier); 169 nodeTree.remove(nodeLSIdentifier);
170 } 170 }
...@@ -174,7 +174,7 @@ public class VpnAdjRibIn { ...@@ -174,7 +174,7 @@ public class VpnAdjRibIn {
174 } 174 }
175 } else if (nlri instanceof BgpLinkLsNlriVer4) { 175 } else if (nlri instanceof BgpLinkLsNlriVer4) {
176 if (vpnLinkTree.containsKey(routeDistinguisher)) { 176 if (vpnLinkTree.containsKey(routeDistinguisher)) {
177 - BGPLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier(); 177 + BgpLinkLSIdentifier linkLSIdentifier = ((BgpLinkLsNlriVer4) nlri).getLinkIdentifier();
178 if (linkTree.containsKey(linkLSIdentifier)) { 178 if (linkTree.containsKey(linkLSIdentifier)) {
179 linkTree.remove(linkLSIdentifier); 179 linkTree.remove(linkLSIdentifier);
180 } 180 }
...@@ -182,9 +182,9 @@ public class VpnAdjRibIn { ...@@ -182,9 +182,9 @@ public class VpnAdjRibIn {
182 vpnLinkTree.remove(routeDistinguisher); 182 vpnLinkTree.remove(routeDistinguisher);
183 } 183 }
184 } 184 }
185 - } else if (nlri instanceof BGPPrefixIPv4LSNlriVer4) { 185 + } else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) {
186 if (vpnPrefixTree.containsKey(routeDistinguisher)) { 186 if (vpnPrefixTree.containsKey(routeDistinguisher)) {
187 - BGPPrefixLSIdentifier prefixIdentifier = ((BGPPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier(); 187 + BgpPrefixLSIdentifier prefixIdentifier = ((BgpPrefixIPv4LSNlriVer4) nlri).getPrefixIdentifier();
188 if (prefixTree.containsKey(prefixIdentifier)) { 188 if (prefixTree.containsKey(prefixIdentifier)) {
189 prefixTree.remove(prefixIdentifier); 189 prefixTree.remove(prefixIdentifier);
190 } 190 }
......
...@@ -42,19 +42,19 @@ import java.util.concurrent.TimeUnit; ...@@ -42,19 +42,19 @@ import java.util.concurrent.TimeUnit;
42 import org.slf4j.Logger; 42 import org.slf4j.Logger;
43 import org.slf4j.LoggerFactory; 43 import org.slf4j.LoggerFactory;
44 44
45 -import org.onosproject.bgp.controller.BGPCfg; 45 +import org.onosproject.bgp.controller.BgpCfg;
46 -import org.onosproject.bgp.controller.impl.BGPControllerImpl; 46 +import org.onosproject.bgp.controller.impl.BgpControllerImpl;
47 -import org.onosproject.bgpio.types.BGPValueType; 47 +import org.onosproject.bgpio.types.BgpValueType;
48 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv; 48 import org.onosproject.bgpio.types.FourOctetAsNumCapabilityTlv;
49 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv; 49 import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv;
50 50
51 /** 51 /**
52 * Test case for BGPControllerImpl. 52 * Test case for BGPControllerImpl.
53 */ 53 */
54 -public class BGPControllerImplTest { 54 +public class BgpControllerImplTest {
55 55
56 protected static final Logger log = LoggerFactory 56 protected static final Logger log = LoggerFactory
57 - .getLogger(BGPControllerImplTest.class); 57 + .getLogger(BgpControllerImplTest.class);
58 58
59 private static final String IP_LOOPBACK_ID1 = "127.0.0.1"; 59 private static final String IP_LOOPBACK_ID1 = "127.0.0.1";
60 60
...@@ -64,7 +64,7 @@ public class BGPControllerImplTest { ...@@ -64,7 +64,7 @@ public class BGPControllerImplTest {
64 public short holdTime; 64 public short holdTime;
65 public int bgpId = InetAddresses.coerceToInteger(InetAddresses.forString(IP_LOOPBACK_ID1)); 65 public int bgpId = InetAddresses.coerceToInteger(InetAddresses.forString(IP_LOOPBACK_ID1));
66 public boolean isLargeAsCapabilitySet = false; 66 public boolean isLargeAsCapabilitySet = false;
67 - public LinkedList<BGPValueType> capabilityTlv = new LinkedList<>(); 67 + public LinkedList<BgpValueType> capabilityTlv = new LinkedList<>();
68 68
69 @Before 69 @Before
70 public void setUp() throws Exception { 70 public void setUp() throws Exception {
...@@ -72,7 +72,7 @@ public class BGPControllerImplTest { ...@@ -72,7 +72,7 @@ public class BGPControllerImplTest {
72 holdTime, bgpId, isLargeAsCapabilitySet, 72 holdTime, bgpId, isLargeAsCapabilitySet,
73 capabilityTlv); 73 capabilityTlv);
74 74
75 - bgpControllerImpl = new BGPControllerImpl(); 75 + bgpControllerImpl = new BgpControllerImpl();
76 76
77 // NOTE: We use port 0 to bind on any available port 77 // NOTE: We use port 0 to bind on any available port
78 bgpControllerImpl.controller().setBgpPortNum(); 78 bgpControllerImpl.controller().setBgpPortNum();
...@@ -90,7 +90,7 @@ public class BGPControllerImplTest { ...@@ -90,7 +90,7 @@ public class BGPControllerImplTest {
90 bgpControllerImpl.getConfig().setRouterId("1.1.1.1"); 90 bgpControllerImpl.getConfig().setRouterId("1.1.1.1");
91 bgpControllerImpl.getConfig().setAsNumber(200); 91 bgpControllerImpl.getConfig().setAsNumber(200);
92 bgpControllerImpl.getConfig().setHoldTime((short) 120); 92 bgpControllerImpl.getConfig().setHoldTime((short) 120);
93 - bgpControllerImpl.getConfig().setState(BGPCfg.State.IP_AS_CONFIGURED); 93 + bgpControllerImpl.getConfig().setState(BgpCfg.State.IP_AS_CONFIGURED);
94 94
95 bgpControllerImpl.getConfig().addPeer("127.0.0.1", 200); 95 bgpControllerImpl.getConfig().addPeer("127.0.0.1", 200);
96 } 96 }
...@@ -101,7 +101,7 @@ public class BGPControllerImplTest { ...@@ -101,7 +101,7 @@ public class BGPControllerImplTest {
101 bgpControllerImpl = null; 101 bgpControllerImpl = null;
102 } 102 }
103 103
104 - private BGPControllerImpl bgpControllerImpl; 104 + private BgpControllerImpl bgpControllerImpl;
105 105
106 BgpPeerTest peer1; 106 BgpPeerTest peer1;
107 107
...@@ -162,7 +162,7 @@ public class BGPControllerImplTest { ...@@ -162,7 +162,7 @@ public class BGPControllerImplTest {
162 peer1.peerChannelHandler.version = 4; 162 peer1.peerChannelHandler.version = 4;
163 peer1.peerChannelHandler.holdTime = 120; 163 peer1.peerChannelHandler.holdTime = 120;
164 peer1.peerChannelHandler.isLargeAsCapabilitySet = true; 164 peer1.peerChannelHandler.isLargeAsCapabilitySet = true;
165 - BGPValueType tempTlv = new FourOctetAsNumCapabilityTlv(766545); 165 + BgpValueType tempTlv = new FourOctetAsNumCapabilityTlv(766545);
166 peer1.peerChannelHandler.capabilityTlv.add(tempTlv); 166 peer1.peerChannelHandler.capabilityTlv.add(tempTlv);
167 peer1.connect(connectToSocket); 167 peer1.connect(connectToSocket);
168 168
...@@ -183,7 +183,7 @@ public class BGPControllerImplTest { ...@@ -183,7 +183,7 @@ public class BGPControllerImplTest {
183 peer1.peerChannelHandler.version = 4; 183 peer1.peerChannelHandler.version = 4;
184 peer1.peerChannelHandler.holdTime = 120; 184 peer1.peerChannelHandler.holdTime = 120;
185 bgpControllerImpl.getConfig().setLsCapability(true); 185 bgpControllerImpl.getConfig().setLsCapability(true);
186 - BGPValueType tempTlv1 = new MultiProtocolExtnCapabilityTlv(afi, res, safi); 186 + BgpValueType tempTlv1 = new MultiProtocolExtnCapabilityTlv(afi, res, safi);
187 peer1.peerChannelHandler.capabilityTlv.add(tempTlv1); 187 peer1.peerChannelHandler.capabilityTlv.add(tempTlv1);
188 peer1.connect(connectToSocket); 188 peer1.connect(connectToSocket);
189 189
...@@ -206,7 +206,7 @@ public class BGPControllerImplTest { ...@@ -206,7 +206,7 @@ public class BGPControllerImplTest {
206 peer1.peerChannelHandler.holdTime = 120; 206 peer1.peerChannelHandler.holdTime = 120;
207 peer1.peerChannelHandler.isLargeAsCapabilitySet = true; 207 peer1.peerChannelHandler.isLargeAsCapabilitySet = true;
208 bgpControllerImpl.getConfig().setLargeASCapability(true); 208 bgpControllerImpl.getConfig().setLargeASCapability(true);
209 - BGPValueType tempTlv = new FourOctetAsNumCapabilityTlv(200); 209 + BgpValueType tempTlv = new FourOctetAsNumCapabilityTlv(200);
210 peer1.peerChannelHandler.capabilityTlv.add(tempTlv); 210 peer1.peerChannelHandler.capabilityTlv.add(tempTlv);
211 peer1.connect(connectToSocket); 211 peer1.connect(connectToSocket);
212 212
...@@ -238,11 +238,11 @@ public class BGPControllerImplTest { ...@@ -238,11 +238,11 @@ public class BGPControllerImplTest {
238 238
239 peer1.peerChannelHandler.isLargeAsCapabilitySet = true; 239 peer1.peerChannelHandler.isLargeAsCapabilitySet = true;
240 bgpControllerImpl.getConfig().setLargeASCapability(true); 240 bgpControllerImpl.getConfig().setLargeASCapability(true);
241 - BGPValueType tempTlv = new FourOctetAsNumCapabilityTlv(200); 241 + BgpValueType tempTlv = new FourOctetAsNumCapabilityTlv(200);
242 peer1.peerChannelHandler.capabilityTlv.add(tempTlv); 242 peer1.peerChannelHandler.capabilityTlv.add(tempTlv);
243 243
244 bgpControllerImpl.getConfig().setLsCapability(true); 244 bgpControllerImpl.getConfig().setLsCapability(true);
245 - BGPValueType tempTlv1 = new MultiProtocolExtnCapabilityTlv(afi, res, safi); 245 + BgpValueType tempTlv1 = new MultiProtocolExtnCapabilityTlv(afi, res, safi);
246 peer1.peerChannelHandler.capabilityTlv.add(tempTlv1); 246 peer1.peerChannelHandler.capabilityTlv.add(tempTlv1);
247 peer1.connect(connectToSocket); 247 peer1.connect(connectToSocket);
248 248
...@@ -264,7 +264,7 @@ public class BGPControllerImplTest { ...@@ -264,7 +264,7 @@ public class BGPControllerImplTest {
264 264
265 private BgpPeerTest(byte version, short asNumber, 265 private BgpPeerTest(byte version, short asNumber,
266 short holdTime, int bgpId, boolean isLargeAsCapabilitySet, 266 short holdTime, int bgpId, boolean isLargeAsCapabilitySet,
267 - LinkedList<BGPValueType> capabilityTlv) { 267 + LinkedList<BgpValueType> capabilityTlv) {
268 peerChannelHandler = new BgpPeerChannelHandlerTest(version, 268 peerChannelHandler = new BgpPeerChannelHandlerTest(version,
269 asNumber, holdTime, bgpId, isLargeAsCapabilitySet, capabilityTlv); 269 asNumber, holdTime, bgpId, isLargeAsCapabilitySet, capabilityTlv);
270 } 270 }
......
...@@ -23,10 +23,10 @@ import org.jboss.netty.buffer.ChannelBuffers; ...@@ -23,10 +23,10 @@ import org.jboss.netty.buffer.ChannelBuffers;
23 import org.jboss.netty.channel.ChannelHandlerContext; 23 import org.jboss.netty.channel.ChannelHandlerContext;
24 import org.jboss.netty.channel.ChannelStateEvent; 24 import org.jboss.netty.channel.ChannelStateEvent;
25 import org.jboss.netty.channel.SimpleChannelHandler; 25 import org.jboss.netty.channel.SimpleChannelHandler;
26 -import org.onosproject.bgpio.protocol.ver4.BGPKeepaliveMsgVer4; 26 +import org.onosproject.bgpio.protocol.ver4.BgpKeepaliveMsgVer4;
27 -import org.onosproject.bgpio.protocol.ver4.BGPOpenMsgVer4; 27 +import org.onosproject.bgpio.protocol.ver4.BgpOpenMsgVer4;
28 -import org.onosproject.bgpio.types.BGPHeader; 28 +import org.onosproject.bgpio.types.BgpHeader;
29 -import org.onosproject.bgpio.types.BGPValueType; 29 +import org.onosproject.bgpio.types.BgpValueType;
30 30
31 public class BgpPeerChannelHandlerTest extends SimpleChannelHandler { 31 public class BgpPeerChannelHandlerTest extends SimpleChannelHandler {
32 public static final int OPEN_MSG_MINIMUM_LENGTH = 29; 32 public static final int OPEN_MSG_MINIMUM_LENGTH = 29;
...@@ -34,16 +34,16 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler { ...@@ -34,16 +34,16 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler {
34 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 34 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
35 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 35 (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
36 (byte) 0xff, (byte) 0xff}; 36 (byte) 0xff, (byte) 0xff};
37 - public static final BGPHeader DEFAULT_OPEN_HEADER = new BGPHeader(MARKER, 37 + public static final BgpHeader DEFAULT_OPEN_HEADER = new BgpHeader(MARKER,
38 (short) OPEN_MSG_MINIMUM_LENGTH, (byte) 0X01); 38 (short) OPEN_MSG_MINIMUM_LENGTH, (byte) 0X01);
39 - LinkedList<BGPValueType> capabilityTlv = new LinkedList<>(); 39 + LinkedList<BgpValueType> capabilityTlv = new LinkedList<>();
40 public byte version; 40 public byte version;
41 public short asNumber; 41 public short asNumber;
42 public short holdTime; 42 public short holdTime;
43 public int bgpId; 43 public int bgpId;
44 public boolean isLargeAsCapabilitySet; 44 public boolean isLargeAsCapabilitySet;
45 45
46 - final BGPOpenMsgVer4 openMessage = new BGPOpenMsgVer4(); 46 + final BgpOpenMsgVer4 openMessage = new BgpOpenMsgVer4();
47 ChannelHandlerContext savedCtx; 47 ChannelHandlerContext savedCtx;
48 48
49 /** 49 /**
...@@ -60,7 +60,7 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler { ...@@ -60,7 +60,7 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler {
60 short holdTime, 60 short holdTime,
61 int bgpId, 61 int bgpId,
62 boolean isLargeAsCapabilitySet, 62 boolean isLargeAsCapabilitySet,
63 - LinkedList<BGPValueType> capabilityTlv) { 63 + LinkedList<BgpValueType> capabilityTlv) {
64 this.version = version; 64 this.version = version;
65 this.asNumber = asNumber; 65 this.asNumber = asNumber;
66 this.holdTime = holdTime; 66 this.holdTime = holdTime;
...@@ -81,7 +81,7 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler { ...@@ -81,7 +81,7 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler {
81 ChannelStateEvent channelEvent) throws InterruptedException { 81 ChannelStateEvent channelEvent) throws InterruptedException {
82 this.savedCtx = ctx; 82 this.savedCtx = ctx;
83 83
84 - BGPOpenMsgVer4 openMsg = new BGPOpenMsgVer4(DEFAULT_OPEN_HEADER, 84 + BgpOpenMsgVer4 openMsg = new BgpOpenMsgVer4(DEFAULT_OPEN_HEADER,
85 this.version, 85 this.version,
86 this.asNumber, 86 this.asNumber,
87 this.holdTime, 87 this.holdTime,
...@@ -93,7 +93,7 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler { ...@@ -93,7 +93,7 @@ public class BgpPeerChannelHandlerTest extends SimpleChannelHandler {
93 93
94 TimeUnit.MILLISECONDS.sleep(100); 94 TimeUnit.MILLISECONDS.sleep(100);
95 95
96 - BGPKeepaliveMsgVer4 keepaliveMsg = new BGPKeepaliveMsgVer4(); 96 + BgpKeepaliveMsgVer4 keepaliveMsg = new BgpKeepaliveMsgVer4();
97 ChannelBuffer buffer1 = ChannelBuffers.dynamicBuffer(); 97 ChannelBuffer buffer1 = ChannelBuffers.dynamicBuffer();
98 keepaliveMsg.writeTo(buffer1); 98 keepaliveMsg.writeTo(buffer1);
99 ctx.getChannel().write(buffer1); 99 ctx.getChannel().write(buffer1);
......
...@@ -27,12 +27,12 @@ import org.apache.felix.scr.annotations.Component; ...@@ -27,12 +27,12 @@ import org.apache.felix.scr.annotations.Component;
27 import org.apache.felix.scr.annotations.Deactivate; 27 import org.apache.felix.scr.annotations.Deactivate;
28 import org.apache.felix.scr.annotations.Reference; 28 import org.apache.felix.scr.annotations.Reference;
29 import org.apache.felix.scr.annotations.ReferenceCardinality; 29 import org.apache.felix.scr.annotations.ReferenceCardinality;
30 -import org.onosproject.bgp.controller.BGPController; 30 +import org.onosproject.bgp.controller.BgpController;
31 import org.onosproject.bgp.controller.BgpDpid; 31 import org.onosproject.bgp.controller.BgpDpid;
32 import org.onosproject.bgp.controller.BgpLinkListener; 32 import org.onosproject.bgp.controller.BgpLinkListener;
33 import org.onosproject.bgp.controller.BgpNodeListener; 33 import org.onosproject.bgp.controller.BgpNodeListener;
34 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 34 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
35 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 35 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
36 import org.onosproject.net.ConnectPoint; 36 import org.onosproject.net.ConnectPoint;
37 import org.onosproject.net.Device; 37 import org.onosproject.net.Device;
38 import org.onosproject.net.DeviceId; 38 import org.onosproject.net.DeviceId;
...@@ -74,7 +74,7 @@ public class BgpTopologyProvider extends AbstractProvider implements LinkProvide ...@@ -74,7 +74,7 @@ public class BgpTopologyProvider extends AbstractProvider implements LinkProvide
74 protected DeviceProviderRegistry deviceProviderRegistry; 74 protected DeviceProviderRegistry deviceProviderRegistry;
75 75
76 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 76 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
77 - protected BGPController controller; 77 + protected BgpController controller;
78 78
79 private DeviceProviderService deviceProviderService; 79 private DeviceProviderService deviceProviderService;
80 private LinkProviderService linkProviderService; 80 private LinkProviderService linkProviderService;
...@@ -150,7 +150,7 @@ public class BgpTopologyProvider extends AbstractProvider implements LinkProvide ...@@ -150,7 +150,7 @@ public class BgpTopologyProvider extends AbstractProvider implements LinkProvide
150 private class InternalBgpProvider implements BgpNodeListener, BgpLinkListener { 150 private class InternalBgpProvider implements BgpNodeListener, BgpLinkListener {
151 151
152 @Override 152 @Override
153 - public void addNode(BGPNodeLSNlriVer4 nodeNlri) { 153 + public void addNode(BgpNodeLSNlriVer4 nodeNlri) {
154 log.debug("Add node {}", nodeNlri.toString()); 154 log.debug("Add node {}", nodeNlri.toString());
155 155
156 if (deviceProviderService == null) { 156 if (deviceProviderService == null) {
...@@ -167,7 +167,7 @@ public class BgpTopologyProvider extends AbstractProvider implements LinkProvide ...@@ -167,7 +167,7 @@ public class BgpTopologyProvider extends AbstractProvider implements LinkProvide
167 } 167 }
168 168
169 @Override 169 @Override
170 - public void deleteNode(BGPNodeLSNlriVer4 nodeNlri) { 170 + public void deleteNode(BgpNodeLSNlriVer4 nodeNlri) {
171 log.debug("Delete node {}", nodeNlri.toString()); 171 log.debug("Delete node {}", nodeNlri.toString());
172 172
173 if (deviceProviderService == null) { 173 if (deviceProviderService == null) {
......
...@@ -27,23 +27,23 @@ import java.util.concurrent.CopyOnWriteArraySet; ...@@ -27,23 +27,23 @@ import java.util.concurrent.CopyOnWriteArraySet;
27 import org.junit.After; 27 import org.junit.After;
28 import org.junit.Before; 28 import org.junit.Before;
29 import org.junit.Test; 29 import org.junit.Test;
30 -import org.onosproject.bgp.controller.BGPCfg; 30 +import org.onosproject.bgp.controller.BgpCfg;
31 -import org.onosproject.bgp.controller.BGPController; 31 +import org.onosproject.bgp.controller.BgpController;
32 -import org.onosproject.bgp.controller.BGPId; 32 +import org.onosproject.bgp.controller.BgpId;
33 -import org.onosproject.bgp.controller.BGPPeer; 33 +import org.onosproject.bgp.controller.BgpPeer;
34 import org.onosproject.bgp.controller.BgpLinkListener; 34 import org.onosproject.bgp.controller.BgpLinkListener;
35 import org.onosproject.bgp.controller.BgpNodeListener; 35 import org.onosproject.bgp.controller.BgpNodeListener;
36 import org.onosproject.bgp.controller.BgpPeerManager; 36 import org.onosproject.bgp.controller.BgpPeerManager;
37 -import org.onosproject.bgpio.exceptions.BGPParseException; 37 +import org.onosproject.bgpio.exceptions.BgpParseException;
38 -import org.onosproject.bgpio.protocol.BGPMessage; 38 +import org.onosproject.bgpio.protocol.BgpMessage;
39 -import org.onosproject.bgpio.protocol.linkstate.BGPLinkLSIdentifier; 39 +import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier;
40 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSIdentifier; 40 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier;
41 -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4; 41 +import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
42 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4; 42 import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
43 import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors; 43 import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors;
44 import org.onosproject.bgpio.types.AutonomousSystemTlv; 44 import org.onosproject.bgpio.types.AutonomousSystemTlv;
45 import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv; 45 import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv;
46 -import org.onosproject.bgpio.types.BGPValueType; 46 +import org.onosproject.bgpio.types.BgpValueType;
47 import org.onosproject.bgpio.types.RouteDistinguisher; 47 import org.onosproject.bgpio.types.RouteDistinguisher;
48 import org.onosproject.bgpio.util.Constants; 48 import org.onosproject.bgpio.util.Constants;
49 import org.onosproject.net.ConnectPoint; 49 import org.onosproject.net.ConnectPoint;
...@@ -225,7 +225,7 @@ public class BgpTopologyProviderTest { ...@@ -225,7 +225,7 @@ public class BgpTopologyProviderTest {
225 } 225 }
226 226
227 /* class implement test controller */ 227 /* class implement test controller */
228 - private class TestController implements BGPController { 228 + private class TestController implements BgpController {
229 protected Set<BgpNodeListener> nodeListener = new CopyOnWriteArraySet<>(); 229 protected Set<BgpNodeListener> nodeListener = new CopyOnWriteArraySet<>();
230 protected Set<BgpLinkListener> linkListener = new CopyOnWriteArraySet<>(); 230 protected Set<BgpLinkListener> linkListener = new CopyOnWriteArraySet<>();
231 231
...@@ -250,25 +250,25 @@ public class BgpTopologyProviderTest { ...@@ -250,25 +250,25 @@ public class BgpTopologyProviderTest {
250 } 250 }
251 251
252 @Override 252 @Override
253 - public Iterable<BGPPeer> getPeers() { 253 + public Iterable<BgpPeer> getPeers() {
254 // TODO Auto-generated method stub 254 // TODO Auto-generated method stub
255 return null; 255 return null;
256 } 256 }
257 257
258 @Override 258 @Override
259 - public BGPPeer getPeer(BGPId bgpId) { 259 + public BgpPeer getPeer(BgpId bgpId) {
260 // TODO Auto-generated method stub 260 // TODO Auto-generated method stub
261 return null; 261 return null;
262 } 262 }
263 263
264 @Override 264 @Override
265 - public void writeMsg(BGPId bgpId, BGPMessage msg) { 265 + public void writeMsg(BgpId bgpId, BgpMessage msg) {
266 // TODO Auto-generated method stub 266 // TODO Auto-generated method stub
267 267
268 } 268 }
269 269
270 @Override 270 @Override
271 - public void processBGPPacket(BGPId bgpId, BGPMessage msg) throws BGPParseException { 271 + public void processBGPPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException {
272 // TODO Auto-generated method stub 272 // TODO Auto-generated method stub
273 273
274 } 274 }
...@@ -280,7 +280,7 @@ public class BgpTopologyProviderTest { ...@@ -280,7 +280,7 @@ public class BgpTopologyProviderTest {
280 } 280 }
281 281
282 @Override 282 @Override
283 - public BGPCfg getConfig() { 283 + public BgpCfg getConfig() {
284 // TODO Auto-generated method stub 284 // TODO Auto-generated method stub
285 return null; 285 return null;
286 } 286 }
...@@ -299,7 +299,7 @@ public class BgpTopologyProviderTest { ...@@ -299,7 +299,7 @@ public class BgpTopologyProviderTest {
299 } 299 }
300 300
301 @Override 301 @Override
302 - public Map<BGPId, BGPPeer> connectedPeers() { 302 + public Map<BgpId, BgpPeer> connectedPeers() {
303 // TODO Auto-generated method stub 303 // TODO Auto-generated method stub
304 return null; 304 return null;
305 } 305 }
...@@ -321,16 +321,16 @@ public class BgpTopologyProviderTest { ...@@ -321,16 +321,16 @@ public class BgpTopologyProviderTest {
321 @Test 321 @Test
322 public void bgpTopologyProviderTestAddDevice1() { 322 public void bgpTopologyProviderTestAddDevice1() {
323 int deviceAddCount = 0; 323 int deviceAddCount = 0;
324 - LinkedList<BGPValueType> subTlvs; 324 + LinkedList<BgpValueType> subTlvs;
325 subTlvs = new LinkedList<>(); 325 subTlvs = new LinkedList<>();
326 - BGPValueType tlv = new AutonomousSystemTlv(100); 326 + BgpValueType tlv = new AutonomousSystemTlv(100);
327 short deslength = AutonomousSystemTlv.LENGTH; 327 short deslength = AutonomousSystemTlv.LENGTH;
328 short desType = AutonomousSystemTlv.TYPE; 328 short desType = AutonomousSystemTlv.TYPE;
329 329
330 subTlvs.add(tlv); 330 subTlvs.add(tlv);
331 - BGPNodeLSIdentifier localNodeDescriptors = new BGPNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength, 331 + BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength,
332 desType)); 332 desType));
333 - BGPNodeLSNlriVer4 nodeNlri = new BGPNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false, 333 + BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false,
334 new RouteDistinguisher()); 334 new RouteDistinguisher());
335 335
336 nodeNlri.setNodeLSIdentifier(localNodeDescriptors); 336 nodeNlri.setNodeLSIdentifier(localNodeDescriptors);
...@@ -347,16 +347,16 @@ public class BgpTopologyProviderTest { ...@@ -347,16 +347,16 @@ public class BgpTopologyProviderTest {
347 /* Validate node is not added to the device for invalid URI, RIB count should be zero */ 347 /* Validate node is not added to the device for invalid URI, RIB count should be zero */
348 @Test 348 @Test
349 public void bgpTopologyProviderTestAddDevice2() { 349 public void bgpTopologyProviderTestAddDevice2() {
350 - LinkedList<BGPValueType> subTlvs; 350 + LinkedList<BgpValueType> subTlvs;
351 - BGPValueType tlv = new AutonomousSystemTlv(10); 351 + BgpValueType tlv = new AutonomousSystemTlv(10);
352 short deslength = AutonomousSystemTlv.LENGTH; 352 short deslength = AutonomousSystemTlv.LENGTH;
353 short desType = AutonomousSystemTlv.TYPE; 353 short desType = AutonomousSystemTlv.TYPE;
354 354
355 subTlvs = new LinkedList<>(); 355 subTlvs = new LinkedList<>();
356 subTlvs.add(tlv); 356 subTlvs.add(tlv);
357 - BGPNodeLSIdentifier localNodeDescriptors = new BGPNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength, 357 + BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength,
358 desType)); 358 desType));
359 - BGPNodeLSNlriVer4 nodeNlri = new BGPNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false, 359 + BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false,
360 new RouteDistinguisher()); 360 new RouteDistinguisher());
361 361
362 nodeNlri.setNodeLSIdentifier(localNodeDescriptors); 362 nodeNlri.setNodeLSIdentifier(localNodeDescriptors);
...@@ -369,16 +369,16 @@ public class BgpTopologyProviderTest { ...@@ -369,16 +369,16 @@ public class BgpTopologyProviderTest {
369 /* Delete node when node does not exist, RIB count should be zero */ 369 /* Delete node when node does not exist, RIB count should be zero */
370 @Test 370 @Test
371 public void bgpTopologyProviderTestAddDevice3() { 371 public void bgpTopologyProviderTestAddDevice3() {
372 - LinkedList<BGPValueType> subTlvs; 372 + LinkedList<BgpValueType> subTlvs;
373 - BGPValueType tlv = new AutonomousSystemTlv(10); 373 + BgpValueType tlv = new AutonomousSystemTlv(10);
374 short deslength = AutonomousSystemTlv.LENGTH; 374 short deslength = AutonomousSystemTlv.LENGTH;
375 short desType = AutonomousSystemTlv.TYPE; 375 short desType = AutonomousSystemTlv.TYPE;
376 376
377 subTlvs = new LinkedList<>(); 377 subTlvs = new LinkedList<>();
378 subTlvs.add(tlv); 378 subTlvs.add(tlv);
379 - BGPNodeLSIdentifier localNodeDescriptors = new BGPNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength, 379 + BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength,
380 desType)); 380 desType));
381 - BGPNodeLSNlriVer4 nodeNlri = new BGPNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false, 381 + BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false,
382 new RouteDistinguisher()); 382 new RouteDistinguisher());
383 383
384 nodeNlri.setNodeLSIdentifier(localNodeDescriptors); 384 nodeNlri.setNodeLSIdentifier(localNodeDescriptors);
...@@ -394,13 +394,13 @@ public class BgpTopologyProviderTest { ...@@ -394,13 +394,13 @@ public class BgpTopologyProviderTest {
394 394
395 NodeDescriptors localNodeDescriptors; 395 NodeDescriptors localNodeDescriptors;
396 NodeDescriptors remoteNodeDescriptors; 396 NodeDescriptors remoteNodeDescriptors;
397 - LinkedList<BGPValueType> subTlvs; 397 + LinkedList<BgpValueType> subTlvs;
398 - LinkedList<BGPValueType> linkDescriptor = new LinkedList<>(); 398 + LinkedList<BgpValueType> linkDescriptor = new LinkedList<>();
399 - BGPValueType tlvLocalRemoteId; 399 + BgpValueType tlvLocalRemoteId;
400 short deslength = AutonomousSystemTlv.LENGTH; 400 short deslength = AutonomousSystemTlv.LENGTH;
401 short desType = AutonomousSystemTlv.TYPE; 401 short desType = AutonomousSystemTlv.TYPE;
402 402
403 - BGPValueType tlv = new AutonomousSystemTlv(100); 403 + BgpValueType tlv = new AutonomousSystemTlv(100);
404 subTlvs = new LinkedList<>(); 404 subTlvs = new LinkedList<>();
405 subTlvs.add(tlv); 405 subTlvs.add(tlv);
406 406
...@@ -409,7 +409,7 @@ public class BgpTopologyProviderTest { ...@@ -409,7 +409,7 @@ public class BgpTopologyProviderTest {
409 tlvLocalRemoteId = new LinkLocalRemoteIdentifiersTlv(1, 2); 409 tlvLocalRemoteId = new LinkLocalRemoteIdentifiersTlv(1, 2);
410 linkDescriptor.add(tlvLocalRemoteId); 410 linkDescriptor.add(tlvLocalRemoteId);
411 411
412 - BGPLinkLSIdentifier linkLSIdentifier = new BGPLinkLSIdentifier(localNodeDescriptors, remoteNodeDescriptors, 412 + BgpLinkLSIdentifier linkLSIdentifier = new BgpLinkLSIdentifier(localNodeDescriptors, remoteNodeDescriptors,
413 linkDescriptor); 413 linkDescriptor);
414 BgpLinkLsNlriVer4 linkNlri = new BgpLinkLsNlriVer4((byte) Constants.DIRECT, 0, linkLSIdentifier, null, false); 414 BgpLinkLsNlriVer4 linkNlri = new BgpLinkLsNlriVer4((byte) Constants.DIRECT, 0, linkLSIdentifier, null, false);
415 415
......