Committed by
Gerrit Code Review
Modified bgp file name according to naming convention.
Change-Id: I403139b53fbc1a2dba894dfd39720707a52ba7cd
Showing
118 changed files
with
809 additions
and
809 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 | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -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 | ... | ... |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment