1 /* vim: et ts=4 sw=4 tw=80
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"
16 native NetAddr
(mozilla
::net
::NetAddr
);
21 * This interface represents a native NetAddr struct in a readonly
24 [scriptable
, uuid(652B9EC5
-D159
-45D7
-9127-50BB559486CD
)]
25 interface nsINetAddr
: nsISupports
28 * @return the address family of the network address, which corresponds to
29 * one of the FAMILY_ constants.
31 readonly attribute
unsigned short family
;
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
;
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
49 readonly attribute
unsigned short port
;
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
;
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
;
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
;
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;
85 * @return the underlying NetAddr struct.
87 [noscript
] NetAddr getNetAddr
();