| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // WARNING! Do NOT use this mojom. It is intended as a temporary interface to | 5 // WARNING! Do NOT use this mojom. It is intended as a temporary interface to |
| 6 // implement out-of-process proxy resolution. If you wish to use a Mojo DNS | 6 // implement out-of-process proxy resolution. If you wish to use a Mojo DNS |
| 7 // service, contact amistry@/sammc@ and net-dev to discuss a permanent Mojo DNS | 7 // service, contact amistry@/sammc@ and net-dev to discuss a permanent Mojo DNS |
| 8 // interface. | 8 // interface. |
| 9 | 9 |
| 10 // Put Mojo definitions into their own namespace to avoid collisions with C++ | 10 // Put Mojo definitions into their own namespace to avoid collisions with C++ |
| 11 // definitions. | 11 // definitions. |
| 12 // TODO(amistry): Resolve the conflict between these two sets of definitions. | 12 // TODO(amistry): Resolve the conflict between these two sets of definitions. |
| 13 module net.interfaces; | 13 module net.interfaces; |
| 14 | 14 |
| 15 // Mirror of net::AddressFamily. | 15 // Mirror of net::AddressFamily. |
| 16 enum AddressFamily { | 16 enum AddressFamily { |
| 17 UNSPECIFIED, | 17 UNSPECIFIED, |
| 18 IPV4, | 18 IPV4, |
| 19 IPV6, | 19 IPV6, |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 // Mirror of net::HostResolver::RequestInfo. | 22 // Mirror of net::HostResolver::RequestInfo. |
| 23 struct HostResolverRequestInfo { | 23 struct HostResolverRequestInfo { |
| 24 string host; | 24 string host; |
| 25 uint16 port; | 25 uint16 port; |
| 26 AddressFamily address_family; | 26 AddressFamily address_family; |
| 27 bool is_my_ip_address; | 27 bool is_my_ip_address; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 // Mirror of net::IPAddress. |
| 31 struct IPAddress { |
| 32 // IP address as a numeric value from most to least significant byte. |
| 33 // Will be of length 4 for IPv4 addresses and 16 for IPv6. |
| 34 array<uint8> address; |
| 35 }; |
| 36 |
| 30 // Mirror of net::IPEndPoint. | 37 // Mirror of net::IPEndPoint. |
| 31 struct IPEndPoint { | 38 struct IPEndPoint { |
| 32 // IP address as a numeric value from most to least significant byte. | 39 // IP address as a numeric value from most to least significant byte. |
| 33 // Will be of length 4 for IPv4 addresses and 16 for IPv6. | 40 // Will be of length 4 for IPv4 addresses and 16 for IPv6. |
| 34 array<uint8> address; | 41 array<uint8> address; |
| 35 uint16 port; | 42 uint16 port; |
| 36 }; | 43 }; |
| 37 | 44 |
| 38 // Mirror of net::AddressList. | 45 // Mirror of net::AddressList. |
| 39 struct AddressList { | 46 struct AddressList { |
| 40 array<IPEndPoint> addresses; | 47 array<IPEndPoint> addresses; |
| 41 }; | 48 }; |
| 42 | 49 |
| 43 interface HostResolverRequestClient { | 50 interface HostResolverRequestClient { |
| 44 // |error| is a value in net::Error. | 51 // |error| is a value in net::Error. |
| 45 ReportResult(int32 error, AddressList result); | 52 ReportResult(int32 error, AddressList result); |
| 46 }; | 53 }; |
| OLD | NEW |