michael@0: /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsINetAddr.idl" michael@0: michael@0: native NetAddr(mozilla::net::NetAddr); michael@0: [ptr] native NetAddrPtr(mozilla::net::NetAddr); michael@0: michael@0: michael@0: /** michael@0: * Filters are created and run on the parent, and filter all UDP packets, both michael@0: * ingoing and outgoing. The child must specify the name of a recognized filter michael@0: * in order to create a UDP socket. michael@0: */ michael@0: [uuid(24f20de4-09e9-42ab-947a-0d6a3d103d59)] michael@0: interface nsIUDPSocketFilter : nsISupports michael@0: { michael@0: const long SF_INCOMING = 0; michael@0: const long SF_OUTGOING = 1; michael@0: michael@0: bool filterPacket([const]in NetAddrPtr remote_addr, michael@0: [const, array, size_is(len)]in uint8_t data, michael@0: in unsigned long len, michael@0: in long direction); michael@0: }; michael@0: michael@0: /** michael@0: * Factory of a specified filter. michael@0: */ michael@0: [uuid(81ee76c6-4753-4125-9c8c-290ed9ba62fb)] michael@0: interface nsIUDPSocketFilterHandler : nsISupports michael@0: { michael@0: nsIUDPSocketFilter newFilter(); michael@0: }; michael@0: michael@0: %{C++ michael@0: /** michael@0: * Filter handlers are registered with XPCOM under the following CONTRACTID prefix: michael@0: */ michael@0: #define NS_NETWORK_UDP_SOCKET_FILTER_HANDLER_PREFIX "@mozilla.org/network/udp-filter-handler;1?name=" michael@0: %}