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
11073352
Commit
11073352
authored
Nov 04, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a nice_agent_set_software API
parent
27c22fb8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
agent/agent-priv.h
agent/agent-priv.h
+1
-0
agent/agent.c
agent/agent.c
+17
-0
agent/agent.h
agent/agent.h
+26
-0
No files found.
agent/agent-priv.h
View file @
11073352
...
@@ -119,6 +119,7 @@ struct _NiceAgent
...
@@ -119,6 +119,7 @@ struct _NiceAgent
GSList
*
upnp_mapping
;
/* list of Candidates being mapped */
GSList
*
upnp_mapping
;
/* list of Candidates being mapped */
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 */
/* XXX: add pointer to internal data struct for ABI-safe extensions */
/* XXX: add pointer to internal data struct for ABI-safe extensions */
};
};
...
...
agent/agent.c
View file @
11073352
...
@@ -553,6 +553,7 @@ nice_agent_init (NiceAgent *agent)
...
@@ -553,6 +553,7 @@ nice_agent_init (NiceAgent *agent)
agent
->
keepalive_timer_source
=
NULL
;
agent
->
keepalive_timer_source
=
NULL
;
agent
->
refresh_list
=
NULL
;
agent
->
refresh_list
=
NULL
;
agent
->
media_after_tick
=
FALSE
;
agent
->
media_after_tick
=
FALSE
;
agent
->
software_attribute
=
NULL
;
agent
->
compatibility
=
NICE_COMPATIBILITY_DRAFT19
;
agent
->
compatibility
=
NICE_COMPATIBILITY_DRAFT19
;
...
@@ -702,6 +703,7 @@ nice_agent_set_property (
...
@@ -702,6 +703,7 @@ nice_agent_set_property (
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
|
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_AGENT_USAGE_USE_FINGERPRINT
);
}
}
stun_agent_set_software
(
&
agent
->
stun_agent
,
agent
->
software_attribute
);
break
;
break
;
...
@@ -1055,6 +1057,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
...
@@ -1055,6 +1057,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
STUN_AGENT_USAGE_ADD_SOFTWARE
|
STUN_AGENT_USAGE_ADD_SOFTWARE
|
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
);
}
}
stun_agent_set_software
(
&
cdisco
->
stun_agent
,
agent
->
software_attribute
);
nice_debug
(
"Agent %p : Adding new relay-rflx candidate discovery %p
\n
"
,
nice_debug
(
"Agent %p : Adding new relay-rflx candidate discovery %p
\n
"
,
agent
,
cdisco
);
agent
,
cdisco
);
...
@@ -2369,3 +2372,17 @@ void nice_agent_set_stream_tos (NiceAgent *agent,
...
@@ -2369,3 +2372,17 @@ void nice_agent_set_stream_tos (NiceAgent *agent,
agent_unlock
();
agent_unlock
();
}
}
void
nice_agent_set_software
(
NiceAgent
*
agent
,
gchar
*
software
)
{
agent_lock
();
g_free
(
agent
->
software_attribute
);
if
(
software
)
agent
->
software_attribute
=
g_strdup_printf
(
"%s/%s"
,
software
,
PACKAGE_STRING
);
stun_agent_set_software
(
&
agent
->
stun_agent
,
agent
->
software_attribute
);
agent_unlock
();
}
agent/agent.h
View file @
11073352
...
@@ -636,6 +636,32 @@ void nice_agent_set_stream_tos (
...
@@ -636,6 +636,32 @@ void nice_agent_set_stream_tos (
gint
tos
);
gint
tos
);
/**
* nice_agent_set_software:
* @agent: The #NiceAgent Object
* @software: The value of the SOFTWARE attribute to add.
*
* This function will set the value of the SOFTWARE attribute to be added to
* STUN requests, responses and error responses sent during connectivity checks.
* <para>
* The SOFTWARE attribute will only be added in the #NICE_COMPATIBILITY_DRAFT19
* and #NICE_COMPATIBILITY_WLM2009 compatibility modes.
* </para>
* <note>
<para>
The @software argument will be appended with the libnice version before
being sent.
</para>
<para>
The @software argument must be in UTF-8 encoding and only the first
128 characters will be sent.
</para>
</note>
*
*/
void
nice_agent_set_software
(
NiceAgent
*
agent
,
gchar
*
software
);
G_END_DECLS
G_END_DECLS
#endif
/* _AGENT_H */
#endif
/* _AGENT_H */
...
...
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