Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
3d507cae
Commit
3d507cae
authored
Jan 12, 2010
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nice_agent_new_reliable to the libnice API which uses pseudotcp
parent
d3278562
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
344 additions
and
33 deletions
+344
-33
agent/agent-priv.h
agent/agent-priv.h
+1
-0
agent/agent-signals-marshal.list
agent/agent-signals-marshal.list
+2
-0
agent/agent.c
agent/agent.c
+302
-22
agent/agent.h
agent/agent.h
+15
-0
agent/component.c
agent/component.c
+6
-5
agent/component.h
agent/component.h
+14
-4
agent/stream.h
agent/stream.h
+3
-2
docs/reference/libnice/libnice-sections.txt
docs/reference/libnice/libnice-sections.txt
+1
-0
No files found.
agent/agent-priv.h
View file @
3d507cae
...
@@ -120,6 +120,7 @@ struct _NiceAgent
...
@@ -120,6 +120,7 @@ struct _NiceAgent
GSource
*
upnp_timer_source
;
/* source of upnp timeout timer */
GSource
*
upnp_timer_source
;
/* source of upnp timeout timer */
#endif
#endif
gchar
*
software_attribute
;
/* SOFTWARE attribute */
gchar
*
software_attribute
;
/* SOFTWARE attribute */
gboolean
reliable
;
/* property: reliable */
/* XXX: add pointer to internal data struct for ABI-safe extensions */
/* XXX: add pointer to internal data struct for ABI-safe extensions */
};
};
...
...
agent/agent-signals-marshal.list
View file @
3d507cae
...
@@ -7,4 +7,6 @@ VOID:UINT,UINT,STRING
...
@@ -7,4 +7,6 @@ VOID:UINT,UINT,STRING
# candidate-gathering-done
# candidate-gathering-done
# initial-binding-request-received
# initial-binding-request-received
VOID:UINT
VOID:UINT
# reliable-transport-writable
VOID:UINT,UINT
agent/agent.c
View file @
3d507cae
This diff is collapsed.
Click to expand it.
agent/agent.h
View file @
3d507cae
...
@@ -277,6 +277,21 @@ typedef void (*NiceAgentRecvFunc) (
...
@@ -277,6 +277,21 @@ typedef void (*NiceAgentRecvFunc) (
NiceAgent
*
NiceAgent
*
nice_agent_new
(
GMainContext
*
ctx
,
NiceCompatibility
compat
);
nice_agent_new
(
GMainContext
*
ctx
,
NiceCompatibility
compat
);
/**
* nice_agent_new_reliable:
* @ctx: The Glib Mainloop Context to use for timers
* @compat: The compatibility mode of the agent
*
* Create a new #NiceAgent in reliable mode, which uses #PseudoTcpSocket to
* assure reliability of the messages.
* The returned object must be freed with g_object_unref()
*
* Returns: The new agent GObject
*/
NiceAgent
*
nice_agent_new_reliable
(
GMainContext
*
ctx
,
NiceCompatibility
compat
);
/**
/**
* nice_agent_add_local_address:
* nice_agent_add_local_address:
* @agent: The #NiceAgent Object
* @agent: The #NiceAgent Object
...
...
agent/component.c
View file @
3d507cae
...
@@ -53,9 +53,7 @@
...
@@ -53,9 +53,7 @@
#include "agent-priv.h"
#include "agent-priv.h"
Component
*
Component
*
component_new
(
component_new
(
guint
id
)
G_GNUC_UNUSED
guint
id
)
{
{
Component
*
component
;
Component
*
component
;
...
@@ -63,6 +61,8 @@ component_new (
...
@@ -63,6 +61,8 @@ component_new (
component
->
id
=
id
;
component
->
id
=
id
;
component
->
state
=
NICE_COMPONENT_STATE_DISCONNECTED
;
component
->
state
=
NICE_COMPONENT_STATE_DISCONNECTED
;
component
->
restart_candidate
=
NULL
;
component
->
restart_candidate
=
NULL
;
component
->
tcp
=
NULL
;
return
component
;
return
component
;
}
}
...
@@ -213,8 +213,9 @@ void component_update_selected_pair (Component *component, const CandidatePair *
...
@@ -213,8 +213,9 @@ void component_update_selected_pair (Component *component, const CandidatePair *
{
{
g_assert
(
component
);
g_assert
(
component
);
g_assert
(
pair
);
g_assert
(
pair
);
nice_debug
(
"setting SELECTED PAIR for component %u: %s:%s (prio:%lu)."
,
nice_debug
(
"setting SELECTED PAIR for component %u: %s:%s (prio:%"
component
->
id
,
pair
->
local
->
foundation
,
pair
->
remote
->
foundation
,
(
long
unsigned
)
pair
->
priority
);
G_GUINT64_FORMAT
")."
,
component
->
id
,
pair
->
local
->
foundation
,
pair
->
remote
->
foundation
,
pair
->
priority
);
if
(
component
->
selected_pair
.
keepalive
.
tick_source
!=
NULL
)
{
if
(
component
->
selected_pair
.
keepalive
.
tick_source
!=
NULL
)
{
g_source_destroy
(
component
->
selected_pair
.
keepalive
.
tick_source
);
g_source_destroy
(
component
->
selected_pair
.
keepalive
.
tick_source
);
...
...
agent/component.h
View file @
3d507cae
...
@@ -41,10 +41,14 @@
...
@@ -41,10 +41,14 @@
#include <glib.h>
#include <glib.h>
typedef
struct
_Component
Component
;
#include "agent.h"
#include "agent.h"
#include "candidate.h"
#include "candidate.h"
#include "stun/stunagent.h"
#include "stun/stunagent.h"
#include "stun/usages/timer.h"
#include "stun/usages/timer.h"
#include "pseudotcp.h"
#include "stream.h"
G_BEGIN_DECLS
G_BEGIN_DECLS
...
@@ -55,7 +59,6 @@ G_BEGIN_DECLS
...
@@ -55,7 +59,6 @@ G_BEGIN_DECLS
* would end up with 2*K host candidates if an agent has K interfaces.""
* would end up with 2*K host candidates if an agent has K interfaces.""
*/
*/
typedef
struct
_Component
Component
;
typedef
struct
_CandidatePair
CandidatePair
;
typedef
struct
_CandidatePair
CandidatePair
;
typedef
struct
_CandidatePairKeepalive
CandidatePairKeepalive
;
typedef
struct
_CandidatePairKeepalive
CandidatePairKeepalive
;
typedef
struct
_IncomingCheck
IncomingCheck
;
typedef
struct
_IncomingCheck
IncomingCheck
;
...
@@ -89,6 +92,12 @@ struct _IncomingCheck
...
@@ -89,6 +92,12 @@ struct _IncomingCheck
uint16_t
username_len
;
uint16_t
username_len
;
};
};
typedef
struct
{
NiceAgent
*
agent
;
Stream
*
stream
;
Component
*
component
;
}
TcpUserData
;
struct
_Component
struct
_Component
{
{
NiceComponentType
type
;
NiceComponentType
type
;
...
@@ -107,12 +116,13 @@ struct _Component
...
@@ -107,12 +116,13 @@ struct _Component
gpointer
data
;
/**< data passed to the io function */
gpointer
data
;
/**< data passed to the io function */
GMainContext
*
ctx
;
/**< context for data callbacks for this
GMainContext
*
ctx
;
/**< context for data callbacks for this
component */
component */
PseudoTcpSocket
*
tcp
;
GSource
*
tcp_clock
;
TcpUserData
*
tcp_data
;
};
};
Component
*
Component
*
component_new
(
component_new
(
guint
component_id
);
G_GNUC_UNUSED
guint
component_id
);
void
void
component_free
(
Component
*
cmp
);
component_free
(
Component
*
cmp
);
...
...
agent/stream.h
View file @
3d507cae
...
@@ -40,6 +40,8 @@
...
@@ -40,6 +40,8 @@
#include <glib.h>
#include <glib.h>
typedef
struct
_Stream
Stream
;
#include "component.h"
#include "component.h"
#include "random.h"
#include "random.h"
...
@@ -68,8 +70,6 @@ typedef enum
...
@@ -68,8 +70,6 @@ typedef enum
}
NiceCheckListState
;
}
NiceCheckListState
;
typedef
struct
_Stream
Stream
;
struct
_Stream
struct
_Stream
{
{
guint
id
;
guint
id
;
...
@@ -86,6 +86,7 @@ struct _Stream
...
@@ -86,6 +86,7 @@ struct _Stream
gint
tos
;
gint
tos
;
};
};
Stream
*
Stream
*
stream_new
(
guint
n_components
);
stream_new
(
guint
n_components
);
...
...
docs/reference/libnice/libnice-sections.txt
View file @
3d507cae
...
@@ -9,6 +9,7 @@ NiceCompatibility
...
@@ -9,6 +9,7 @@ NiceCompatibility
NiceAgentRecvFunc
NiceAgentRecvFunc
NICE_AGENT_MAX_REMOTE_CANDIDATES
NICE_AGENT_MAX_REMOTE_CANDIDATES
nice_agent_new
nice_agent_new
nice_agent_new_reliable
nice_agent_add_local_address
nice_agent_add_local_address
nice_agent_add_stream
nice_agent_add_stream
nice_agent_remove_stream
nice_agent_remove_stream
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment