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/02/22 17:16:11 UTC

[4/8] git commit: Tweaks.

Tweaks.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8bfb6836
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8bfb6836
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8bfb6836

Branch: refs/heads/master
Commit: 8bfb6836447cebb2cc10b74342fff9e8b2aa8a62
Parents: 47d1f8e
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Tue Feb 21 10:41:42 2012 -0600
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Tue Feb 21 10:41:42 2012 -0600

----------------------------------------------------------------------
 lib/ts/ink_inet.cc |   22 +++-------------------
 lib/ts/ink_inet.h  |    1 -
 2 files changed, 3 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8bfb6836/lib/ts/ink_inet.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.cc b/lib/ts/ink_inet.cc
index 8a67fdb..7d9a68c 100644
--- a/lib/ts/ink_inet.cc
+++ b/lib/ts/ink_inet.cc
@@ -179,22 +179,6 @@ ats_ip_family_name(int family) {
     ;
 }
 
-uint16_t ink_inet_port(const struct sockaddr *addr)
-{
-  uint16_t port = 0;
-
-  switch (addr->sa_family) {
-  case AF_INET:
-    port = ntohs(((struct sockaddr_in *)addr)->sin_port);
-    break;
-  case AF_INET6:
-    port = ntohs(((struct sockaddr_in6 *)addr)->sin6_port);
-    break;
-  }
-
-  return port;
-}
-
 char const* ats_ip_nptop(
   sockaddr const* addr,
   char* dst, size_t size
@@ -208,7 +192,7 @@ char const* ats_ip_nptop(
 }
 
 int
-ink_inet_parse(ts::ConstBuffer src, ts::ConstBuffer* addr, ts::ConstBuffer* port) {
+ats_ip_parse(ts::ConstBuffer src, ts::ConstBuffer* addr, ts::ConstBuffer* port) {
   addr->reset();
   port->reset();
 
@@ -263,7 +247,7 @@ ats_ip_pton(char const* text, sockaddr* ip) {
   ts::ConstBuffer src(text, strlen(text)+1);
 
   ats_ip_invalidate(ip);
-  if (0 == ink_inet_parse(src, &addr, &port)) {
+  if (0 == ats_ip_parse(src, &addr, &port)) {
     // Copy if not terminated.
     if (0 != addr[addr.size()-1]) {
       char* tmp = static_cast<char*>(alloca(addr.size()+1));
@@ -393,7 +377,7 @@ ats_ip_getbestaddrinfo(char const* host,
   if (ip4) ats_ip_invalidate(ip4);
   if (ip6) ats_ip_invalidate(ip6);
 
-  if (0 == ink_inet_parse(src, &addr_text, &port_text)) {
+  if (0 == ats_ip_parse(src, &addr_text, &port_text)) {
     // Copy if not terminated.
     if (0 != addr_text[addr_text.size()-1]) {
       char* tmp = static_cast<char*>(alloca(addr_text.size()+1));

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8bfb6836/lib/ts/ink_inet.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.h b/lib/ts/ink_inet.h
index 6998c38..5eb93c1 100644
--- a/lib/ts/ink_inet.h
+++ b/lib/ts/ink_inet.h
@@ -149,7 +149,6 @@ struct hostent *ink_gethostbyaddr_r(char *ip, int len, int type, ink_gethostbyad
 inkcoreapi uint32_t ink_inet_addr(const char *s);
 
 const char *ats_ip_ntop(const struct sockaddr *addr, char *dst, size_t size);
-uint16_t ink_inet_port(const struct sockaddr *addr);
 
 // --
 /// Size in bytes of an IPv6 address.