You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2012/03/20 23:39:20 UTC
[2/12] git commit: Fix for stale github fork.
Fix for stale github fork.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/adebcc8c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/adebcc8c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/adebcc8c
Branch: refs/heads/master
Commit: adebcc8c5196ce6cd5174ad8d7fe3c0979af896c
Parents: 80023cb
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Tue Mar 20 16:49:41 2012 -0500
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Tue Mar 20 16:49:41 2012 -0500
----------------------------------------------------------------------
lib/ts/IpMap.cc | 100 +++++++++++++++++++++++++-------------------------
1 files changed, 50 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/adebcc8c/lib/ts/IpMap.cc
----------------------------------------------------------------------
diff --git a/lib/ts/IpMap.cc b/lib/ts/IpMap.cc
index cfb0791..dfa462a 100644
--- a/lib/ts/IpMap.cc
+++ b/lib/ts/IpMap.cc
@@ -39,6 +39,56 @@
namespace ts { namespace detail {
+// Helper functions
+
+inline int cmp(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return memcmp(lhs.sin6_addr.s6_addr, rhs.sin6_addr.s6_addr, INK_IP6_SIZE);
+}
+
+/// Less than.
+inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return ts::detail::cmp(lhs, rhs) < 0;
+}
+inline bool operator<(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
+ return ts::detail::cmp(*lhs, rhs) < 0;
+}
+/// Less than.
+inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return ts::detail::cmp(lhs, *rhs) < 0;
+}
+/// Equality.
+inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return ts::detail::cmp(lhs, *rhs) == 0;
+}
+/// Equality.
+inline bool operator==(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
+ return ts::detail::cmp(*lhs, rhs) == 0;
+}
+/// Equality.
+inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return ts::detail::cmp(lhs, rhs) == 0;
+}
+/// Less than or equal.
+inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return ts::detail::cmp(lhs, *rhs) <= 0;
+}
+/// Less than or equal.
+inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return ts::detail::cmp(lhs, rhs) <= 0;
+}
+/// Greater than or equal.
+inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return ts::detail::cmp(lhs, rhs) >= 0;
+}
+/// Greater than or equal.
+inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return ts::detail::cmp(lhs, *rhs) >= 0;
+}
+/// Greater than.
+inline bool operator>(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return ts::detail::cmp(lhs, *rhs) > 0;
+}
+
/// Equality.
/// @note If @a n is @c NULL it is treated as having the color @c BLACK.
/// @return @c true if @a c and the color of @a n are the same.
@@ -506,56 +556,6 @@ template <
NodeList _list;
};
-// Helper functions
-
-inline int cmp(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return memcmp(lhs.sin6_addr.s6_addr, rhs.sin6_addr.s6_addr, INK_IP6_SIZE);
-}
-
-/// Less than.
-inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return ts::detail::cmp(lhs, rhs) < 0;
-}
-inline bool operator<(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
- return ts::detail::cmp(*lhs, rhs) < 0;
-}
-/// Less than.
-inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return ts::detail::cmp(lhs, *rhs) < 0;
-}
-/// Equality.
-inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return ts::detail::cmp(lhs, *rhs) == 0;
-}
-/// Equality.
-inline bool operator==(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
- return ts::detail::cmp(*lhs, rhs) == 0;
-}
-/// Equality.
-inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return ts::detail::cmp(lhs, rhs) == 0;
-}
-/// Less than or equal.
-inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return ts::detail::cmp(lhs, *rhs) <= 0;
-}
-/// Less than or equal.
-inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return ts::detail::cmp(lhs, rhs) <= 0;
-}
-/// Greater than or equal.
-inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return ts::detail::cmp(lhs, rhs) >= 0;
-}
-/// Greater than or equal.
-inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return ts::detail::cmp(lhs, *rhs) >= 0;
-}
-/// Greater than.
-inline bool operator>(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return ts::detail::cmp(lhs, *rhs) > 0;
-}
-
template < typename N > N*
IpMapBase<N>::lowerBound(ArgType target) {
N* n = _root; // current node to test.