Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | #include "nsINetAddr.idl" |
michael@0 | 9 | |
michael@0 | 10 | native NetAddr(mozilla::net::NetAddr); |
michael@0 | 11 | [ptr] native NetAddrPtr(mozilla::net::NetAddr); |
michael@0 | 12 | |
michael@0 | 13 | |
michael@0 | 14 | /** |
michael@0 | 15 | * Filters are created and run on the parent, and filter all UDP packets, both |
michael@0 | 16 | * ingoing and outgoing. The child must specify the name of a recognized filter |
michael@0 | 17 | * in order to create a UDP socket. |
michael@0 | 18 | */ |
michael@0 | 19 | [uuid(24f20de4-09e9-42ab-947a-0d6a3d103d59)] |
michael@0 | 20 | interface nsIUDPSocketFilter : nsISupports |
michael@0 | 21 | { |
michael@0 | 22 | const long SF_INCOMING = 0; |
michael@0 | 23 | const long SF_OUTGOING = 1; |
michael@0 | 24 | |
michael@0 | 25 | bool filterPacket([const]in NetAddrPtr remote_addr, |
michael@0 | 26 | [const, array, size_is(len)]in uint8_t data, |
michael@0 | 27 | in unsigned long len, |
michael@0 | 28 | in long direction); |
michael@0 | 29 | }; |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * Factory of a specified filter. |
michael@0 | 33 | */ |
michael@0 | 34 | [uuid(81ee76c6-4753-4125-9c8c-290ed9ba62fb)] |
michael@0 | 35 | interface nsIUDPSocketFilterHandler : nsISupports |
michael@0 | 36 | { |
michael@0 | 37 | nsIUDPSocketFilter newFilter(); |
michael@0 | 38 | }; |
michael@0 | 39 | |
michael@0 | 40 | %{C++ |
michael@0 | 41 | /** |
michael@0 | 42 | * Filter handlers are registered with XPCOM under the following CONTRACTID prefix: |
michael@0 | 43 | */ |
michael@0 | 44 | #define NS_NETWORK_UDP_SOCKET_FILTER_HANDLER_PREFIX "@mozilla.org/network/udp-filter-handler;1?name=" |
michael@0 | 45 | %} |