Commit 355dafd0 authored by Kai Vehmanen's avatar Kai Vehmanen

Major update to the nice/agent interface: Added full-mode API and initial...

Major update to the nice/agent interface: Added full-mode API and initial implementation using the new nice/stun interface. Added unit test test-fullmode.c to cover the added functionality. Some public APIs of nice/agent/agent.h have been modified, making this change API/ABI incompatible.

darcs-hash:20070521153033-77cd4-c76ab583d06839e601f46b6734355dd8b66f7494.gz
parent 91d4e0a1
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2006, 2007 Collabora Ltd.
* Contact: Dafydd Harries
* (C) 2006, 2007 Nokia Corporation. All rights reserved.
* Contact: Kai Vehmanen
*
* 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:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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_AGENT_PRIV_H
#define _NICE_AGENT_PRIV_H
/* note: this is a private header part of agent.h */
#include <glib.h>
#include "agent.h"
#include "component.h"
#include "candidate.h"
#include "stream.h"
#include "conncheck.h"
#define NICE_AGENT_TIMER_TA_DEFAULT 20 /* timer Ta, msecs */
#define NICE_AGENT_TIMER_TR_DEFAULT 15000 /* timer Tr, msecs */
/** An upper limit to size of STUN packets handled (based on Ethernet
* MTU and estimated typical sizes of ICE STUN packet */
#define MAX_STUN_DATAGRAM_PAYLOAD 1300
struct _NiceAgent
{
GObject parent; /**< gobject pointer */
gboolean full_mode; /**< property: full-mode */
NiceUDPSocketFactory *socket_factory; /**< property: socket factory */
GTimeVal next_check_tv; /**< property: next conncheck timestamp */
gchar *stun_server_ip; /**< property: STUN server IP */
guint stun_server_port; /**< property: STUN server port */
gchar *turn_server_ip; /**< property: TURN server IP */
guint turn_server_port; /**< property: TURN server port */
gboolean controlling_mode; /**< property: controlling-mode */
GSList *local_addresses; /**< list of NiceAddresses for local
interfaces */
GSList *streams; /**< list of Stream objects */
gboolean main_context_set; /**< is the main context set */
GMainContext *main_context; /**< main context pointer */
NiceAgentRecvFunc read_func; /**< callback for media deliver */
gpointer read_func_data; /**< media delivery callback context */
guint next_candidate_id; /**< id of next created candidate */
guint next_stream_id; /**< id of next created candidate */
NiceRNG *rng; /**< random number generator */
GSList *discovery_list; /**< list of CandidateDiscovery items */
guint discovery_unsched_items; /**< number of discovery items unscheduled */
guint discovery_timer_id; /**< id of discovery timer */
GSList *conncheck_list; /**< list of CandidatePair items */
guint conncheck_timer_id; /**< id of discovery timer */
NiceCheckListState conncheck_state; /**< checklist state */
/* XXX: add pointer to internal data struct for ABI-safe extensions */
};
gboolean
agent_find_component (
NiceAgent *agent,
guint stream_id,
guint component_id,
Stream **stream,
Component **component);
Stream *agent_find_stream (NiceAgent *agent, guint stream_id);
void agent_signal_gathering_done (NiceAgent *agent);
void agent_signal_new_selected_pair (
NiceAgent *agent,
guint stream_id,
guint component_id,
const gchar *local_foundation,
const gchar *remote_foundation);
void agent_signal_component_state_change (
NiceAgent *agent,
guint stream_id,
guint component_id,
NiceComponentState state);
void agent_signal_new_candidate (
NiceAgent *agent,
NiceCandidate *candidate);
void agent_signal_initial_binding_request_received (NiceAgent *agent, Stream *stream);
void agent_free_discovery_candidate_udp (gpointer data, gpointer user_data);
#endif /*_NICE_AGENT_PRIV_H */
......@@ -2,3 +2,10 @@
VOID:UINT,UINT,UINT
# candidate-gathering-done
VOID:VOID
# new-selected-pair
VOID:UINT,UINT,STRING,STRING
# new-candidate
VOID:UINT,UINT,STRING
# initial-binding-request-received
VOID:UINT
This diff is collapsed.
......@@ -23,6 +23,7 @@
*
* Contributors:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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
......@@ -77,8 +78,9 @@ typedef enum
NICE_COMPONENT_STATE_CONNECTED, /* at least one working candidate pair */
NICE_COMPONENT_STATE_READY, /* ICE concluded, candidate pair
selection is now final */
NICE_COMPONENT_STATE_FAILED /* connectivity checks have been completed,
NICE_COMPONENT_STATE_FAILED, /* connectivity checks have been completed,
but connectivity was not established */
NICE_COMPONENT_STATE_LAST
} NiceComponentState;
typedef enum
......@@ -105,29 +107,6 @@ typedef void (*NiceAgentRecvFunc) (
NiceAgent *agent, guint stream_id, guint component_id, guint len,
gchar *buf, gpointer user_data);
struct _NiceAgent
{
GObject parent;
guint next_candidate_id;
guint next_stream_id;
gboolean full_mode;
NiceUDPSocketFactory *socket_factory;
GSList *local_addresses;
GSList *streams;
gboolean main_context_set;
GMainContext *main_context;
NiceAgentRecvFunc read_func;
gpointer read_func_data;
GSList *discovery_list;
guint discovery_unsched_items;
GSList *conncheck_list;
gchar *stun_server_ip;
guint stun_server_port;
gchar *turn_server_ip;
guint turn_server_port;
GTimeVal next_check_tv;
NiceRNG *rng;
};
typedef struct _NiceAgentClass NiceAgentClass;
......@@ -154,6 +133,18 @@ nice_agent_remove_stream (
NiceAgent *agent,
guint stream_id);
gboolean
nice_agent_set_remote_credentials (
NiceAgent *agent,
guint stream_id,
const gchar *ufrag, const gchar *pwd);
gboolean
nice_agent_get_local_credentials (
NiceAgent *agent,
guint stream_id,
const gchar **ufrag, const gchar **pwd);
void
nice_agent_add_remote_candidate (
NiceAgent *agent,
......
......@@ -23,6 +23,7 @@
*
* Contributors:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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
......@@ -36,7 +37,7 @@
*/
#include "agent.h"
#include "component.h"
/* (ICE-13 §4.1.1) Every candidate is a transport address. It also has a type and
* a base. Three types are defined and gathered by this specification - host
......@@ -59,12 +60,15 @@ nice_candidate_free (NiceCandidate *candidate)
{
/* better way of checking if socket is allocated? */
if (candidate->sock.addr.addr_ipv4 != 0)
nice_udp_socket_close (&(candidate->sock));
if (candidate->source)
g_source_destroy (candidate->source);
if (candidate->username)
g_free (candidate->username);
if (candidate->password)
g_free (candidate->password);
if (candidate->foundation)
g_free (candidate->foundation);
......@@ -88,10 +92,10 @@ nice_candidate_jingle_priority (NiceCandidate *candidate)
}
/* ICE-13 §4.1.2; returns number between 1 and 0x7effffff */
/* ICE-15 §4.1.2.1; returns number between 1 and 0x7effffff */
G_GNUC_CONST
static guint32
_candidate_ice_priority (
guint32
nice_candidate_ice_priority_full (
// must be ∈ (0, 126) (max 2^7 - 2)
guint type_preference,
// must be ∈ (0, 65535) (max 2^16 - 1)
......@@ -114,12 +118,28 @@ nice_candidate_ice_priority (const NiceCandidate *candidate)
switch (candidate->type)
{
case NICE_CANDIDATE_TYPE_HOST: type_preference = 120; break;
case NICE_CANDIDATE_TYPE_PEER_REFLEXIVE: type_preference = 110; break;
case NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE: type_preference = 100; break;
case NICE_CANDIDATE_TYPE_RELAYED: type_preference = 60; break;
case NICE_CANDIDATE_TYPE_HOST:
type_preference = NICE_CANDIDATE_TYPE_PREF_HOST; break;
case NICE_CANDIDATE_TYPE_PEER_REFLEXIVE:
type_preference = NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE; break;
case NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE:
type_preference = NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE; break;
case NICE_CANDIDATE_TYPE_RELAYED:
type_preference = NICE_CANDIDATE_TYPE_PREF_RELAYED; break;
}
return _candidate_ice_priority (type_preference, 1, candidate->component_id);
/* return _candidate_ice_priority (type_preference, 1, candidate->component_id); */
return nice_candidate_ice_priority_full (type_preference, 1, candidate->component_id);
}
/**
* Calculates the pair priority as specified in ICE -15 spec 5.7.2.
*/
guint64
nice_candidate_pair_priority (guint32 o_prio, guint32 a_prio)
{
guint32 max = o_prio > a_prio ? o_prio : a_prio;
guint32 min = o_prio < a_prio ? o_prio : a_prio;
return ((guint64)1 << 32) * min + 2 * max + (o_prio > a_prio ? 1 : 0);
}
......@@ -23,6 +23,7 @@
*
* Contributors:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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
......@@ -42,6 +43,11 @@
G_BEGIN_DECLS
#define NICE_CANDIDATE_TYPE_PREF_HOST 120
#define NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE 110
#define NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE 100
#define NICE_CANDIDATE_TYPE_PREF_RELAYED 60
typedef enum
{
NICE_CANDIDATE_TYPE_HOST,
......@@ -61,17 +67,15 @@ struct _NiceCandidate
{
NiceCandidateType type;
NiceCandidateTransport transport;
guint id;
NiceAddress addr;
NiceAddress base_addr;
guint32 priority;
guint stream_id;
guint component_id;
// guint generation;
gchar *foundation; /* note: if NULL, derive foundation from 'id' */
NiceUDPSocket sock;
gchar username[128]; /* XXX: why 128 chars? */
gchar password[128]; /* XXX: why 128 chars? */
gchar *foundation;
NiceUDPSocket *sockptr; /* XXX: to replace 'sock', see comment above */
gchar *username; /* pointer to a NULL-terminated username string */
gchar *password; /* pointer to a NULL-terminated password string */
GSource *source;
};
......@@ -85,9 +89,15 @@ nice_candidate_free (NiceCandidate *candidate);
gfloat
nice_candidate_jingle_priority (NiceCandidate *candidate);
guint32
nice_candidate_ice_priority_full (guint type_pref, guint local_pref, guint component_id);
guint32
nice_candidate_ice_priority (const NiceCandidate *candidate);
guint64
nice_candidate_pair_priority (guint32 o_prio, guint32 a_prio);
G_END_DECLS
#endif /* _CANDIDATE_H */
......
......@@ -55,22 +55,50 @@ component_free (Component *cmp)
{
GSList *i;
for (i = cmp->local_candidates; i; i = i->next)
{
NiceCandidate *candidate = i->data;
for (i = cmp->local_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
nice_candidate_free (candidate);
}
nice_candidate_free (candidate);
}
for (i = cmp->remote_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
nice_candidate_free (candidate);
}
for (i = cmp->remote_candidates; i; i = i->next)
{
NiceCandidate *candidate = i->data;
for (i = cmp->sockets; i; i = i->next) {
NiceUDPSocket *udpsocket = i->data;
nice_udp_socket_close (udpsocket);
}
nice_candidate_free (candidate);
}
for (i = cmp->gsources; i; i = i->next) {
GSource *source = i->data;
g_source_destroy (source);
}
g_slist_free (cmp->gsources),
cmp->gsources = NULL;
g_slist_free (cmp->local_candidates);
g_slist_free (cmp->remote_candidates);
g_slist_free (cmp->sockets);
g_slice_free (Component, cmp);
}
NiceUDPSocket *
component_find_udp_socket_by_fd (Component *component, guint fd)
{
GSList *i;
/* XXX: this won't work anymore, a single fd may be used
* by multiple candidates */
for (i = component->sockets; i; i = i->next)
{
NiceUDPSocket *sockptr = i->data;
if (sockptr->fileno == fd)
return sockptr;
}
return NULL;
}
......@@ -23,6 +23,7 @@
*
* Contributors:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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
......@@ -59,19 +60,35 @@ typedef enum
typedef struct _Component Component;
typedef struct _CandidatePair CandidatePair;
struct _CandidatePair
{
NiceCandidate *local;
NiceCandidate *remote;
guint64 priority; /**< candidate pair priority */
};
struct _Component
{
ComponentType type;
/* the local candidate that last received a valid connectivity check */
NiceCandidate *active_candidate;
/* the remote address that the last connectivity check came from */
NiceAddress peer_addr;
guint id;
NiceComponentState state;
GSList *local_candidates;
GSList *remote_candidates;
GSList *local_candidates; /**< list of Candidate objs */
GSList *remote_candidates; /**< list of Candidate objs */
GSList *sockets; /**< list of NiceUDPSocket objs */
GSList *gsources; /**< list of GSource objs */
CandidatePair selected_pair; /**< independent from checklists,
see ICE 11.1.1 (ID-15) */
/* XXX: **to be removed**
* --cut--
GSList *checks;
* the local candidate that last received a valid connectivity */
NiceCandidate *active_candidate;
/* the remote address that the last connectivity check came from */
NiceAddress peer_addr;
/* --cut-- */
};
Component *
......@@ -82,6 +99,9 @@ component_new (
void
component_free (Component *cmp);
NiceUDPSocket *
component_find_udp_socket_by_fd (Component *component, guint fd);
G_END_DECLS
#endif /* _NICE_COMPONENT_H */
......
This diff is collapsed.
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2006, 2007 Collabora Ltd.
* Contact: Dafydd Harries
* (C) 2006, 2007 Nokia Corporation. All rights reserved.
* Contact: Kai Vehmanen
*
* 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:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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_CONNCHECK_H
#define _NICE_CONNCHECK_H
/* note: this is a private header to libnice */
#include "agent.h"
#include "stream.h"
#include "stun.h" /* XXX: using the old STUN API, to be removed */
#include "stun/conncheck.h" /* note: the new STUN API */
typedef enum
{
NICE_CHECK_WAITING = 1, /**< waiting to be scheduled */
NICE_CHECK_IN_PROGRESS, /**< conn. checks started */
NICE_CHECK_SUCCEEDED, /**< conn. succesfully checked */
NICE_CHECK_FAILED, /**< no connectivity, retransmissions ceased */
NICE_CHECK_FROZEN, /**< waiting to be scheduled to WAITING */
NICE_CHECK_CANCELLED /**< check cancelled */
} NiceCheckState;
typedef enum
{
NICE_CHECKLIST_NOT_STARTED = 1,
NICE_CHECKLIST_RUNNING,
NICE_CHECKLIST_COMPLETED,
NICE_CHECKLIST_FAILED
} NiceCheckListState;
typedef struct _CandidateCheckPair CandidateCheckPair;
struct _CandidateCheckPair
{
NiceAgent *agent; /* back pointer to owner */
guint stream_id;
guint component_id;
NiceCandidate *local;
NiceCandidate *remote;
gchar *foundation;
NiceCheckState state;
gboolean nominated;
guint64 priority;
GTimeVal next_tick; /* next tick timestamp */
stun_bind_t *stun_ctx;
};
int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *remote);
void conn_check_free_item (gpointer data, gpointer user_data);
void conn_check_free (NiceAgent *agent);
void conn_check_schedule_next (NiceAgent *agent);
int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
gboolean conn_check_prune_stream (NiceAgent *agent, guint stream_id);
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, Component *component, const NiceAddress *from, gchar *buf, guint len);
/* functions using the old STUN API:
* ---------------------------------*/
void conn_check_handle_inbound_stun_old (
NiceAgent *agent,
Stream *stream,
Component *component,
NiceCandidate *local,
NiceAddress from,
StunMessage *msg);
#endif /*_NICE_CONNCHECK_H */
This diff is collapsed.
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2007 Nokia Corporation. All rights reserved.
* Contact: Kai Vehmanen
*
* 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:
* Kai Vehmanen, Nokia
*
* 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_DISCOVERY_H
#define _NICE_DISCOVERY_H
/* note: this is a private header to libnice */
#include "stun/bind.h"
#include "agent.h"
typedef struct _CandidateDiscovery CandidateDiscovery;
struct _CandidateDiscovery
{
NiceAgent *agent; /**< back pointer to owner */
NiceCandidateType type; /**< candidate type STUN or TURN */
guint socket; /**< XXX: should be taken from local cand: existing socket to use */
NiceUDPSocket *nicesock; /**< XXX: should be taken from local cand: existing socket to use */
const gchar *server_addr; /**< STUN/TURN server address, not owned */
NiceAddress *interface; /**< Address of local interface */
stun_bind_t *stun_ctx;
GTimeVal next_tick; /**< next tick timestamp */
gboolean pending; /**< is discovery in progress? */
gboolean done; /**< is discovery complete? */
Stream *stream;
Component *component;
};
void discovery_free_item (gpointer data, gpointer user_data);
void discovery_free (NiceAgent *agent);
gboolean discovery_prune_stream (NiceAgent *agent, guint stream_id);
void discovery_schedule (NiceAgent *agent);
NiceCandidate *discovery_add_local_host_candidate (
NiceAgent *agent,
guint stream_id,
guint component_id,
NiceAddress *address);
NiceCandidate*
discovery_add_server_reflexive_candidate (
NiceAgent *agent,
guint stream_id,
guint component_id,
NiceAddress *address,
NiceUDPSocket *base_socket);
#endif /*_NICE_CONNCHECK_H */
......@@ -35,6 +35,8 @@
* file under either the MPL or the LGPL.
*/
#include <string.h>
#include "stream.h"
Stream *
......@@ -44,6 +46,9 @@ stream_new (void)
stream = g_slice_new0 (Stream);
stream->component = component_new (COMPONENT_TYPE_RTP);
stream->n_components = 1;
stream->initial_binding_request_received = FALSE;
return stream;
}
......
......@@ -44,13 +44,24 @@
G_BEGIN_DECLS
/* Following do not including the terminating NULL */
#define NICE_STREAM_MAX_UFRAG_LEN 4
#define NICE_STREAM_MAX_PWD_LEN 22
typedef struct _Stream Stream;
struct _Stream
{
guint id;
guint n_components;
gboolean initial_binding_request_received;
/* XXX: streams can have multiple components */
Component *component;
gchar local_ufrag[NICE_STREAM_MAX_UFRAG_LEN + 1];
gchar local_password[NICE_STREAM_MAX_PWD_LEN + 1];
gchar remote_ufrag[NICE_STREAM_MAX_UFRAG_LEN + 1];
gchar remote_password[NICE_STREAM_MAX_PWD_LEN + 1];
};
Stream *
......
......@@ -36,15 +36,18 @@
*/
#include "agent.h"
#include "agent-priv.h"
#include "udp-fake.h"
#include <string.h>
int
main (void)
{
NiceAgent *agent;
NiceAddress addr = {0,};
NiceAddress addr;
NiceUDPSocketFactory factory;
memset (&addr, 0, sizeof (addr));
g_type_init ();
nice_udp_fake_socket_factory_init (&factory);
......
This diff is collapsed.
......@@ -23,6 +23,7 @@
*
* Contributors:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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
......@@ -63,9 +64,10 @@ int
main (void)
{
NiceAgent *agent;
NiceAddress addr = {0,};
NiceAddress addr;
NiceUDPSocketFactory factory;
memset (&addr, 0, sizeof (addr));
g_type_init ();
nice_udp_fake_socket_factory_init (&factory);
......@@ -83,7 +85,7 @@ main (void)
candidates = nice_agent_get_local_candidates (agent, 1, 1);
candidate = candidates->data;
sock = &candidate->sock;
sock = candidate->sockptr;
g_slist_free (candidates);
nice_udp_fake_socket_push_recv (sock, &addr, 6, "\x80hello");
......
......@@ -23,6 +23,7 @@
*
* Contributors:
* Dafydd Harries, Collabora Ltd.
* Kai Vehmanen, Nokia
*
* 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
......@@ -66,13 +67,14 @@ int
main (void)
{
NiceAgent *agent;
NiceAddress addr = {0,};
NiceAddress addr;
NiceUDPSocketFactory factory;
NiceUDPSocket *sock;
gint pipe_fds[2];
GSList *fds = NULL;