http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index bb983b3..5f888e0 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -318,7 +318,7 @@ find_server_and_update_current_info(HttpTransact::State* s) // to go the origin server, we can only obey this if we // dns'ed the origin server if (s->parent_result.r == PARENT_DIRECT && s->http_config_param->no_dns_forward_to_parent != 0) { - ink_assert(!ink_inet_is_ip(&s->server_info.addr)); + ink_assert(!ats_is_ip(&s->server_info.addr)); s->parent_result.r = PARENT_FAIL; } break; @@ -1220,10 +1220,10 @@ HttpTransact::HandleRequest(State* s) // we need to see if the hostname is an // ip address since the parent selection code result // could change as a result of this ip address - ts_ip_endpoint addr; - ink_inet_pton(s->server_info.name, &addr); - if (ink_inet_is_ip(&addr)) { - ink_inet_copy(&s->request_data.dest_ip, &addr); + IpEndpoint addr; + ats_ip_pton(s->server_info.name, &addr); + if (ats_is_ip(&addr)) { + ats_ip_copy(&s->request_data.dest_ip, &addr); } if (s->parent_params->parentExists(&s->request_data)) { @@ -1231,7 +1231,7 @@ HttpTransact::HandleRequest(State* s) // DNS service available, we just want to forward the request // the parent proxy. In this case, we never find out the // origin server's ip. So just skip past OSDNS - ink_inet_invalidate(&s->server_info.addr); + ats_ip_invalidate(&s->server_info.addr); StartAccessControl(s); return; } else if (s->http_config_param->no_origin_server_dns) { @@ -1383,7 +1383,7 @@ HttpTransact::PPDNSLookup(State* s) if (!s->dns_info.lookup_success) { // DNS lookup of parent failed, find next parent or o.s. find_server_and_update_current_info(s); - if (!ink_inet_is_ip(&s->current.server->addr)) { + if (!ats_is_ip(&s->current.server->addr)) { if (s->current.request_to == PARENT_PROXY) { TRANSACT_RETURN(DNS_LOOKUP, PPDNSLookup); } else { @@ -1396,13 +1396,13 @@ HttpTransact::PPDNSLookup(State* s) } } else { // lookup succeeded, open connection to p.p. - ink_inet_copy(&s->parent_info.addr, s->host_db_info.ip()); + ats_ip_copy(&s->parent_info.addr, s->host_db_info.ip()); get_ka_info_from_host_db(s, &s->parent_info, &s->client_info, &s->host_db_info); s->parent_info.dns_round_robin = s->dns_info.round_robin; char addrbuf[INET6_ADDRSTRLEN]; Debug("http_trans", "[PPDNSLookup] DNS lookup for sm_id[%"PRId64"] successful IP: %s", - s->state_machine->sm_id, ink_inet_ntop(&s->parent_info.addr.sa, addrbuf, sizeof(addrbuf))); + s->state_machine->sm_id, ats_ip_ntop(&s->parent_info.addr.sa, addrbuf, sizeof(addrbuf))); } // Since this function can be called serveral times while retrying @@ -1451,14 +1451,14 @@ HttpTransact::ReDNSRoundRobin(State* s) // Our ReDNS of the server succeeeded so update the necessary // information and try again - ink_inet_copy(&s->server_info.addr, s->host_db_info.ip()); - ink_inet_copy(&s->request_data.dest_ip, &s->server_info.addr); + ats_ip_copy(&s->server_info.addr, s->host_db_info.ip()); + ats_ip_copy(&s->request_data.dest_ip, &s->server_info.addr); get_ka_info_from_host_db(s, &s->server_info, &s->client_info, &s->host_db_info); s->server_info.dns_round_robin = s->dns_info.round_robin; char addrbuf[INET6_ADDRSTRLEN]; Debug("http_trans", "[ReDNSRoundRobin] DNS lookup for O.S. successful IP: %s", - ink_inet_ntop(&s->server_info.addr.sa, addrbuf, sizeof(addrbuf))); + ats_ip_ntop(&s->server_info.addr.sa, addrbuf, sizeof(addrbuf))); s->next_action = how_to_open_connection(s); } else { @@ -1594,14 +1594,14 @@ HttpTransact::OSDNSLookup(State* s) // Check to see if can fullfill expect requests based on the cached // update some state variables with hostdb information that has // been provided. - ink_inet_copy(&s->server_info.addr, s->host_db_info.ip()); - ink_inet_copy(&s->request_data.dest_ip, &s->server_info.addr); + ats_ip_copy(&s->server_info.addr, s->host_db_info.ip()); + ats_ip_copy(&s->request_data.dest_ip, &s->server_info.addr); get_ka_info_from_host_db(s, &s->server_info, &s->client_info, &s->host_db_info); s->server_info.dns_round_robin = s->dns_info.round_robin; char addrbuf[INET6_ADDRSTRLEN]; Debug("http_trans", "[OSDNSLookup] DNS lookup for O.S. successful " - "IP: %s", ink_inet_ntop(&s->server_info.addr.sa, addrbuf, sizeof(addrbuf))); + "IP: %s", ats_ip_ntop(&s->server_info.addr.sa, addrbuf, sizeof(addrbuf))); // so the dns lookup was a success, but the lookup succeeded on // a hostname which was expanded by the traffic server. we should @@ -2550,7 +2550,7 @@ HttpTransact::HandleCacheOpenReadHit(State* s) } if (server_up || s->stale_icp_lookup) { - if (!s->stale_icp_lookup && !ink_inet_is_ip(&s->current.server->addr)) { + if (!s->stale_icp_lookup && !ats_is_ip(&s->current.server->addr)) { // ink_release_assert(s->current.request_to == PARENT_PROXY || // s->http_config_param->no_dns_forward_to_parent != 0); @@ -2938,7 +2938,7 @@ HttpTransact::HandleCacheOpenReadMiss(State* s) if (!h->is_cache_control_set(HTTP_VALUE_ONLY_IF_CACHED)) { find_server_and_update_current_info(s); - if (!ink_inet_is_ip(&s->current.server->addr)) { + if (!ats_is_ip(&s->current.server->addr)) { ink_release_assert(s->current.request_to == PARENT_PROXY || s->http_config_param->no_dns_forward_to_parent != 0); if (s->current.request_to == PARENT_PROXY) { @@ -2983,14 +2983,14 @@ HttpTransact::HandleICPLookup(State* s) if (s->icp_lookup_success == true) { HTTP_INCREMENT_TRANS_STAT(http_icp_suggested_lookups_stat); Debug("http_trans", "[HandleICPLookup] Success, sending request to icp suggested host."); - ink_inet_ip4_set(&s->icp_info.addr, s->icp_ip_result.sin_addr.s_addr); + ats_ip4_set(&s->icp_info.addr, s->icp_ip_result.sin_addr.s_addr); s->icp_info.port = ntohs(s->icp_ip_result.sin_port); // TODO in this case we should go to the miss case // just a little shy about using goto's, that's all. ink_release_assert( (s->icp_info.port != s->client_info.port) || - (ink_inet_cmp(&s->icp_info.addr.sa, &Machine::instance()->ip.sa) != 0) + (ats_ip_addr_cmp(&s->icp_info.addr.sa, &Machine::instance()->ip.sa) != 0) ); // Since the ICPDNSLookup is not called, these two @@ -3016,7 +3016,7 @@ HttpTransact::HandleICPLookup(State* s) ink_zero(s->parent_info.addr); find_server_and_update_current_info(s); - if (!ink_inet_is_ip(&s->current.server->addr)) { + if (!ats_is_ip(&s->current.server->addr)) { if (s->current.request_to == PARENT_PROXY) { TRANSACT_RETURN(DNS_LOOKUP, PPDNSLookup); } else { @@ -3296,7 +3296,7 @@ HttpTransact::handle_response_from_icp_suggested_host(State* s) // send request to parent proxy now if there is // one or else directly to the origin server. find_server_and_update_current_info(s); - if (!ink_inet_is_ip(&s->current.server->addr)) { + if (!ats_is_ip(&s->current.server->addr)) { if (s->current.request_to == PARENT_PROXY) { TRANSACT_RETURN(DNS_LOOKUP, PPDNSLookup); } else { @@ -3362,7 +3362,7 @@ HttpTransact::handle_response_from_parent(State* s) char addrbuf[INET6_ADDRSTRLEN]; Debug("http_trans", "[%d] failed to connect to parent %s", s->current.attempts, - ink_inet_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf))); + ats_ip_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf))); // If the request is not retryable, just give up! if (!is_request_retryable(s)) { @@ -3571,8 +3571,8 @@ HttpTransact::delete_srv_entry(State* s, int max_retries) MUTEX_TRY_LOCK(lock, bucket_mutex, thread); if (lock) { - ts_ip_endpoint ip; - HostDBInfo *r = probe(bucket_mutex, md5, hostname, len, ink_inet_ip4_set(&ip.sa, INADDR_ANY, htons(port)), pDS, false, true); + IpEndpoint ip; + HostDBInfo *r = probe(bucket_mutex, md5, hostname, len, ats_ip4_set(&ip.sa, INADDR_ANY, htons(port)), pDS, false, true); if (r) { if (r->is_srv) { Debug("dns_srv", "Marking SRV records for %s [Origin: %s] as bad", hostname, s->dns_info.lookup_name); @@ -3622,7 +3622,7 @@ HttpTransact::delete_srv_entry(State* s, int max_retries) new_r->ip_timeout_interval = 45; /* good for 45 seconds, then lets re-validate? */ new_r->ip_timestamp = hostdb_current_interval; - ink_inet_invalidate(new_r->ip()); + ats_ip_invalidate(new_r->ip()); /* these go into the RR area */ int n = new_r->srv_count; @@ -3637,7 +3637,7 @@ HttpTransact::delete_srv_entry(State* s, int max_retries) int i = 0; while ((srv_entry = still_ok_hosts.dequeue())) { Debug("dns_srv", "Re-adding %s to HostDB [as a RR] after %s failed", srv_entry->getHost(), s->dns_info.lookup_name); - ink_inet_invalidate(rr_data->info[i].ip()); + ats_ip_invalidate(rr_data->info[i].ip()); rr_data->info[i].round_robin = 0; rr_data->info[i].reverse_dns = 0; @@ -3690,7 +3690,7 @@ HttpTransact::delete_server_rr_entry(State* s, int max_retries) if (diags->on()) { DebugOn("http_trans", "[%d] failed to connect to %s", s->current.attempts, - ink_inet_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf))); + ats_ip_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf))); DebugOn("http_trans", "[delete_server_rr_entry] marking rr entry " "down and finding next one"); } ink_debug_assert(s->current.server->connect_failure); @@ -3726,7 +3726,7 @@ HttpTransact::retry_server_connection_not_open(State* s, ServerState_t conn_stat char *url_string = s->hdr_info.client_request.url_string_get(&s->arena); Debug("http_trans", "[%d] failed to connect [%d] to %s", s->current.attempts, conn_state, - ink_inet_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf))); + ats_ip_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf))); ////////////////////////////////////////// // on the first connect attempt failure // @@ -3736,7 +3736,7 @@ HttpTransact::retry_server_connection_not_open(State* s, ServerState_t conn_stat Log::error("CONNECT:[%d] could not connect [%s] to %s for '%s'", s->current.attempts, HttpDebugNames::get_server_state_name(conn_state), - ink_inet_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf)), url_string ? url_string : "<none>" + ats_ip_ntop(&s->current.server->addr.sa, addrbuf, sizeof(addrbuf)), url_string ? url_string : "<none>" ); if (url_string) { @@ -5172,11 +5172,11 @@ HttpTransact::add_client_ip_to_outgoing_request(State* s, HTTPHdr* request) char ip_string[INET6_ADDRSTRLEN + 1] = {'\0'}; size_t ip_string_size = 0; - if (!ink_inet_is_ip(&s->client_info.addr.sa)) + if (!ats_is_ip(&s->client_info.addr.sa)) return; // Always prepare the IP string. - if (ink_inet_ntop(&s->client_info.addr.sa, ip_string, sizeof(ip_string)) != NULL) { + if (ats_ip_ntop(&s->client_info.addr.sa, ip_string, sizeof(ip_string)) != NULL) { ip_string_size += strlen(ip_string); } else { // Failure, omg @@ -5691,7 +5691,7 @@ HttpTransact::initialize_state_variables_from_request(State* s, HTTPHdr* obsolet } s->request_data.hdr = &s->hdr_info.client_request; s->request_data.hostname_str = s->arena.str_store(host_name, host_len); - ink_inet_copy(&s->request_data.src_ip, &s->client_info.addr); + ats_ip_copy(&s->request_data.src_ip, &s->client_info.addr); memset(&s->request_data.dest_ip, 0, sizeof(s->request_data.dest_ip)); if (s->state_machine->ua_session) { s->request_data.incoming_port = s->state_machine->ua_session->get_netvc()->get_local_port(); @@ -6583,7 +6583,7 @@ HttpTransact::process_quick_http_filter(State* s, int method) } // Exempt for "localhost", avoid denying for localhost. - if (ink_inet_is_loopback(&s->client_info.addr)) { + if (ats_is_ip_loopback(&s->client_info.addr)) { return; } @@ -6695,9 +6695,9 @@ HttpTransact::will_this_request_self_loop(State* s) // check if we are about to self loop // //////////////////////////////////////// if (s->dns_info.lookup_success) { - if (ink_inet_eq(s->host_db_info.ip(), &Machine::instance()->ip.sa)) { + if (ats_ip_addr_eq(s->host_db_info.ip(), &Machine::instance()->ip.sa)) { uint16_t host_port = s->hdr_info.client_request.url_get()->port_get(); - uint16_t local_port = ink_inet_get_port(&s->client_info.addr); + uint16_t local_port = ats_ip_port_host_order(&s->client_info.addr); if (host_port == local_port) { switch (s->dns_info.looking_up) { case ORIGIN_SERVER: @@ -6721,7 +6721,7 @@ HttpTransact::will_this_request_self_loop(State* s) // Now check for a loop using the Via string. // Since we insert our ip_address (in hex) into outgoing Via strings, // look for our_ip address in the request's via string. - if (ink_inet_is_ip(&Machine::instance()->ip)) { + if (ats_is_ip(&Machine::instance()->ip)) { MIMEField *via_field = s->hdr_info.client_request.field_find(MIME_FIELD_VIA, MIME_LEN_VIA); while (via_field) { @@ -8227,7 +8227,7 @@ HttpTransact::build_error_response(State *s, HTTPStatus status_code, const char char ip_string[INET6_ADDRSTRLEN]; Log::error("RESPONSE: sent %s status %d (%s) for '%s'", - ink_inet_ntop(&s->client_info.addr.sa, ip_string, sizeof(ip_string)), + ats_ip_ntop(&s->client_info.addr.sa, ip_string, sizeof(ip_string)), status_code, reason_phrase, (url_string ? url_string : "<none>"));
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/HttpTransact.h ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h index bc0becf..a659349 100644 --- a/proxy/http/HttpTransact.h +++ b/proxy/http/HttpTransact.h @@ -780,7 +780,7 @@ public: bool connect_failure; TransferEncoding_t transfer_encoding; - ts_ip_endpoint addr; // replaces 'ip' field + IpEndpoint addr; // replaces 'ip' field // port to connect to, except for client // connection where it is port on proxy http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/HttpUpdateSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpUpdateSM.cc b/proxy/http/HttpUpdateSM.cc index 84328cd..6f2dd98 100644 --- a/proxy/http/HttpUpdateSM.cc +++ b/proxy/http/HttpUpdateSM.cc @@ -75,7 +75,7 @@ HttpUpdateSM::start_scheduled_update(Continuation * cont, HTTPHdr * request) // Fix ME: What should these be set to since there is not a // real client - ink_inet_ip4_set(&t_state.client_info.addr, htonl(INADDR_LOOPBACK), 0); + ats_ip4_set(&t_state.client_info.addr, htonl(INADDR_LOOPBACK), 0); t_state.backdoor_request = 0; t_state.client_info.port_attribute = HttpProxyPort::TRANSPORT_DEFAULT; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/remap/AclFiltering.cc ---------------------------------------------------------------------- diff --git a/proxy/http/remap/AclFiltering.cc b/proxy/http/remap/AclFiltering.cc index 14e1843..105eeff 100644 --- a/proxy/http/remap/AclFiltering.cc +++ b/proxy/http/remap/AclFiltering.cc @@ -102,8 +102,8 @@ acl_filter_rule::print(void) for (i = 0; i < src_ip_cnt; i++) { ip_text_buffer b1, b2; printf("%s - %s" - , ink_inet_ntop(&src_ip_array[i].start.sa, b1, sizeof(b1)) - , ink_inet_ntop(&src_ip_array[i].end.sa, b2, sizeof(b2)) + , ats_ip_ntop(&src_ip_array[i].start.sa, b1, sizeof(b1)) + , ats_ip_ntop(&src_ip_array[i].end.sa, b2, sizeof(b2)) ); } for (i = 0; i < argc; i++) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/remap/AclFiltering.h ---------------------------------------------------------------------- diff --git a/proxy/http/remap/AclFiltering.h b/proxy/http/remap/AclFiltering.h index 992411d..4dd684a 100644 --- a/proxy/http/remap/AclFiltering.h +++ b/proxy/http/remap/AclFiltering.h @@ -35,8 +35,8 @@ static int const ACL_FILTER_MAX_SRC_IP = 128; static int const ACL_FILTER_MAX_ARGV = 512; struct src_ip_info_t { - ts_ip_endpoint start; ///< Minimum value in range. - ts_ip_endpoint end; ///< Maximum value in range. + IpEndpoint start; ///< Minimum value in range. + IpEndpoint end; ///< Maximum value in range. bool invert; ///< Should we "invert" the meaning of this IP range ("not in range") void reset() { @@ -46,8 +46,8 @@ struct src_ip_info_t { } /// @return @c true if @a ip is inside @a this range. - bool contains(ts_ip_endpoint const& ip) { - return ink_inet_cmp(&start, &ip) <= 0 && ink_inet_cmp(&ip, &end) <= 0; + bool contains(IpEndpoint const& ip) { + return ats_ip_addr_cmp(&start, &ip) <= 0 && ats_ip_addr_cmp(&ip, &end) <= 0; } }; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/remap/RemapProcessor.cc ---------------------------------------------------------------------- diff --git a/proxy/http/remap/RemapProcessor.cc b/proxy/http/remap/RemapProcessor.cc index 8cf8449..16893bb 100644 --- a/proxy/http/remap/RemapProcessor.cc +++ b/proxy/http/remap/RemapProcessor.cc @@ -90,8 +90,8 @@ RemapProcessor::setup_for_remap(HttpTransact::State *s) if (rewrite_table->num_rules_forward_with_recv_port) { Debug("url_rewrite", "[lookup] forward mappings with recv port found; Using recv port %d", - ink_inet_get_port(&s->client_info.addr)); - if (rewrite_table->forwardMappingWithRecvPortLookup(request_url, ink_inet_get_port(&s->client_info.addr), + ats_ip_port_host_order(&s->client_info.addr)); + if (rewrite_table->forwardMappingWithRecvPortLookup(request_url, ats_ip_port_host_order(&s->client_info.addr), request_host, request_host_len, s->url_map)) { Debug("url_rewrite", "Found forward mapping with recv port"); mapping_found = true; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/http/remap/UrlRewrite.cc ---------------------------------------------------------------------- diff --git a/proxy/http/remap/UrlRewrite.cc b/proxy/http/remap/UrlRewrite.cc index dde8b5e..eda4bfc 100644 --- a/proxy/http/remap/UrlRewrite.cc +++ b/proxy/http/remap/UrlRewrite.cc @@ -847,7 +847,7 @@ UrlRewrite::PerformACLFiltering(HttpTransact::State *s, url_mapping *map) i = (method = s->hdr_info.client_request.method_get_wksidx()) - HTTP_WKSIDX_CONNECT; if (likely(i >= 0 && i < ACL_FILTER_MAX_METHODS)) { bool client_enabled_flag = true; - ink_release_assert(ink_inet_is_ip(&s->client_info.addr)); + ink_release_assert(ats_is_ip(&s->client_info.addr)); for (acl_filter_rule * rp = map->filter; rp; rp = rp->next) { bool match = true; if (rp->method_valid) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/logging/LogAccess.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc index b65cd54..64aec91 100644 --- a/proxy/logging/LogAccess.cc +++ b/proxy/logging/LogAccess.cc @@ -795,16 +795,16 @@ int LogAccess::marshal_ip(char* dest, sockaddr const* ip) { LogFieldIpStorage data; int len = sizeof(data._ip); - if (ink_inet_is_ip4(ip)) { + if (ats_is_ip4(ip)) { if (dest) { data._ip4._family = AF_INET; - data._ip4._addr = ink_inet_ip4_addr_cast(ip); + data._ip4._addr = ats_ip4_addr_cast(ip); } len = sizeof(data._ip4); - } else if (ink_inet_is_ip6(ip)) { + } else if (ats_is_ip6(ip)) { if (dest) { data._ip6._family = AF_INET6; - data._ip6._addr = ink_inet_ip6_addr_cast(ip); + data._ip6._addr = ats_ip6_addr_cast(ip); } len = sizeof(data._ip6); } else { @@ -1139,7 +1139,7 @@ LogAccess::unmarshal_http_status(char **buf, char *dest, int len) Retrieve an IP address directly. -------------------------------------------------------------------------*/ int -LogAccess::unmarshal_ip(char **buf, ts_ip_endpoint* dest) +LogAccess::unmarshal_ip(char **buf, IpEndpoint* dest) { int len = sizeof(LogFieldIp); // of object processed. @@ -1150,14 +1150,14 @@ LogAccess::unmarshal_ip(char **buf, ts_ip_endpoint* dest) LogFieldIp* raw = reinterpret_cast<LogFieldIp*>(*buf); if (AF_INET == raw->_family) { LogFieldIp4* ip4 = static_cast<LogFieldIp4*>(raw); - ink_inet_ip4_set(dest, ip4->_addr); + ats_ip4_set(dest, ip4->_addr); len = sizeof(*ip4); } else if (AF_INET6 == raw->_family) { LogFieldIp6* ip6 = static_cast<LogFieldIp6*>(raw); - ink_inet_ip6_set(dest, ip6->_addr); + ats_ip6_set(dest, ip6->_addr); len = sizeof(*ip6); } else { - ink_inet_invalidate(dest); + ats_ip_invalidate(dest); } len = INK_ALIGN_DEFAULT(len); *buf += len; @@ -1175,10 +1175,10 @@ LogAccess::unmarshal_ip(char **buf, ts_ip_endpoint* dest) int LogAccess::unmarshal_ip_to_str(char **buf, char *dest, int len) { - ts_ip_endpoint ip; + IpEndpoint ip; unmarshal_ip(buf, &ip); - return ink_inet_ntop(&ip, dest, len) ? ::strlen(dest) : -1; + return ats_ip_ntop(&ip, dest, len) ? ::strlen(dest) : -1; } /*------------------------------------------------------------------------- @@ -1192,9 +1192,9 @@ LogAccess::unmarshal_ip_to_str(char **buf, char *dest, int len) int LogAccess::unmarshal_ip_to_hex(char **buf, char *dest, int len) { - ts_ip_endpoint ip; + IpEndpoint ip; unmarshal_ip(buf, &ip); - return ink_inet_to_hex(&ip.sa, dest, len); + return ats_ip_to_hex(&ip.sa, dest, len); } /*------------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/logging/LogAccess.h ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h index bc9e5ef..5c0102f 100644 --- a/proxy/logging/LogAccess.h +++ b/proxy/logging/LogAccess.h @@ -278,7 +278,7 @@ public: static int unmarshal_http_version(char **buf, char *dest, int len); static int unmarshal_http_text(char **buf, char *dest, int len); static int unmarshal_http_status(char **buf, char *dest, int len); - static int unmarshal_ip(char** buf, ts_ip_endpoint* dest); + static int unmarshal_ip(char** buf, IpEndpoint* dest); static int unmarshal_ip_to_str(char **buf, char *dest, int len); static int unmarshal_ip_to_hex(char** buf, char* dest, int len); static int unmarshal_hierarchy(char **buf, char *dest, int len, Ptr<LogFieldAliasMap> map); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/logging/LogAccessHttp.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc index 60aaa85..a0e71c6 100644 --- a/proxy/logging/LogAccessHttp.cc +++ b/proxy/logging/LogAccessHttp.cc @@ -662,10 +662,10 @@ LogAccessHttp::marshal_server_host_ip(char *buf) { sockaddr const* ip = 0; ip = &m_http_sm->t_state.server_info.addr.sa; - if (! ink_inet_is_ip(ip)) { + if (! ats_is_ip(ip)) { if (m_http_sm->t_state.current.server) { ip = &m_http_sm->t_state.current.server->addr.sa; - if (! ink_inet_is_ip(ip)) ip = 0; + if (! ats_is_ip(ip)) ip = 0; } else { ip = 0; } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/logging/LogAccessTest.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccessTest.cc b/proxy/logging/LogAccessTest.cc index 3947c9a..e24067d 100644 --- a/proxy/logging/LogAccessTest.cc +++ b/proxy/logging/LogAccessTest.cc @@ -67,8 +67,8 @@ LogAccessTest::~LogAccessTest() int LogAccessTest::marshal_client_host_ip(char *buf) { - ts_ip_endpoint lo; - ink_inet_ip4_set(&lo, INADDR_LOOPBACK); + IpEndpoint lo; + ats_ip4_set(&lo, INADDR_LOOPBACK); return marshal_ip(buf, &lo.sa); } @@ -316,8 +316,8 @@ LogAccessTest::marshal_proxy_hierarchy_route(char *buf) int LogAccessTest::marshal_server_host_ip(char *buf) { - ts_ip_endpoint lo; - ink_inet_ip4_set(&lo, INADDR_LOOPBACK); + IpEndpoint lo; + ats_ip4_set(&lo, INADDR_LOOPBACK); return marshal_ip(buf, &lo.sa); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/47d1f8ec/proxy/logging/LogCollationClientSM.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogCollationClientSM.cc b/proxy/logging/LogCollationClientSM.cc index f581047..ced2c4c 100644 --- a/proxy/logging/LogCollationClientSM.cc +++ b/proxy/logging/LogCollationClientSM.cc @@ -315,9 +315,9 @@ LogCollationClientSM::client_dns(int event, HostDBInfo * hostdb_info) return client_done(LOG_COLL_EVENT_SWITCH, NULL); } // careful!!! could have problems later!!! - m_log_host->m_ip = ink_inet_ip4_addr_cast(hostdb_info->ip()); + m_log_host->m_ip = ats_ip4_addr_cast(hostdb_info->ip()); m_log_host->m_ipstr = (char *)ats_malloc(INET6_ADDRSTRLEN); - ink_inet_ntop(hostdb_info->ip(), m_log_host->m_ipstr, INET6_ADDRSTRLEN); + ats_ip_ntop(hostdb_info->ip(), m_log_host->m_ipstr, INET6_ADDRSTRLEN); return client_open(LOG_COLL_EVENT_SWITCH, NULL);
