media/mtransport/third_party/nICEr/src/ice/ice_handler.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /*
     2 Copyright (c) 2007, Adobe Systems, Incorporated
     3 All rights reserved.
     5 Redistribution and use in source and binary forms, with or without
     6 modification, are permitted provided that the following conditions are
     7 met:
     9 * Redistributions of source code must retain the above copyright
    10   notice, this list of conditions and the following disclaimer.
    12 * Redistributions in binary form must reproduce the above copyright
    13   notice, this list of conditions and the following disclaimer in the
    14   documentation and/or other materials provided with the distribution.
    16 * Neither the name of Adobe Systems, Network Resonance nor the names of its
    17   contributors may be used to endorse or promote products derived from
    18   this software without specific prior written permission.
    20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    24 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    26 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31 */
    35 #ifndef _ice_h
    36 #define _ice_h
    37 #ifdef __cplusplus
    38 using namespace std;
    39 extern "C" {
    40 #endif /* __cplusplus */
    42 typedef struct nr_ice_handler_vtbl_ {
    43   /* The checks on this media stream are done. The handler needs to
    44      select a single pair to proceed with (regular nomination).
    45      Once this returns the check starts and the pair can be
    46      written on. Use nr_ice_candidate_pair_select() to perform the
    47      selection.
    48      TODO: !ekr! is this right?
    49   */
    50   int (*select_pair)(void *obj,nr_ice_media_stream *stream,
    51 int component_id, nr_ice_cand_pair **potentials,int potential_ct);
    53   /* This media stream is ready to read/write (aggressive nomination).
    54      May be called again if the nominated pair changes due to
    55      ICE instability. TODO: !ekr! think about this
    56   */
    57   int (*stream_ready)(void *obj, nr_ice_media_stream *stream);
    59   /* This media stream has failed */
    60   int (*stream_failed)(void *obj, nr_ice_media_stream *stream);
    62   /* ICE is completed for this peer ctx
    63      if need_update is nonzero, a SIP update is required
    64    */
    65   int (*ice_completed)(void *obj, nr_ice_peer_ctx *pctx);
    67   /* A message was delivered to us */
    68   int (*msg_recvd)(void *obj, nr_ice_peer_ctx *pctx, nr_ice_media_stream *stream, int component_id, UCHAR *msg, int len);
    69 } nr_ice_handler_vtbl;
    71 typedef struct nr_ice_handler_ {
    72   void *obj;
    73   nr_ice_handler_vtbl *vtbl;
    74 } nr_ice_handler;
    76 #ifdef __cplusplus
    77 }
    78 #endif /* __cplusplus */
    79 #endif

mercurial