netwerk/base/public/nsIUDPSocketFilter.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIUDPSocketFilter.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +#include "nsINetAddr.idl"
    1.12 +
    1.13 +native NetAddr(mozilla::net::NetAddr);
    1.14 +[ptr] native NetAddrPtr(mozilla::net::NetAddr);
    1.15 +
    1.16 +
    1.17 +/**
    1.18 + * Filters are created and run on the parent, and filter all UDP packets, both
    1.19 + * ingoing and outgoing. The child must specify the name of a recognized filter
    1.20 + * in order to create a UDP socket.
    1.21 + */
    1.22 +[uuid(24f20de4-09e9-42ab-947a-0d6a3d103d59)]
    1.23 +interface nsIUDPSocketFilter : nsISupports
    1.24 +{
    1.25 +  const long SF_INCOMING = 0;
    1.26 +  const long SF_OUTGOING = 1;
    1.27 +
    1.28 +  bool filterPacket([const]in NetAddrPtr remote_addr,
    1.29 +                    [const, array, size_is(len)]in uint8_t data,
    1.30 +                    in unsigned long len,
    1.31 +                    in long direction);
    1.32 +};
    1.33 +
    1.34 +/**
    1.35 + * Factory of a specified filter.
    1.36 + */
    1.37 +[uuid(81ee76c6-4753-4125-9c8c-290ed9ba62fb)]
    1.38 +interface nsIUDPSocketFilterHandler : nsISupports
    1.39 +{
    1.40 +   nsIUDPSocketFilter newFilter();
    1.41 +};
    1.42 +
    1.43 +%{C++
    1.44 +/**
    1.45 + * Filter handlers are registered with XPCOM under the following CONTRACTID prefix:
    1.46 + */
    1.47 +#define NS_NETWORK_UDP_SOCKET_FILTER_HANDLER_PREFIX "@mozilla.org/network/udp-filter-handler;1?name="
    1.48 +%}

mercurial