|
1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=8 sts=2 et sw=2 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/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 #include "nsINetAddr.idl" |
|
9 |
|
10 native NetAddr(mozilla::net::NetAddr); |
|
11 [ptr] native NetAddrPtr(mozilla::net::NetAddr); |
|
12 |
|
13 |
|
14 /** |
|
15 * Filters are created and run on the parent, and filter all UDP packets, both |
|
16 * ingoing and outgoing. The child must specify the name of a recognized filter |
|
17 * in order to create a UDP socket. |
|
18 */ |
|
19 [uuid(24f20de4-09e9-42ab-947a-0d6a3d103d59)] |
|
20 interface nsIUDPSocketFilter : nsISupports |
|
21 { |
|
22 const long SF_INCOMING = 0; |
|
23 const long SF_OUTGOING = 1; |
|
24 |
|
25 bool filterPacket([const]in NetAddrPtr remote_addr, |
|
26 [const, array, size_is(len)]in uint8_t data, |
|
27 in unsigned long len, |
|
28 in long direction); |
|
29 }; |
|
30 |
|
31 /** |
|
32 * Factory of a specified filter. |
|
33 */ |
|
34 [uuid(81ee76c6-4753-4125-9c8c-290ed9ba62fb)] |
|
35 interface nsIUDPSocketFilterHandler : nsISupports |
|
36 { |
|
37 nsIUDPSocketFilter newFilter(); |
|
38 }; |
|
39 |
|
40 %{C++ |
|
41 /** |
|
42 * Filter handlers are registered with XPCOM under the following CONTRACTID prefix: |
|
43 */ |
|
44 #define NS_NETWORK_UDP_SOCKET_FILTER_HANDLER_PREFIX "@mozilla.org/network/udp-filter-handler;1?name=" |
|
45 %} |