Wed, 31 Dec 2014 06:55:46 +0100
Added tag TORBROWSER_REPLICA for changeset 6474c204b198
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | %{ C++ |
michael@0 | 8 | namespace mozilla { |
michael@0 | 9 | namespace net { |
michael@0 | 10 | union NetAddr; |
michael@0 | 11 | } |
michael@0 | 12 | } |
michael@0 | 13 | %} |
michael@0 | 14 | native NetAddr(mozilla::net::NetAddr); |
michael@0 | 15 | interface nsINetAddr; |
michael@0 | 16 | |
michael@0 | 17 | /** |
michael@0 | 18 | * nsIDNSRecord |
michael@0 | 19 | * |
michael@0 | 20 | * this interface represents the result of a DNS lookup. since a DNS |
michael@0 | 21 | * query may return more than one resolved IP address, the record acts |
michael@0 | 22 | * like an enumerator, allowing the caller to easily step through the |
michael@0 | 23 | * list of IP addresses. |
michael@0 | 24 | */ |
michael@0 | 25 | [scriptable, uuid(95ced6f3-44b4-4427-a149-c9a1e033d852)] |
michael@0 | 26 | interface nsIDNSRecord : nsISupports |
michael@0 | 27 | { |
michael@0 | 28 | /** |
michael@0 | 29 | * @return the canonical hostname for this record. this value is empty if |
michael@0 | 30 | * the record was not fetched with the RESOLVE_CANONICAL_NAME flag. |
michael@0 | 31 | * |
michael@0 | 32 | * e.g., www.mozilla.org --> rheet.mozilla.org |
michael@0 | 33 | */ |
michael@0 | 34 | readonly attribute ACString canonicalName; |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * this function copies the value of the next IP address into the |
michael@0 | 38 | * given NetAddr struct and increments the internal address iterator. |
michael@0 | 39 | * |
michael@0 | 40 | * @param aPort |
michael@0 | 41 | * A port number to initialize the NetAddr with. |
michael@0 | 42 | * |
michael@0 | 43 | * @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in |
michael@0 | 44 | * the record. |
michael@0 | 45 | */ |
michael@0 | 46 | [noscript] NetAddr getNextAddr(in uint16_t aPort); |
michael@0 | 47 | |
michael@0 | 48 | /** |
michael@0 | 49 | * this function returns the value of the next IP address as a |
michael@0 | 50 | * scriptable address and increments the internal address iterator. |
michael@0 | 51 | * |
michael@0 | 52 | * @param aPort |
michael@0 | 53 | * A port number to initialize the nsINetAddr with. |
michael@0 | 54 | * |
michael@0 | 55 | * @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in |
michael@0 | 56 | * the record. |
michael@0 | 57 | */ |
michael@0 | 58 | nsINetAddr getScriptableNextAddr(in uint16_t aPort); |
michael@0 | 59 | |
michael@0 | 60 | /** |
michael@0 | 61 | * this function returns the value of the next IP address as a |
michael@0 | 62 | * string and increments the internal address iterator. |
michael@0 | 63 | * |
michael@0 | 64 | * @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in |
michael@0 | 65 | * the record. |
michael@0 | 66 | */ |
michael@0 | 67 | ACString getNextAddrAsString(); |
michael@0 | 68 | |
michael@0 | 69 | /** |
michael@0 | 70 | * this function returns true if there is another address in the record. |
michael@0 | 71 | */ |
michael@0 | 72 | boolean hasMore(); |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | * this function resets the internal address iterator to the first |
michael@0 | 76 | * address in the record. |
michael@0 | 77 | */ |
michael@0 | 78 | void rewind(); |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * This function indicates that the last address obtained via getNextAddr*() |
michael@0 | 82 | * was not usuable and should be skipped in future uses of this |
michael@0 | 83 | * record if other addresses are available. |
michael@0 | 84 | * |
michael@0 | 85 | * @param aPort is the port number associated with the failure, if any. |
michael@0 | 86 | * It may be zero if not applicable. |
michael@0 | 87 | */ |
michael@0 | 88 | void reportUnusable(in uint16_t aPort); |
michael@0 | 89 | }; |