2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2003-09-12 00:32:33 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-12-24 01:08:43 +04:00
|
|
|
%{ C++
|
2013-09-23 07:35:05 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
union NetAddr;
|
|
|
|
}
|
|
|
|
}
|
2016-07-20 18:29:36 +03:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
2012-12-24 01:08:43 +04:00
|
|
|
%}
|
|
|
|
native NetAddr(mozilla::net::NetAddr);
|
2015-01-30 18:55:07 +03:00
|
|
|
[ref] native nsNetAddrTArrayRef(nsTArray<mozilla::net::NetAddr>);
|
2013-01-10 22:44:17 +04:00
|
|
|
interface nsINetAddr;
|
2003-09-12 00:32:33 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* nsIDNSRecord
|
|
|
|
*
|
|
|
|
* this interface represents the result of a DNS lookup. since a DNS
|
|
|
|
* query may return more than one resolved IP address, the record acts
|
|
|
|
* like an enumerator, allowing the caller to easily step through the
|
|
|
|
* list of IP addresses.
|
|
|
|
*/
|
2015-01-30 18:55:07 +03:00
|
|
|
[scriptable, uuid(f92228ae-c417-4188-a604-0830a95e7eb9)]
|
2003-09-12 00:32:33 +04:00
|
|
|
interface nsIDNSRecord : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2004-09-01 23:55:58 +04:00
|
|
|
* @return the canonical hostname for this record. this value is empty if
|
|
|
|
* the record was not fetched with the RESOLVE_CANONICAL_NAME flag.
|
2003-09-12 00:32:33 +04:00
|
|
|
*
|
2004-09-01 23:55:58 +04:00
|
|
|
* e.g., www.mozilla.org --> rheet.mozilla.org
|
2003-09-12 00:32:33 +04:00
|
|
|
*/
|
|
|
|
readonly attribute ACString canonicalName;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* this function copies the value of the next IP address into the
|
2012-12-24 01:08:43 +04:00
|
|
|
* given NetAddr struct and increments the internal address iterator.
|
2003-09-12 00:32:33 +04:00
|
|
|
*
|
2004-09-05 17:20:59 +04:00
|
|
|
* @param aPort
|
2012-12-24 01:08:43 +04:00
|
|
|
* A port number to initialize the NetAddr with.
|
2004-09-05 17:20:59 +04:00
|
|
|
*
|
2003-09-12 00:32:33 +04:00
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in
|
|
|
|
* the record.
|
|
|
|
*/
|
2012-12-24 01:08:43 +04:00
|
|
|
[noscript] NetAddr getNextAddr(in uint16_t aPort);
|
2003-09-12 00:32:33 +04:00
|
|
|
|
2015-01-30 18:55:07 +03:00
|
|
|
/**
|
|
|
|
* this function copies the value of all working members of the RR
|
|
|
|
* set into the output array.
|
|
|
|
*
|
|
|
|
* @param aAddressArray
|
|
|
|
* The result set
|
|
|
|
*/
|
|
|
|
[noscript] void getAddresses(out nsNetAddrTArrayRef aAddressArray);
|
|
|
|
|
2013-01-10 22:44:17 +04:00
|
|
|
/**
|
|
|
|
* this function returns the value of the next IP address as a
|
|
|
|
* scriptable address and increments the internal address iterator.
|
|
|
|
*
|
|
|
|
* @param aPort
|
|
|
|
* A port number to initialize the nsINetAddr with.
|
|
|
|
*
|
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in
|
|
|
|
* the record.
|
|
|
|
*/
|
|
|
|
nsINetAddr getScriptableNextAddr(in uint16_t aPort);
|
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
/**
|
|
|
|
* this function returns the value of the next IP address as a
|
|
|
|
* string and increments the internal address iterator.
|
|
|
|
*
|
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in
|
|
|
|
* the record.
|
|
|
|
*/
|
|
|
|
ACString getNextAddrAsString();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* this function returns true if there is another address in the record.
|
|
|
|
*/
|
|
|
|
boolean hasMore();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* this function resets the internal address iterator to the first
|
|
|
|
* address in the record.
|
|
|
|
*/
|
|
|
|
void rewind();
|
2011-07-21 17:18:01 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function indicates that the last address obtained via getNextAddr*()
|
|
|
|
* was not usuable and should be skipped in future uses of this
|
|
|
|
* record if other addresses are available.
|
|
|
|
*
|
|
|
|
* @param aPort is the port number associated with the failure, if any.
|
|
|
|
* It may be zero if not applicable.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void reportUnusable(in uint16_t aPort);
|
2003-09-12 00:32:33 +04:00
|
|
|
};
|