| 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 #ifndef NET_BASE_ADDRESS_LIST_H_ | 5 #ifndef NET_BASE_ADDRESS_LIST_H_ |
| 6 #define NET_BASE_ADDRESS_LIST_H_ | 6 #define NET_BASE_ADDRESS_LIST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // |canonical_name| must be a non-null value. | 67 // |canonical_name| must be a non-null value. |
| 68 bool GetCanonicalName(std::string* canonical_name) const; | 68 bool GetCanonicalName(std::string* canonical_name) const; |
| 69 | 69 |
| 70 // Clears all data from this address list. This leaves the list in the same | 70 // Clears all data from this address list. This leaves the list in the same |
| 71 // empty state as when first constructed. | 71 // empty state as when first constructed. |
| 72 void Reset(); | 72 void Reset(); |
| 73 | 73 |
| 74 // Get access to the head of the addrinfo list. | 74 // Get access to the head of the addrinfo list. |
| 75 const struct addrinfo* head() const; | 75 const struct addrinfo* head() const; |
| 76 | 76 |
| 77 // Constructs an address list for a single socket address. |
| 78 // |address| the sockaddr to copy. |
| 79 // |socket_type| is either SOCK_STREAM or SOCK_DGRAM. |
| 80 // |protocol| is either IPPROTO_TCP or IPPROTO_UDP. |
| 81 static AddressList* CreateAddressListFromSockaddr( |
| 82 const struct sockaddr* address, |
| 83 socklen_t address_length, |
| 84 int socket_type, |
| 85 int protocol); |
| 86 |
| 77 private: | 87 private: |
| 78 struct Data; | 88 struct Data; |
| 79 | 89 |
| 80 explicit AddressList(Data* data); | 90 explicit AddressList(Data* data); |
| 81 | 91 |
| 82 scoped_refptr<Data> data_; | 92 scoped_refptr<Data> data_; |
| 83 }; | 93 }; |
| 84 | 94 |
| 85 } // namespace net | 95 } // namespace net |
| 86 | 96 |
| 87 #endif // NET_BASE_ADDRESS_LIST_H_ | 97 #endif // NET_BASE_ADDRESS_LIST_H_ |
| OLD | NEW |