39 Commits

Author SHA1 Message Date
Pavlin Radoslavov
d5087d13d0 Removed method IpAddress.toInt(), because it is semantically incorrect:
It lacks the guarantee the underlying IP address is IPv4.

Potential users of toInt() should use Ip4Address.toInt()
or IpAddress.getIp4Address().toInt()
Tthe latter obviously might require the explicit check that
getIp4Address() is not null.

Change-Id: I3f939695cf3c496e3fdd3fbd4a2988b565cca69a
2014-11-06 13:40:40 -08:00
Pavlin Radoslavov
34c8164a61 * Added methods IpAddress.getIp4Address() and IpAddress.getIp6Address()
to get the Ip4Address and Ip6Address view of the IpAddress.

* Added methods IpPrefix.getIp4Prefix() and IpPrefix.getIp6Prefix()
  to get the Ip4Prefix and Ip6Prefix view of the IpPrefix.

Added the corresponding unit tests as well.
2014-11-04 16:21:38 -08:00
Pavlin Radoslavov
315d6c8b89 Minor refactoring (for code consistency).
No functional changes.
2014-11-04 15:36:04 -08:00
Pavlin Radoslavov
f182f015a5 Reimplementation of classes Ip4Address/Ip6Address/Ip4Prefix/Ip6Prefix
and the corresponding unit tests.

* Reimplemented classes Ip4Address and Ip6Address by inheriting from
  class IpAddress
* Reimplemented classes Ip4Prefix and Ip6Prefix by inheriting from
  class IpPrefix
* Reimplemented the unit tests Ip4AddressTest and Ip6AddressTest to
  match the corresponding IpAddressTest unit tests
* Reimplemented the unit tests Ip4PrefixTest and Ip6PrefixTest to
  match the corresponding IpPrefixTest unit tests
* Minor refactoring/cleanup of classes IpAddress and IpPrefix
2014-11-04 15:03:18 -08:00
weibit
800d606ae1 Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next 2014-11-03 15:49:26 -08:00
Pavlin Radoslavov
34c921a02f Completed the IPv6 implementation for IpPrefix, and added
a new set of IpPrefix unit tests.

Also, fix few nits in IpAddress and IpAddressTest
2014-11-03 15:41:22 -08:00
weibit
818539e980 Merge branch 'k-shortest-path' 2014-11-03 14:46:54 -08:00
weibit
0d0ef61cd5 K-shorest path algorithm to support UC1, it can be used by other modules as well.
Change-Id: I736ec55c6211a505d6cf43ab22e1197fdb86ecf3
2014-11-03 14:39:25 -08:00
Thomas Vachuska
9d8f72fb55 Removed unneeded import that was breaking the build. 2014-11-03 10:14:05 -08:00
Pavlin Radoslavov
854ecabf36 Updated the testEqualityIPv4 and testEqualityIPv6 to use
Google's EqualsTester.
2014-11-03 09:45:44 -08:00
Pavlin Radoslavov
af5ff79583 Added new method IpAddress.valueOf(InetAddress inetAddress)
and use it as appropriate inside DistributedClusterStore.memberAddress()
2014-10-31 20:51:47 -07:00
Pavlin Radoslavov
d0e32d7486 Added support for IPv6 addresses to class IpAddress:
- For some of the methods, the IP Version needs to be specified by the
   caller. This applies to the IpPrefix API as well.
 - For now, everywhere IpAddress is used and the IP version has to be
   explicitly specified by the caller, we assume/specify IPv4.
 - Added unit test for class IpAddress: for both IPv4 and IPv6 addresses.
2014-10-31 18:11:43 -07:00
Pavlin Radoslavov
855ea2d5b9 Refactor the IpPrefix API and implementation:
* Now IpPrefix uses IpAddress to represent the subnet address
 * The IpPrefix subnet address is masked-out by the prefix length.
   E.g., IpPrefix("1.2.3.4/24") is now stored as IpPrefix("1.2.3.0/24")
 * Removed IpPrefix methods that are not used or don't apply anymore
 * Replaced usage of IpPrefix with IpAddress where appropriate
2014-10-30 15:32:39 -07:00
Pavlin Radoslavov
52307e60ba IpAddress and IpPrefix related cleanup:
* Removed IpAddress.MAX_INET_MASK and use IpPrefix.MAX_INET_MASK_LENGTH
   instead
 * Renamed IpAddress.INET_LEN to INET_BYTE_LENGTH
 * Added IpAddress.INET_BIT_LENGTH, INET6_BYTE_LENGTH, and INET6_BIT_LENGTH
 * Removed methods that are semantically incorrect, or are not needed/used
   - IpAddress.prefixLength()
   - IpAddress.toPrefix()
   - IpAddress.mask()
   - IpAddress.netmask()
   - IpAddress.network()
   - IpAddress.host()
   - IpAddress.isMasked()
   - IpAddress.contains()
   - IpPrefix constructor for version and bytes (but no netmask)
   - IpPrefix.valueOf(int)

 * Misc. other cleanup.
2014-10-29 15:07:37 -07:00
Thomas Vachuska
4f1a60c9fd Revised copyright message. 2014-10-28 13:39:11 -07:00
Pavlin Radoslavov
e7b5bd768c Updated creation of IpAddress instance inside IpPrefixTest
to exclude specifying the prefix length, because it is not
applicable for IpAddress.
2014-10-27 20:17:24 -07:00
Thomas Vachuska
24c849c488 Added copyrights to the utils code 2014-10-27 09:53:05 -07:00
Thomas Vachuska
4d69087215 Doh! Forgot to actually check for negative cycles in relaxEdge. 2014-10-27 08:57:08 -07:00
Pavlin Radoslavov
9de2772d0d Work toward common IP address classes.
Ported the following IP address classes from the older codebase:
Ip4Address, Ip6Address, Ip4Prefix, Ip6Prefix (and the corresponding
unit tests).
NOTE: Those classes are not ready to be used yet.

Change-Id: I234875abbc9df8daa2f8ae28706af591dd2c5f2d
2014-10-23 20:35:48 -07:00
Pavlin Radoslavov
d26f57a8e6 Refactoring in the unit test utility framework:
* Moved unit test utilities to the onlab-junit package under utils/junit
   - ImmutableClassChecker
   - TestUtils and TestUtilsTest

 * Added/ported unit test utilities from the older code
   - UtilityClassChecker and UtilityClassCheckerTest
   - ImmutableClassCheckerTest

 * Updated/fixed some of the pom.xml files in the context of the
   onlab-junit package:
   - Added <scope>test</scope>
   - Replaced hard-coded "1.0.0-SNAPSHOT" with "${project.version}"

Change-Id: Ie5f51ba401ca1748340f38848ab6bfc251964adc
2014-10-23 17:58:36 -07:00
weibit
38c42ede2e Optical topology provider for UC1
Change-Id: I1b25c9412b5180f9dce167f8700eb84baba70486
2014-10-17 11:09:34 -07:00
Jonathan Hart
20d8e5140b Ported BGP tests from old codebase 2014-10-16 11:44:57 -07:00
Jonathan Hart
dbdbdbb451 Added restrictions for proxy ARP 2014-10-15 11:27:04 -07:00
Jonathan Hart
70da512717 Wired up HostMonitor to its dependencies and got it working. 2014-10-02 16:42:48 -07:00
tom
a708318294 Working on IO loop stuff. 2014-09-25 21:38:03 -07:00
tom
fc9a4ff73c Fixed equals methods for better efficiency.
Cleaned up ClusterService API.
2014-09-22 18:22:47 -07:00
Ayaka Koshibe
1d56fe4dbe renamed IpAddress to IpPrefix
Change-Id: I35990622e5b1c29ab6f6a0a0227088cd5d6c7294
2014-09-19 16:51:58 -07:00
Jonathan Hart
b7a2ac3a1c Added a contains method to IpAddress 2014-09-19 10:45:37 -07:00
Ayaka Koshibe
40e7fec52e netmask support in IpAddress
Change-Id: Ie5f4276a1fa1cdd56bebbd3cd1ee74ecacdab598
2014-09-16 22:32:19 -07:00
Ayaka Koshibe
a9c199f402 renamed VLAN, IP, and MACAddress classes
Change-Id: Ib4df413db1f3d9ee96213fc487519536d7993c5b
2014-09-16 16:21:40 -07:00
Ayaka Koshibe
16698a3f1b Tests for IPAddress and VLANID
Change-Id: If8183366428c9b4fb14f78005922b2229cff1456
2014-09-13 22:19:02 -07:00
tom
782a7cf139 Added tools for converting dpid to uri and vice versa.
Modified device and link provider to use the new tools.
2014-09-11 23:58:38 -07:00
tom
0633d68dec Added Tarjan SCC computation algorithm and associated tests. 2014-09-10 12:10:03 -07:00
tom
eadbb46af8 Added simple link manager implementation.
Added link admin stuff; unit tests to come.
2014-09-07 16:10:19 -07:00
tom
41c3fccbc8 Added iterative DFS algorithm. 2014-08-30 17:57:15 -07:00
tom
2e1f071d38 Added bellman-ford implementation. 2014-08-29 13:32:00 -07:00
tom
c53fa0de8e Fixed check-style nags. 2014-08-29 11:57:11 -07:00
tom
144de693fe Added more unit tests for the graph utilities. 2014-08-29 11:38:44 -07:00
tom
e348941219 Added graph-related utility code. 2014-08-29 02:30:38 -07:00