...
 
Commits (89)
......@@ -52,12 +52,12 @@ libagent_la_SOURCES = \
interfaces.h \
pseudotcp.h \
pseudotcp.c \
iostream.h \
iostream.c \
inputstream.h \
inputstream.c \
outputstream.h \
outputstream.c \
datagram-based.c \
datagram-based.h \
pseudo-tcp-input-stream.c \
pseudo-tcp-input-stream.h \
pseudo-tcp-output-stream.c \
pseudo-tcp-output-stream.h \
$(BUILT_SOURCES)
agent-enum-types.h: agent.h Makefile
......
......@@ -108,6 +108,8 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
#define NICE_AGENT_TIMER_TR_DEFAULT 25000 /* timer Tr, msecs (impl. defined) */
#define NICE_AGENT_MAX_CONNECTIVITY_CHECKS_DEFAULT 100 /* see spec 5.7.3 (ID-19) */
#define NICE_AGENT_KEEPALIVE_DEFAULT_TIMEOUT 200 /* Start at 200ms, then doube 6 times for a total of 25.4s */
/* An upper limit to size of STUN packets handled (based on Ethernet
* MTU and estimated typical sizes of ICE STUN packet */
......@@ -150,6 +152,7 @@ struct _NiceAgent
guint timer_ta; /* property: timer Ta */
guint max_conn_checks; /* property: max connectivity checks */
gboolean force_relay; /* property: force relay */
gboolean turn_short_term; /* property: turn short term credentials */
guint stun_max_retransmissions; /* property: stun max retransmissions, Rc */
guint stun_initial_timeout; /* property: stun initial timeout, RTO */
guint stun_reliable_timeout; /* property: stun reliable timeout */
......@@ -181,7 +184,6 @@ struct _NiceAgent
GSource *upnp_timer_source; /* source of upnp timeout timer */
#endif
gchar *software_attribute; /* SOFTWARE attribute */
gboolean reliable; /* property: reliable */
gboolean keepalive_conncheck; /* property: keepalive_conncheck */
GQueue pending_signals;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -49,7 +49,6 @@ typedef struct _NiceComponent NiceComponent;
#include "candidate.h"
#include "stun/stunagent.h"
#include "stun/usages/timer.h"
#include "pseudotcp.h"
#include "stream.h"
#include "socket.h"
......@@ -109,9 +108,11 @@ incoming_check_free (IncomingCheck *icheck);
* The Component is stored so this may be used as the user data for a GSource
* callback. */
typedef struct {
volatile gint ref_count;
NiceSocket *socket;
GSource *source;
NiceComponent *component;
GIOCondition last_condition;
} SocketSource;
......@@ -210,22 +211,12 @@ struct _NiceComponent {
GCancellable *stop_cancellable;
GSource *stop_cancellable_source; /* owned */
GSList *component_sources;
PseudoTcpSocket *tcp;
GSource* tcp_clock;
guint64 last_clock_timeout;
gboolean tcp_readable;
GCancellable *tcp_writable_cancellable;
GIOStream *iostream;
GDatagramBased *datagram_based; /* owned */
guint min_port;
guint max_port;
/* Queue of messages received before a selected socket was available to send
* ACKs on. The messages are dequeued to the pseudo-TCP socket once a selected
* UDP socket is available. This is only used for reliable Components. */
GQueue queued_tcp_packets;
};
typedef struct {
......@@ -269,11 +260,14 @@ nice_component_detach_all_sockets (NiceComponent *component);
void
nice_component_free_socket_sources (NiceComponent *component);
GIOCondition
nice_component_condition_check (NiceComponent *component,
GIOCondition condition);
GSource *
nice_component_input_source_new (NiceAgent *agent, guint stream_id,
guint component_id, GPollableInputStream *pollable_istream,
GCancellable *cancellable);
nice_component_source_new (NiceAgent *agent, guint stream_id,
guint component_id, GDatagramBased *datagram_based,
GIOCondition condition, GCancellable *cancellable);
GMainContext *
nice_component_dup_io_context (NiceComponent *component);
......@@ -292,6 +286,8 @@ nice_component_has_io_callback (NiceComponent *component);
void
nice_component_clean_turn_servers (NiceComponent *component);
void
nice_component_clean_candidates (NiceComponent *cmp);
TurnServer *
turn_server_new (const gchar *server_ip, guint server_port,
......
......@@ -1231,10 +1231,10 @@ static guint32 peer_reflexive_candidate_priority (NiceAgent *agent,
priority = nice_candidate_msn_priority (candidate_priority);
} else if (agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
priority = nice_candidate_ms_ice_priority (candidate_priority,
agent->reliable, FALSE);
FALSE, FALSE);
} else {
priority = nice_candidate_ice_priority (candidate_priority,
agent->reliable, FALSE);
FALSE, FALSE);
}
nice_candidate_free (candidate_priority);
......@@ -2605,12 +2605,9 @@ static unsigned int priv_compute_conncheck_timer (NiceAgent *agent, NiceStream *
/* We assume non-reliable streams are RTP, so we use 100 as the max */
nice_debug ("Agent %p : timer set to %dms, "
"waiting+in_progress=%d, nb_active=%d",
agent, agent->reliable ? MAX (rto, 500) : MAX (rto, 100),
agent, MAX (rto, 100),
waiting_and_in_progress, n);
if (agent->reliable)
return MAX (rto, 500);
else
return MAX (rto, 100);
return MAX (rto, 100);
}
/*
......@@ -2780,10 +2777,6 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
pair->sockptr = new_socket;
_priv_set_socket_tos (agent, pair->sockptr, stream2->tos);
if (agent->reliable)
nice_socket_set_writable_callback (pair->sockptr,
_tcp_sock_is_writable, component2);
nice_component_attach_socket (component2, new_socket);
}
}
......@@ -3796,9 +3789,6 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
} else {
priv_add_new_turn_refresh (d, relay_cand, lifetime);
}
/* In case a new candidate has been added */
conn_check_schedule_next (agent);
}
d->stun_message.buffer = NULL;
......
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2010, 2013 Collabora Ltd.
* Contact: Youness Alaoui
* © 2015 Collabora Ltd.
* Contact: Philip Withnall
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
......@@ -20,7 +20,7 @@
* Corporation. All Rights Reserved.
*
* Contributors:
* Youness Alaoui, Collabora Ltd.
* Philip Withnall, Collabora Ltd.
*
* Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
......@@ -33,55 +33,50 @@
* file under either the MPL or the LGPL.
*/
#ifndef __NICE_INPUT_STREAM_H__
#define __NICE_INPUT_STREAM_H__
#ifndef __NICE_DATAGRAM_BASED_H__
#define __NICE_DATAGRAM_BASED_H__
#include <glib-object.h>
#include <gio/gio.h>
#include "agent.h"
G_BEGIN_DECLS
/* TYPE MACROS */
#define NICE_TYPE_INPUT_STREAM \
(nice_input_stream_get_type ())
#define NICE_INPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), NICE_TYPE_INPUT_STREAM, \
NiceInputStream))
#define NICE_INPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), NICE_TYPE_INPUT_STREAM, \
NiceInputStreamClass))
#define NICE_IS_INPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NICE_TYPE_INPUT_STREAM))
#define NICE_IS_INPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), NICE_TYPE_INPUT_STREAM))
#define NICE_INPUT_STREAM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_INPUT_STREAM, \
NiceInputStreamClass))
#define NICE_TYPE_DATAGRAM_BASED \
(nice_datagram_based_get_type ())
#define NICE_DATAGRAM_BASED(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), NICE_TYPE_DATAGRAM_BASED, \
NiceDatagramBased))
#define NICE_DATAGRAM_BASED_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), NICE_TYPE_DATAGRAM_BASED, \
NiceDatagramBasedClass))
#define NICE_IS_DATAGRAM_BASED(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NICE_TYPE_DATAGRAM_BASED))
#define NICE_IS_DATAGRAM_BASED_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), NICE_TYPE_DATAGRAM_BASED))
#define NICE_DATAGRAM_BASED_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_DATAGRAM_BASED, \
NiceDatagramBasedClass))
typedef struct _NiceDatagramBasedClass NiceDatagramBasedClass;
typedef struct _NiceDatagramBased NiceDatagramBased;
typedef struct _NiceInputStreamPrivate NiceInputStreamPrivate;
typedef struct _NiceInputStreamClass NiceInputStreamClass;
typedef struct _NiceInputStream NiceInputStream;
#include "agent.h"
GType nice_input_stream_get_type (void);
GType nice_datagram_based_get_type (void);
struct _NiceInputStreamClass
struct _NiceDatagramBasedClass
{
GInputStreamClass parent_class;
GObjectClass parent_class;
};
struct _NiceInputStream
struct _NiceDatagramBased
{
GInputStream parent_instance;
NiceInputStreamPrivate *priv;
GObject parent_instance;
};
NiceInputStream *nice_input_stream_new (NiceAgent *agent,
GDatagramBased *nice_datagram_based_new (NiceAgent *agent,
guint stream_id, guint component_id);
G_END_DECLS
#endif /* __NICE_INPUT_STREAM_H__ */
#endif /* __NICE_DATAGRAM_BASED_H__ */
......@@ -83,46 +83,59 @@ stun_handler (const char *format, va_list ap)
g_logv ("libnice-stun", G_LOG_LEVEL_DEBUG, format, ap);
}
void nice_debug_init (void)
void
nice_debug_set_from_string (const gchar *extra_string)
{
static gboolean debug_initialized = FALSE;
const gchar *flags_string;
const gchar *gflags_string;
guint flags = 0;
flags_string = g_getenv ("NICE_DEBUG");
gflags_string = g_getenv ("G_MESSAGES_DEBUG");
if (flags_string)
flags = g_parse_debug_string (flags_string, keys, 4);
if (gflags_string)
flags |= g_parse_debug_string (gflags_string, gkeys, 4);
if (gflags_string && strstr (gflags_string, "libnice-pseudotcp-verbose"))
flags |= NICE_DEBUG_PSEUDOTCP_VERBOSE;
if (gflags_string && strstr (gflags_string, "libnice-verbose"))
flags |= NICE_DEBUG_NICE_VERBOSE;
if (extra_string)
flags |= g_parse_debug_string (extra_string, gkeys, 4);
if (extra_string && strstr (extra_string, "libnice-pseudotcp-verbose"))
flags |= NICE_DEBUG_PSEUDOTCP_VERBOSE;
if (extra_string && strstr (extra_string, "libnice-verbose"))
flags |= NICE_DEBUG_NICE_VERBOSE;
stun_set_debug_handler (stun_handler);
debug_enabled = !!(flags & NICE_DEBUG_NICE);
if (flags & NICE_DEBUG_STUN)
stun_debug_enable ();
else
stun_debug_disable ();
if (flags & NICE_DEBUG_NICE_VERBOSE)
debug_verbose_enabled = TRUE;
/* Set verbose before normal so that if we use 'all', then only
normal debug is enabled, we'd need to set pseudotcp-verbose without the
pseudotcp flag in order to actually enable verbose pseudotcp */
if (flags & NICE_DEBUG_PSEUDOTCP_VERBOSE)
pseudo_tcp_set_debug_level (PSEUDO_TCP_DEBUG_VERBOSE);
else if (flags & NICE_DEBUG_PSEUDOTCP)
pseudo_tcp_set_debug_level (PSEUDO_TCP_DEBUG_NORMAL);
}
void nice_debug_init (void)
{
static gboolean debug_initialized = FALSE;
if (!debug_initialized) {
debug_initialized = TRUE;
flags_string = g_getenv ("NICE_DEBUG");
gflags_string = g_getenv ("G_MESSAGES_DEBUG");
if (flags_string)
flags = g_parse_debug_string (flags_string, keys, 4);
if (gflags_string)
flags |= g_parse_debug_string (gflags_string, gkeys, 4);
if (gflags_string && strstr (gflags_string, "libnice-pseudotcp-verbose"))
flags |= NICE_DEBUG_PSEUDOTCP_VERBOSE;
if (gflags_string && strstr (gflags_string, "libnice-verbose")) {
flags |= NICE_DEBUG_NICE_VERBOSE;
}
stun_set_debug_handler (stun_handler);
debug_enabled = !!(flags & NICE_DEBUG_NICE);
if (flags & NICE_DEBUG_STUN)
stun_debug_enable ();
else
stun_debug_disable ();
if (flags & NICE_DEBUG_NICE_VERBOSE)
debug_verbose_enabled = TRUE;
/* Set verbose before normal so that if we use 'all', then only
normal debug is enabled, we'd need to set pseudotcp-verbose without the
pseudotcp flag in order to actually enable verbose pseudotcp */
if (flags & NICE_DEBUG_PSEUDOTCP_VERBOSE)
pseudo_tcp_set_debug_level (PSEUDO_TCP_DEBUG_VERBOSE);
else if (flags & NICE_DEBUG_PSEUDOTCP)
pseudo_tcp_set_debug_level (PSEUDO_TCP_DEBUG_NORMAL);
nice_debug_set_from_string (NULL);
}
}
......
......@@ -99,6 +99,19 @@ void nice_debug_enable (gboolean with_stun);
*/
void nice_debug_disable (gboolean with_stun);
/**
* nice_debug_set_from_string:
* @extra_string: String in the style of G_MESSAGES_DEBUG
*
* This parses the same kind of string that could be passed to the
* standard G_MESSAGES_DEBUG environment variable. It uses the categorie defined
* in the doc for the nice_debug_enable() function.
*
* Since: 0.1.15
*/
void nice_debug_set_from_string (const gchar *extra_string);
G_END_DECLS
#endif /* __LIBNICE_DEBUG_H__ */
......
......@@ -543,10 +543,10 @@ HostCandidateResult discovery_add_local_host_candidate (
candidate->priority = nice_candidate_msn_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
candidate->priority = nice_candidate_ms_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
} else {
candidate->priority = nice_candidate_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
}
candidate->priority = ensure_unique_priority (component,
......@@ -635,10 +635,10 @@ discovery_add_server_reflexive_candidate (
candidate->priority = nice_candidate_msn_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
candidate->priority = nice_candidate_ms_ice_priority (candidate,
agent->reliable, nat_assisted);
FALSE, nat_assisted);
} else {
candidate->priority = nice_candidate_ice_priority (candidate,
agent->reliable, nat_assisted);
FALSE, nat_assisted);
}
candidate->priority = ensure_unique_priority (component,
......@@ -753,10 +753,10 @@ discovery_add_relay_candidate (
candidate->priority = nice_candidate_msn_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
candidate->priority = nice_candidate_ms_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
} else {
candidate->priority = nice_candidate_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
}
candidate->priority = ensure_unique_priority (component,
......@@ -835,10 +835,10 @@ discovery_add_peer_reflexive_candidate (
candidate->priority = nice_candidate_msn_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
candidate->priority = nice_candidate_ms_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
} else {
candidate->priority = nice_candidate_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
}
candidate->priority = ensure_unique_priority (component,
......@@ -938,10 +938,10 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
candidate->priority = nice_candidate_msn_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_OC2007R2) {
candidate->priority = nice_candidate_ms_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
} else {
candidate->priority = nice_candidate_ice_priority (candidate,
agent->reliable, FALSE);
FALSE, FALSE);
}
priv_assign_remote_foundation (agent, candidate);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* This file is part of the Nice GLib ICE library.
*
* © 2015 Collabora Ltd.
* Contact: Philip Withnall
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Nice GLib ICE library.
*
* The Initial Developers of the Original Code are Collabora Ltd and Nokia
* Corporation. All Rights Reserved.
*
* Contributors:
* Philip Withnall, Collabora Ltd.
*
* Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
* case the provisions of LGPL are applicable instead of those above. If you
* wish to allow use of your version of this file only under the terms of the
* LGPL and not to allow others to use your version of this file under the
* MPL, indicate your decision by deleting the provisions above and replace
* them with the notice and other provisions required by the LGPL. If you do
* not delete the provisions above, a recipient may use your version of this
* file under either the MPL or the LGPL.
*/
#ifndef __NICE_PSEUDO_TCP_INPUT_STREAM_H__
#define __NICE_PSEUDO_TCP_INPUT_STREAM_H__
#include <glib-object.h>
#include <gio/gio.h>
#include "pseudotcp.h"
G_BEGIN_DECLS
#define NICE_TYPE_PSEUDO_TCP_INPUT_STREAM \
(nice_pseudo_tcp_input_stream_get_type ())
#define NICE_PSEUDO_TCP_INPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), NICE_TYPE_PSEUDO_TCP_INPUT_STREAM, \
NicePseudoTcpInputStream))
#define NICE_PSEUDO_TCP_INPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), NICE_TYPE_PSEUDO_TCP_INPUT_STREAM, \
NicePseudoTcpInputStreamClass))
#define NICE_IS_PSEUDO_TCP_INPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NICE_TYPE_PSEUDO_TCP_INPUT_STREAM))
#define NICE_IS_PSEUDO_TCP_INPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), NICE_TYPE_PSEUDO_TCP_INPUT_STREAM))
#define NICE_PSEUDO_TCP_INPUT_STREAM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_PSEUDO_TCP_INPUT_STREAM, \
NicePseudoTcpInputStreamClass))
typedef struct _NicePseudoTcpInputStreamClass NicePseudoTcpInputStreamClass;
typedef struct _NicePseudoTcpInputStream NicePseudoTcpInputStream;
#include "agent.h"
GType nice_pseudo_tcp_input_stream_get_type (void);
struct _NicePseudoTcpInputStreamClass
{
GInputStreamClass parent_class;
};
struct _NicePseudoTcpInputStream
{
GInputStream parent_instance;
};
GInputStream *nice_pseudo_tcp_input_stream_new (PseudoTcpSocket *socket);
G_END_DECLS
#endif /* __NICE_PSEUDO_TCP_INPUT_STREAM_H__ */
This diff is collapsed.
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2010, 2013 Collabora Ltd.
* Contact: Youness Alaoui
* © 2015 Collabora Ltd.
* Contact: Philip Withnall
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
......@@ -20,7 +20,7 @@
* Corporation. All Rights Reserved.
*
* Contributors:
* Youness Alaoui, Collabora Ltd.
* Philip Withnall, Collabora Ltd.
*
* Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
......@@ -33,55 +33,51 @@
* file under either the MPL or the LGPL.
*/
#ifndef __NICE_OUTPUT_STREAM_H__
#define __NICE_OUTPUT_STREAM_H__
#ifndef __NICE_PSEUDO_TCP_OUTPUT_STREAM_H__
#define __NICE_PSEUDO_TCP_OUTPUT_STREAM_H__
#include <glib-object.h>
#include <gio/gio.h>
#include "agent.h"
G_BEGIN_DECLS
#include "pseudotcp.h"
/* TYPE MACROS */
#define NICE_TYPE_OUTPUT_STREAM \
(nice_output_stream_get_type ())
#define NICE_OUTPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), NICE_TYPE_OUTPUT_STREAM, \
NiceOutputStream))
#define NICE_OUTPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), NICE_TYPE_OUTPUT_STREAM, \
NiceOutputStreamClass))
#define NICE_IS_OUTPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NICE_TYPE_OUTPUT_STREAM))
#define NICE_IS_OUTPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), NICE_TYPE_OUTPUT_STREAM))
#define NICE_OUTPUT_STREAM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_OUTPUT_STREAM, \
NiceOutputStreamClass))
G_BEGIN_DECLS
#define NICE_TYPE_PSEUDO_TCP_OUTPUT_STREAM \
(nice_pseudo_tcp_output_stream_get_type ())
#define NICE_PSEUDO_TCP_OUTPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), NICE_TYPE_PSEUDO_TCP_OUTPUT_STREAM, \
NicePseudoTcpOutputStream))
#define NICE_PSEUDO_TCP_OUTPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), NICE_TYPE_PSEUDO_TCP_OUTPUT_STREAM, \
NicePseudoTcpOutputStreamClass))
#define NICE_IS_PSEUDO_TCP_OUTPUT_STREAM(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NICE_TYPE_PSEUDO_TCP_OUTPUT_STREAM))
#define NICE_IS_PSEUDO_TCP_OUTPUT_STREAM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), NICE_TYPE_PSEUDO_TCP_OUTPUT_STREAM))
#define NICE_PSEUDO_TCP_OUTPUT_STREAM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NICE_TYPE_PSEUDO_TCP_OUTPUT_STREAM, \
NicePseudoTcpOutputStreamClass))
typedef struct _NiceOutputStreamPrivate NiceOutputStreamPrivate;
typedef struct _NiceOutputStreamClass NiceOutputStreamClass;
typedef struct _NiceOutputStream NiceOutputStream;
typedef struct _NicePseudoTcpOutputStreamClass NicePseudoTcpOutputStreamClass;
typedef struct _NicePseudoTcpOutputStream NicePseudoTcpOutputStream;
#include "agent.h"
GType nice_output_stream_get_type (void);
GType nice_pseudo_tcp_output_stream_get_type (void);
struct _NiceOutputStreamClass
struct _NicePseudoTcpOutputStreamClass
{
GOutputStreamClass parent_class;
};
struct _NiceOutputStream
struct _NicePseudoTcpOutputStream
{
GOutputStream parent_instance;
NiceOutputStreamPrivate *priv;
};
NiceOutputStream *nice_output_stream_new (NiceAgent *agent,
guint stream_id, guint component_id);
GOutputStream *nice_pseudo_tcp_output_stream_new (PseudoTcpSocket *socket);
G_END_DECLS
#endif /* __NICE_OUTPUT_STREAM_H__ */
#endif /* __NICE_PSEUDO_TCP_OUTPUT_STREAM_H__ */
This diff is collapsed.
This diff is collapsed.
......@@ -94,9 +94,9 @@ AC_CHECK_HEADERS([ifaddrs.h], \
AC_CHECK_TYPES([size_t, ssize_t])
# Also put matching version in LIBNICE_CFLAGS
GLIB_REQ=2.44
GLIB_REQ=2.45.4
LIBNICE_CFLAGS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_44 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_44"
LIBNICE_CFLAGS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_46"
dnl Support different levels of compiler error reporting.
dnl This configure flag is designed to mimic one from gnome-common,
......
......@@ -55,7 +55,7 @@ CFILE_GLOB=$(top_srcdir)/agent/agent.c \
# Header files to ignore when scanning.
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
IGNORE_HFILES= conncheck.h discovery.h stream.h component.h agent-priv.h \
iostream.h inputstream.h outputstream.h \
datagram-based.h \
gstnice.h gstnicesrc.h gstnicesink.h \
md5.h sha1.h stunhmac.h utils.h rand.h stun5389.h stuncrc32.h \
stund.h agent-signals-marshal.h win32_common.h
......
......@@ -50,7 +50,7 @@ nice_agent_generate_local_candidate_sdp
nice_agent_parse_remote_sdp
nice_agent_parse_remote_stream_sdp
nice_agent_parse_remote_candidate_sdp
nice_agent_get_io_stream
nice_agent_get_socket
nice_agent_get_selected_socket
nice_agent_get_component_state
nice_component_state_to_string
......@@ -126,6 +126,7 @@ nice_address_ip_version
<TITLE>Debug messages</TITLE>
nice_debug_enable
nice_debug_disable
nice_debug_set_from_string
</SECTION>
<SECTION>
......@@ -302,6 +303,7 @@ PseudoTcpDebugLevel
PseudoTcpShutdown
pseudo_tcp_socket_new
pseudo_tcp_socket_connect
pseudo_tcp_socket_listen
pseudo_tcp_socket_recv
pseudo_tcp_socket_send
pseudo_tcp_socket_close
......
......@@ -22,6 +22,7 @@ nice_agent_recv_messages
nice_agent_recv_nonblocking
nice_agent_recv_messages_nonblocking
nice_agent_attach_recv
nice_agent_close_other_sockets
nice_agent_forget_relays
nice_agent_gather_candidates
nice_agent_generate_local_candidate_sdp
......@@ -29,7 +30,7 @@ nice_agent_generate_local_sdp
nice_agent_generate_local_stream_sdp
nice_agent_get_component_state
nice_agent_get_default_local_candidate
nice_agent_get_io_stream
nice_agent_get_socket
nice_agent_get_local_candidates
nice_agent_get_local_credentials
nice_agent_get_remote_candidates
......@@ -38,7 +39,6 @@ nice_agent_get_selected_socket
nice_agent_get_stream_name
nice_agent_get_type
nice_agent_new
nice_agent_new_reliable
nice_agent_parse_remote_candidate_sdp
nice_agent_parse_remote_sdp
nice_agent_parse_remote_stream_sdp
......@@ -64,21 +64,27 @@ nice_candidate_new
nice_component_state_to_string
nice_debug_disable
nice_debug_enable
nice_debug_set_from_string
nice_interfaces_get_ip_for_interface
nice_interfaces_get_local_interfaces
nice_interfaces_get_local_ips
nice_io_stream_new
nice_input_stream_new
nice_output_stream_new
pseudo_tcp_set_debug_level
pseudo_tcp_socket_accept_async
pseudo_tcp_socket_accept_finish
pseudo_tcp_socket_close
pseudo_tcp_socket_close_async
pseudo_tcp_socket_close_finish
pseudo_tcp_socket_connect
pseudo_tcp_socket_connect_async
pseudo_tcp_socket_connect_finish
pseudo_tcp_socket_get_error
pseudo_tcp_socket_get_next_clock
pseudo_tcp_socket_get_type
pseudo_tcp_socket_is_closed
pseudo_tcp_socket_is_closed_remotely
pseudo_tcp_socket_listen
pseudo_tcp_socket_new
pseudo_tcp_socket_new_from_socket
pseudo_tcp_socket_notify_clock
pseudo_tcp_socket_notify_mtu
pseudo_tcp_socket_notify_packet
......
This diff is collapsed.
......@@ -144,6 +144,7 @@ socket_recv_message (NiceSocket *sock, NiceInputMessage *recv_message)
if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766_SHORT_TERM ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_OC2007)
headerlen = 4;
else if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_GOOGLE)
......@@ -168,7 +169,8 @@ socket_recv_message (NiceSocket *sock, NiceInputMessage *recv_message)
return 0;
if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766) {
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766_SHORT_TERM){
guint16 magic = ntohs (*priv->recv_buf.u16);
guint16 packetlen = ntohs (*(priv->recv_buf.u16 + 1));
......@@ -203,7 +205,8 @@ socket_recv_message (NiceSocket *sock, NiceInputMessage *recv_message)
}
if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766)
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766_SHORT_TERM)
padlen = (priv->expecting_len % 4) ? 4 - (priv->expecting_len % 4) : 0;
else
padlen = 0;
......@@ -310,7 +313,8 @@ socket_send_message (NiceSocket *sock, const NiceAddress *to,
local_bufs[0].size = sizeof (guint16);
offset = 1;
} else if (priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_DRAFT9 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766) {
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766 ||
priv->compatibility == NICE_TURN_SOCKET_COMPATIBILITY_RFC5766_SHORT_TERM) {
gsize message_len = output_message_get_size (message);
gsize padlen = (message_len % 4) ? 4 - (message_len % 4) : 0;
......
This diff is collapsed.
......@@ -44,6 +44,7 @@ typedef enum {
NICE_TURN_SOCKET_COMPATIBILITY_MSN,
NICE_TURN_SOCKET_COMPATIBILITY_OC2007,
NICE_TURN_SOCKET_COMPATIBILITY_RFC5766,
NICE_TURN_SOCKET_COMPATIBILITY_RFC5766_SHORT_TERM
} NiceTurnSocketCompatibility;
#include "socket.h"
......
......@@ -438,7 +438,7 @@ static void keepalive (void)
static void test (void (*func) (void), const char *name)
{
alarm (30);
alarm (20);
printf ("%s test... ", name);
func ();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.