| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // hrseolv is a command line utility which runs the HostResolver in the | 5 // hrseolv is a command line utility which runs the HostResolver in the |
| 6 // Chromium network stack. | 6 // Chromium network stack. |
| 7 // | 7 // |
| 8 // The user specifies the hosts to lookup and when to look them up. | 8 // The user specifies the hosts to lookup and when to look them up. |
| 9 // The hosts must be specified in order. | 9 // The hosts must be specified in order. |
| 10 // The hosts can be contained in a file or on the command line. If no | 10 // The hosts can be contained in a file or on the command line. If no |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const char* name; | 44 const char* name; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 static const FlagName kAddrinfoFlagNames[] = { | 47 static const FlagName kAddrinfoFlagNames[] = { |
| 48 {AI_PASSIVE, "AI_PASSIVE"}, | 48 {AI_PASSIVE, "AI_PASSIVE"}, |
| 49 {AI_CANONNAME, "AI_CANONNAME"}, | 49 {AI_CANONNAME, "AI_CANONNAME"}, |
| 50 {AI_NUMERICHOST, "AI_NUMERICHOST"}, | 50 {AI_NUMERICHOST, "AI_NUMERICHOST"}, |
| 51 {AI_V4MAPPED, "AI_V4MAPPED"}, | 51 {AI_V4MAPPED, "AI_V4MAPPED"}, |
| 52 {AI_ALL, "AI_ALL"}, | 52 {AI_ALL, "AI_ALL"}, |
| 53 {AI_ADDRCONFIG, "AI_ADDRCONFIG"}, | 53 {AI_ADDRCONFIG, "AI_ADDRCONFIG"}, |
| 54 #if defined(OS_LINUX) || defined(OS_WIN) | 54 #if !defined(OS_MACOSX) |
| 55 {AI_NUMERICSERV, "AI_NUMERICSERV"}, | 55 {AI_NUMERICSERV, "AI_NUMERICSERV"}, |
| 56 #endif | 56 #endif |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 std::string FormatAddrinfoFlags(int ai_flags) { | 59 std::string FormatAddrinfoFlags(int ai_flags) { |
| 60 std::string flag_names; | 60 std::string flag_names; |
| 61 for (unsigned int i = 0; i < arraysize(kAddrinfoFlagNames); ++i) { | 61 for (unsigned int i = 0; i < arraysize(kAddrinfoFlagNames); ++i) { |
| 62 const FlagName& flag_name = kAddrinfoFlagNames[i]; | 62 const FlagName& flag_name = kAddrinfoFlagNames[i]; |
| 63 if (ai_flags & flag_name.flag) { | 63 if (ai_flags & flag_name.flag) { |
| 64 ai_flags &= ~flag_name.flag; | 64 ai_flags &= ~flag_name.flag; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 base::TimeDelta::FromSeconds(0)); | 447 base::TimeDelta::FromSeconds(0)); |
| 448 | 448 |
| 449 scoped_refptr<net::HostResolver> host_resolver( | 449 scoped_refptr<net::HostResolver> host_resolver( |
| 450 new net::HostResolverImpl(NULL, cache, NULL, 100u)); | 450 new net::HostResolverImpl(NULL, cache, NULL, 100u)); |
| 451 ResolverInvoker invoker(host_resolver.get()); | 451 ResolverInvoker invoker(host_resolver.get()); |
| 452 invoker.ResolveAll(hosts_and_times, options.async); | 452 invoker.ResolveAll(hosts_and_times, options.async); |
| 453 | 453 |
| 454 CommandLine::Reset(); | 454 CommandLine::Reset(); |
| 455 return 0; | 455 return 0; |
| 456 } | 456 } |
| OLD | NEW |