Bug 1845134 - Part 4: Update existing ui-icons to use the latest source from acorn...
[gecko.git] / netwerk / base / nsINetAddr.idl
blobbbbcd28c0e521f678e43d9cd7ede73fa41ba37c2
1 /* vim: et ts=4 sw=4 tw=80
2 */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 %{ C++
10 namespace mozilla {
11 namespace net {
12 union NetAddr;
16 native NetAddr(mozilla::net::NetAddr);
18 /**
19 * nsINetAddr
21 * This interface represents a native NetAddr struct in a readonly
22 * interface.
24 [scriptable, uuid(652B9EC5-D159-45D7-9127-50BB559486CD)]
25 interface nsINetAddr : nsISupports
27 /**
28 * @return the address family of the network address, which corresponds to
29 * one of the FAMILY_ constants.
31 readonly attribute unsigned short family;
33 /**
34 * @return Either the IP address (FAMILY_INET, FAMILY_INET6) or the path
35 * (FAMILY_LOCAL) in string form. IP addresses are in the format produced by
36 * mozilla::net::NetAddr::ToStringBuffer.
38 * Note: Paths for FAMILY_LOCAL may have length limitations which are
39 * implementation dependent and not documented as part of this interface.
41 readonly attribute AUTF8String address;
43 /**
44 * @return the port number for a FAMILY_INET or FAMILY_INET6 address.
46 * @throws NS_ERROR_NOT_AVAILABLE if the address family is not FAMILY_INET or
47 * FAMILY_INET6.
49 readonly attribute unsigned short port;
51 /**
52 * @return the flow label for a FAMILY_INET6 address.
54 * @see http://www.ietf.org/rfc/rfc3697.txt
56 * @throws NS_ERROR_NOT_AVAILABLE if the address family is not FAMILY_INET6
58 readonly attribute unsigned long flow;
60 /**
61 * @return the address scope of a FAMILY_INET6 address.
63 * @see http://tools.ietf.org/html/rfc4007
65 * @throws NS_ERROR_NOT_AVAILABLE if the address family is not FAMILY_INET6
67 readonly attribute unsigned long scope;
69 /**
70 * @return whether a FAMILY_INET6 address is mapped from FAMILY_INET.
72 * @throws NS_ERROR_NOT_AVAILABLE if the address family is not FAMILY_INET6
74 readonly attribute boolean isV4Mapped;
76 /**
77 * Network address families. These correspond to all the network address
78 * families supported by the NetAddr struct.
80 const unsigned long FAMILY_INET = 1;
81 const unsigned long FAMILY_INET6 = 2;
82 const unsigned long FAMILY_LOCAL = 3;
84 /**
85 * @return the underlying NetAddr struct.
87 [noscript] NetAddr getNetAddr();