2003-09-12 00:32:33 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is IBM Corporation.
|
|
|
|
* Portions created by IBM Corporation are Copyright (C) 2003
|
|
|
|
* IBM Corporation. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* IBM Corp.
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2003-11-09 04:29:58 +03:00
|
|
|
native PRNetAddr(union PRNetAddr);
|
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.
|
|
|
|
*/
|
2011-07-21 17:18:01 +04:00
|
|
|
[scriptable, uuid(ead9e9d8-7eef-4dae-a7f0-a1edcfb20478)]
|
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
|
|
|
|
* given PRNetAddr struct and increments the internal address iterator.
|
|
|
|
*
|
2004-09-05 17:20:59 +04:00
|
|
|
* @param aPort
|
|
|
|
* A port number to initialize the PRNetAddr with.
|
|
|
|
*
|
2003-09-12 00:32:33 +04:00
|
|
|
* @throws NS_ERROR_NOT_AVAILABLE if there is not another IP address in
|
|
|
|
* the record.
|
|
|
|
*/
|
2004-09-05 17:20:59 +04:00
|
|
|
[noscript] PRNetAddr getNextAddr(in PRUint16 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.
|
|
|
|
*/
|
|
|
|
void reportUnusable(in PRUint16 aPort);
|
2003-09-12 00:32:33 +04:00
|
|
|
};
|