| agent.h | | agent.h | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| * not delete the provisions above, a recipient may use your version of thi
s | | * not delete the provisions above, a recipient may use your version of thi
s | |
| * file under either the MPL or the LGPL. | | * file under either the MPL or the LGPL. | |
| */ | | */ | |
| | | | |
| #ifndef _AGENT_H | | #ifndef _AGENT_H | |
| #define _AGENT_H | | #define _AGENT_H | |
| | | | |
| /** | | /** | |
| * SECTION:agent | | * SECTION:agent | |
| * @short_description: ICE agent API implementation | | * @short_description: ICE agent API implementation | |
|
| * @see_also: #NiceCandidate | | * @see_also: #NiceCandidate, #NiceAddress | |
| * @see_also: #NiceAddress | | | |
| * @include: agent.h | | * @include: agent.h | |
| * @stability: Stable | | * @stability: Stable | |
| * | | * | |
| * The #NiceAgent is your main object when using libnice. | | * The #NiceAgent is your main object when using libnice. | |
| * It is the agent that will take care of everything relating to ICE. | | * It is the agent that will take care of everything relating to ICE. | |
| * It will take care of discovering your local candidates and do | | * It will take care of discovering your local candidates and do | |
| * connectivity checks to create a stream of data between you and your pee
r. | | * connectivity checks to create a stream of data between you and your pee
r. | |
| * | | * | |
| * Streams and their components are referenced by integer IDs (with respect
to a | | * Streams and their components are referenced by integer IDs (with respect
to a | |
| * given #NiceAgent). These IDs are guaranteed to be positive (i.e. non-zer
o) | | * given #NiceAgent). These IDs are guaranteed to be positive (i.e. non-zer
o) | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 71 | |
| * #NiceInputStream and #NiceIOStream classes accessible using | | * #NiceInputStream and #NiceIOStream classes accessible using | |
| * nice_agent_get_io_stream()). nice_agent_attach_recv() is non-blocking: i
t | | * nice_agent_get_io_stream()). nice_agent_attach_recv() is non-blocking: i
t | |
| * takes a user-provided callback function and attaches the stream’s sock
et to | | * takes a user-provided callback function and attaches the stream’s sock
et to | |
| * the provided #GMainContext, invoking the callback in that context for ev
ery | | * the provided #GMainContext, invoking the callback in that context for ev
ery | |
| * packet received. nice_agent_recv_messages() instead blocks on receiving
a | | * packet received. nice_agent_recv_messages() instead blocks on receiving
a | |
| * packet, and writes it directly into a user-provided buffer. This reduces
the | | * packet, and writes it directly into a user-provided buffer. This reduces
the | |
| * number of callback invokations and (potentially) buffer copies required
to | | * number of callback invokations and (potentially) buffer copies required
to | |
| * receive packets. nice_agent_recv_messages() (or #NiceInputStream) is des
igned | | * receive packets. nice_agent_recv_messages() (or #NiceInputStream) is des
igned | |
| * to be used in a blocking loop in a separate thread. | | * to be used in a blocking loop in a separate thread. | |
| * | | * | |
|
| <example> | | * <example> | |
| <title>Simple example on how to use libnice</title> | | * <title>Simple example on how to use libnice</title> | |
| <programlisting> | | * <programlisting> | |
| guint stream_id; | | * guint stream_id; | |
| gchar buffer[] = "hello world!"; | | * gchar buffer[] = "hello world!"; | |
| GSList *lcands = NULL; | | * GSList *lcands = NULL; | |
| | | * | |
| // Create a nice agent | | * // Create a nice agent | |
| NiceAgent *agent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245); | | * NiceAgent *agent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245); | |
| | | * | |
| // Connect the signals | | * // Connect the signals | |
| g_signal_connect (G_OBJECT (agent), "candidate-gathering-done", | | * g_signal_connect (G_OBJECT (agent), "candidate-gathering-done", | |
| G_CALLBACK (cb_candidate_gathering_done), NULL); | | * G_CALLBACK (cb_candidate_gathering_done), NULL); | |
| g_signal_connect (G_OBJECT (agent), "component-state-changed", | | * g_signal_connect (G_OBJECT (agent), "component-state-changed", | |
| G_CALLBACK (cb_component_state_changed), NULL); | | * G_CALLBACK (cb_component_state_changed), NULL); | |
| g_signal_connect (G_OBJECT (agent), "new-selected-pair", | | * g_signal_connect (G_OBJECT (agent), "new-selected-pair", | |
| G_CALLBACK (cb_new_selected_pair), NULL); | | * G_CALLBACK (cb_new_selected_pair), NULL); | |
| | | * | |
| // Create a new stream with one component and start gathering candidates | | * // Create a new stream with one component and start gathering candidat | |
| stream_id = nice_agent_add_stream (agent, 1); | | es | |
| nice_agent_gather_candidates (agent, stream_id); | | * stream_id = nice_agent_add_stream (agent, 1); | |
| | | * nice_agent_gather_candidates (agent, stream_id); | |
| // Attach to the component to receive the data | | * | |
| nice_agent_attach_recv (agent, stream_id, 1, NULL, | | * // Attach to the component to receive the data | |
| cb_nice_recv, NULL); | | * nice_agent_attach_recv (agent, stream_id, 1, NULL, | |
| | | * cb_nice_recv, NULL); | |
| // ... Wait until the signal candidate-gathering-done is fired ... | | * | |
| lcands = nice_agent_get_local_candidates(agent, stream_id, 1); | | * // ... Wait until the signal candidate-gathering-done is fired ... | |
| | | * lcands = nice_agent_get_local_candidates(agent, stream_id, 1); | |
| // ... Send local candidates to the peer and set the peer's remote candi | | * | |
| dates | | * // ... Send local candidates to the peer and set the peer's remote can | |
| nice_agent_set_remote_candidates (agent, stream_id, 1, rcands); | | didates | |
| | | * nice_agent_set_remote_candidates (agent, stream_id, 1, rcands); | |
| // ... Wait until the signal new-selected-pair is fired ... | | * | |
| // Send our message! | | * // ... Wait until the signal new-selected-pair is fired ... | |
| nice_agent_send (agent, stream_id, 1, sizeof(buffer), buffer); | | * // Send our message! | |
| | | * nice_agent_send (agent, stream_id, 1, sizeof(buffer), buffer); | |
| // Anything received will be received through the cb_nice_recv callback | | * | |
| | | * // Anything received will be received through the cb_nice_recv callbac | |
| // Destroy the object | | k | |
| g_object_unref(agent); | | * | |
| | | * // Destroy the object | |
| </programlisting> | | * g_object_unref(agent); | |
| </example> | | * | |
| | | * </programlisting> | |
| | | * </example> | |
| * | | * | |
| * Refer to the examples in the examples/ subdirectory of the libnice sourc
e for | | * Refer to the examples in the examples/ subdirectory of the libnice sourc
e for | |
|
| * complete examples. | | * more complete examples. | |
| * | | * | |
| */ | | */ | |
| | | | |
| #include <glib-object.h> | | #include <glib-object.h> | |
| #include <gio/gio.h> | | #include <gio/gio.h> | |
| | | | |
| /** | | /** | |
| * NiceAgent: | | * NiceAgent: | |
| * | | * | |
| * The #NiceAgent is the main GObject of the libnice library and represents | | * The #NiceAgent is the main GObject of the libnice library and represents | |
| | | | |
| skipping to change at line 287 | | skipping to change at line 286 | |
| </example> | | </example> | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| NICE_COMPONENT_TYPE_RTP = 1, | | NICE_COMPONENT_TYPE_RTP = 1, | |
| NICE_COMPONENT_TYPE_RTCP = 2 | | NICE_COMPONENT_TYPE_RTCP = 2 | |
| } NiceComponentType; | | } NiceComponentType; | |
| | | | |
| /** | | /** | |
| * NiceCompatibility: | | * NiceCompatibility: | |
|
| * @NICE_COMPATIBILITY_RFC5245: Use compatibility with the RFC5245 ICE spec | | * @NICE_COMPATIBILITY_RFC5245: Use compatibility with the RFC5245 ICE-UDP | |
| s | | specs | |
| | | * and RFC6544 ICE-TCP specs | |
| * @NICE_COMPATIBILITY_GOOGLE: Use compatibility for Google Talk specs | | * @NICE_COMPATIBILITY_GOOGLE: Use compatibility for Google Talk specs | |
| * @NICE_COMPATIBILITY_MSN: Use compatibility for MSN Messenger specs | | * @NICE_COMPATIBILITY_MSN: Use compatibility for MSN Messenger specs | |
| * @NICE_COMPATIBILITY_WLM2009: Use compatibility with Windows Live Messeng
er | | * @NICE_COMPATIBILITY_WLM2009: Use compatibility with Windows Live Messeng
er | |
| * 2009 | | * 2009 | |
| * @NICE_COMPATIBILITY_OC2007: Use compatibility with Microsoft Office Comm
unicator 2007 | | * @NICE_COMPATIBILITY_OC2007: Use compatibility with Microsoft Office Comm
unicator 2007 | |
| * @NICE_COMPATIBILITY_OC2007R2: Use compatibility with Microsoft Office Co
mmunicator 2007 R2 | | * @NICE_COMPATIBILITY_OC2007R2: Use compatibility with Microsoft Office Co
mmunicator 2007 R2 | |
| * @NICE_COMPATIBILITY_DRAFT19: Use compatibility for ICE Draft 19 specs | | * @NICE_COMPATIBILITY_DRAFT19: Use compatibility for ICE Draft 19 specs | |
| * @NICE_COMPATIBILITY_LAST: Dummy last compatibility mode | | * @NICE_COMPATIBILITY_LAST: Dummy last compatibility mode | |
| * | | * | |
| * An enum to specify which compatible specifications the #NiceAgent should
use. | | * An enum to specify which compatible specifications the #NiceAgent should
use. | |
| * Use with nice_agent_new() | | * Use with nice_agent_new() | |
| * | | * | |
| * <warning>@NICE_COMPATIBILITY_DRAFT19 is deprecated and should not be use
d | | * <warning>@NICE_COMPATIBILITY_DRAFT19 is deprecated and should not be use
d | |
| * in newly-written code. It is kept for compatibility reasons and | | * in newly-written code. It is kept for compatibility reasons and | |
| * represents the same compatibility as @NICE_COMPATIBILITY_RFC5245 </warni
ng> | | * represents the same compatibility as @NICE_COMPATIBILITY_RFC5245 </warni
ng> | |
|
| | | <note> | |
| | | <para> | |
| | | If @NICE_COMPATIBILITY_RFC5245 compatibility mode is used for a non-reli | |
| | | able | |
| | | agent, then ICE-UDP will be used with higher priority and ICE-TCP will a | |
| | | lso | |
| | | be used when the UDP connectivity fails. If it is used with a reliable a | |
| | | gent, | |
| | | then ICE-UDP will be used with the TCP-Over-UDP (#PseudoTcpSocket) if IC | |
| | | E-TCP | |
| | | fails and ICE-UDP succeeds. | |
| | | </para> | |
| | | </note> | |
| | | * | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| NICE_COMPATIBILITY_RFC5245 = 0, | | NICE_COMPATIBILITY_RFC5245 = 0, | |
|
| | | NICE_COMPATIBILITY_DRAFT19 = NICE_COMPATIBILITY_RFC5245, | |
| NICE_COMPATIBILITY_GOOGLE, | | NICE_COMPATIBILITY_GOOGLE, | |
| NICE_COMPATIBILITY_MSN, | | NICE_COMPATIBILITY_MSN, | |
| NICE_COMPATIBILITY_WLM2009, | | NICE_COMPATIBILITY_WLM2009, | |
| NICE_COMPATIBILITY_OC2007, | | NICE_COMPATIBILITY_OC2007, | |
| NICE_COMPATIBILITY_OC2007R2, | | NICE_COMPATIBILITY_OC2007R2, | |
|
| NICE_COMPATIBILITY_DRAFT19 = NICE_COMPATIBILITY_RFC5245, | | | |
| NICE_COMPATIBILITY_LAST = NICE_COMPATIBILITY_OC2007R2, | | NICE_COMPATIBILITY_LAST = NICE_COMPATIBILITY_OC2007R2, | |
| } NiceCompatibility; | | } NiceCompatibility; | |
| | | | |
| /** | | /** | |
| * NiceProxyType: | | * NiceProxyType: | |
| * @NICE_PROXY_TYPE_NONE: Do not use a proxy | | * @NICE_PROXY_TYPE_NONE: Do not use a proxy | |
| * @NICE_PROXY_TYPE_SOCKS5: Use a SOCKS5 proxy | | * @NICE_PROXY_TYPE_SOCKS5: Use a SOCKS5 proxy | |
| * @NICE_PROXY_TYPE_HTTP: Use an HTTP proxy | | * @NICE_PROXY_TYPE_HTTP: Use an HTTP proxy | |
| * @NICE_PROXY_TYPE_LAST: Dummy last proxy type | | * @NICE_PROXY_TYPE_LAST: Dummy last proxy type | |
| * | | * | |
| | | | |
| skipping to change at line 372 | | skipping to change at line 382 | |
| * Returns: The new agent GObject | | * Returns: The new agent GObject | |
| */ | | */ | |
| NiceAgent * | | NiceAgent * | |
| nice_agent_new (GMainContext *ctx, NiceCompatibility compat); | | nice_agent_new (GMainContext *ctx, NiceCompatibility compat); | |
| | | | |
| /** | | /** | |
| * nice_agent_new_reliable: | | * nice_agent_new_reliable: | |
| * @ctx: The Glib Mainloop Context to use for timers | | * @ctx: The Glib Mainloop Context to use for timers | |
| * @compat: The compatibility mode of the agent | | * @compat: The compatibility mode of the agent | |
| * | | * | |
|
| * Create a new #NiceAgent in reliable mode, which uses #PseudoTcpSocket to | | * Create a new #NiceAgent in reliable mode. If the connectivity is establi | |
| * assure reliability of the messages. | | shed | |
| | | * through ICE-UDP, then a #PseudoTcpSocket will be transparently used to | |
| | | * ensure reliability of the messages. | |
| * The returned object must be freed with g_object_unref() | | * The returned object must be freed with g_object_unref() | |
| * <para> See also: #NiceAgent::reliable-transport-writable </para> | | * <para> See also: #NiceAgent::reliable-transport-writable </para> | |
| * | | * | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| * | | * | |
| * Returns: The new agent GObject | | * Returns: The new agent GObject | |
| */ | | */ | |
| NiceAgent * | | NiceAgent * | |
| nice_agent_new_reliable (GMainContext *ctx, NiceCompatibility compat); | | nice_agent_new_reliable (GMainContext *ctx, NiceCompatibility compat); | |
| | | | |
| | | | |
| skipping to change at line 423 | | skipping to change at line 434 | |
| guint | | guint | |
| nice_agent_add_stream ( | | nice_agent_add_stream ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint n_components); | | guint n_components); | |
| | | | |
| /** | | /** | |
| * nice_agent_remove_stream: | | * nice_agent_remove_stream: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| * @stream_id: The ID of the stream to remove | | * @stream_id: The ID of the stream to remove | |
| * | | * | |
|
| * Remove and free a previously created data stream from @agent | | * Remove and free a previously created data stream from @agent. If any I/O | |
| | | * streams have been created using nice_agent_get_io_stream(), they should | |
| | | be | |
| | | * closed completely using g_io_stream_close() before this is called, or th | |
| | | ey | |
| | | * will get broken pipe errors. | |
| * | | * | |
| **/ | | **/ | |
| void | | void | |
| nice_agent_remove_stream ( | | nice_agent_remove_stream ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id); | | guint stream_id); | |
| | | | |
| /** | | /** | |
| * nice_agent_set_port_range: | | * nice_agent_set_port_range: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| | | | |
| skipping to change at line 574 | | skipping to change at line 588 | |
| nice_agent_get_local_credentials ( | | nice_agent_get_local_credentials ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| gchar **ufrag, gchar **pwd); | | gchar **ufrag, gchar **pwd); | |
| | | | |
| /** | | /** | |
| * nice_agent_set_remote_candidates: | | * nice_agent_set_remote_candidates: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| * @stream_id: The ID of the stream the candidates are for | | * @stream_id: The ID of the stream the candidates are for | |
| * @component_id: The ID of the component the candidates are for | | * @component_id: The ID of the component the candidates are for | |
|
| * @candidates: a #GSList of #NiceCandidate items describing each candidate | | * @candidates: (element-type NiceCandidate) (transfer none): a #GSList of | |
| to add | | * #NiceCandidate items describing each candidate to add | |
| * | | * | |
| * Sets, adds or updates the remote candidates for a component of a stream. | | * Sets, adds or updates the remote candidates for a component of a stream. | |
| * | | * | |
| <note> | | <note> | |
| <para> | | <para> | |
| NICE_AGENT_MAX_REMOTE_CANDIDATES is the absolute maximum limit | | NICE_AGENT_MAX_REMOTE_CANDIDATES is the absolute maximum limit | |
| for remote candidates. | | for remote candidates. | |
| </para> | | </para> | |
| <para> | | <para> | |
| You must first call nice_agent_gather_candidates() and wait for the | | You must first call nice_agent_gather_candidates() and wait for the | |
| | | | |
| skipping to change at line 709 | | skipping to change at line 724 | |
| guint n_messages, | | guint n_messages, | |
| GCancellable *cancellable, | | GCancellable *cancellable, | |
| GError **error); | | GError **error); | |
| | | | |
| /** | | /** | |
| * nice_agent_get_local_candidates: | | * nice_agent_get_local_candidates: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| * @stream_id: The ID of the stream | | * @stream_id: The ID of the stream | |
| * @component_id: The ID of the component | | * @component_id: The ID of the component | |
| * | | * | |
|
| * Retreive from the agent the list of all local candidates | | * Retrieve from the agent the list of all local candidates | |
| * for a stream's component | | * for a stream's component | |
| * | | * | |
| <note> | | <note> | |
| <para> | | <para> | |
| The caller owns the returned GSList as well as the candidates containe
d | | The caller owns the returned GSList as well as the candidates containe
d | |
| within it. | | within it. | |
| To get full results, the client should wait for the | | To get full results, the client should wait for the | |
| #NiceAgent::candidate-gathering-done signal. | | #NiceAgent::candidate-gathering-done signal. | |
| </para> | | </para> | |
| </note> | | </note> | |
| * | | * | |
|
| * Returns: a #GSList of #NiceCandidate objects representing | | * Returns: (element-type NiceCandidate) (transfer full): a #GSList of | |
| * the local candidates of @agent | | * #NiceCandidate objects representing the local candidates of @agent | |
| **/ | | **/ | |
| GSList * | | GSList * | |
| nice_agent_get_local_candidates ( | | nice_agent_get_local_candidates ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id); | | guint component_id); | |
| | | | |
| /** | | /** | |
| * nice_agent_get_remote_candidates: | | * nice_agent_get_remote_candidates: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| | | | |
| skipping to change at line 750 | | skipping to change at line 765 | |
| The caller owns the returned GSList as well as the candidates containe
d | | The caller owns the returned GSList as well as the candidates containe
d | |
| within it. | | within it. | |
| </para> | | </para> | |
| <para> | | <para> | |
| The list of remote candidates can change during processing. | | The list of remote candidates can change during processing. | |
| The client should register for the #NiceAgent::new-remote-candidate si
gnal | | The client should register for the #NiceAgent::new-remote-candidate si
gnal | |
| to get notified of new remote candidates. | | to get notified of new remote candidates. | |
| </para> | | </para> | |
| </note> | | </note> | |
| * | | * | |
|
| * Returns: a #GSList of #NiceCandidates objects representing | | * Returns: (element-type NiceCandidate) (transfer full): a #GSList of | |
| * the remote candidates set on the @agent | | * #NiceCandidates objects representing the remote candidates set on the @a | |
| | | gent | |
| **/ | | **/ | |
| GSList * | | GSList * | |
| nice_agent_get_remote_candidates ( | | nice_agent_get_remote_candidates ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id); | | guint component_id); | |
| | | | |
| /** | | /** | |
| * nice_agent_restart: | | * nice_agent_restart: | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| | | | |
| skipping to change at line 797 | | skipping to change at line 812 | |
| * Returns: %TRUE on success %FALSE on error | | * Returns: %TRUE on success %FALSE on error | |
| * | | * | |
| * Since: 0.1.6 | | * Since: 0.1.6 | |
| **/ | | **/ | |
| gboolean | | gboolean | |
| nice_agent_restart_stream ( | | nice_agent_restart_stream ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id); | | guint stream_id); | |
| | | | |
| /** | | /** | |
|
| * nice_agent_attach_recv: | | * nice_agent_attach_recv: (skip) | |
| * @agent: The #NiceAgent Object | | * @agent: The #NiceAgent Object | |
| * @stream_id: The ID of stream | | * @stream_id: The ID of stream | |
| * @component_id: The ID of the component | | * @component_id: The ID of the component | |
| * @ctx: The Glib Mainloop Context to use for listening on the component | | * @ctx: The Glib Mainloop Context to use for listening on the component | |
| * @func: The callback function to be called when data is received on | | * @func: The callback function to be called when data is received on | |
| * the stream's component | | * the stream's component | |
| * @data: user data associated with the callback | | * @data: user data associated with the callback | |
| * | | * | |
| * Attaches the stream's component's sockets to the Glib Mainloop Context i
n | | * Attaches the stream's component's sockets to the Glib Mainloop Context i
n | |
| * order to be notified whenever data becomes available for a component. | | * order to be notified whenever data becomes available for a component. | |
| | | | |
| skipping to change at line 844 | | skipping to change at line 859 | |
| * @buf: (array length=buf_len) (out caller-allocates): caller-allocated bu
ffer | | * @buf: (array length=buf_len) (out caller-allocates): caller-allocated bu
ffer | |
| * to write the received data into, of length at least @buf_len | | * to write the received data into, of length at least @buf_len | |
| * @buf_len: length of @buf | | * @buf_len: length of @buf | |
| * @cancellable: (allow-none): a #GCancellable to allow the operation to be | | * @cancellable: (allow-none): a #GCancellable to allow the operation to be | |
| * cancelled from another thread, or %NULL | | * cancelled from another thread, or %NULL | |
| * @error: (allow-none): return location for a #GError, or %NULL | | * @error: (allow-none): return location for a #GError, or %NULL | |
| * | | * | |
| * A single-message version of nice_agent_recv_messages(). | | * A single-message version of nice_agent_recv_messages(). | |
| * | | * | |
| * Returns: the number of bytes written to @buf on success (guaranteed to b
e | | * Returns: the number of bytes written to @buf on success (guaranteed to b
e | |
|
| * greater than 0 unless @buf_len is 0), or -1 on error | | * greater than 0 unless @buf_len is 0), 0 if in reliable mode and the remo | |
| | | te | |
| | | * peer closed the stream, or -1 on error | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| gssize | | gssize | |
| nice_agent_recv ( | | nice_agent_recv ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id, | | guint component_id, | |
| guint8 *buf, | | guint8 *buf, | |
| gsize buf_len, | | gsize buf_len, | |
| | | | |
| skipping to change at line 901 | | skipping to change at line 917 | |
| * | | * | |
| * This must not be used in combination with nice_agent_attach_recv() on th
e | | * This must not be used in combination with nice_agent_attach_recv() on th
e | |
| * same stream/component pair. | | * same stream/component pair. | |
| * | | * | |
| * If the stream/component pair doesn’t exist, or if a suitable candidate
socket | | * If the stream/component pair doesn’t exist, or if a suitable candidate
socket | |
| * hasn’t yet been selected for it, a %G_IO_ERROR_BROKEN_PIPE error will
be | | * hasn’t yet been selected for it, a %G_IO_ERROR_BROKEN_PIPE error will
be | |
| * returned. A %G_IO_ERROR_CANCELLED error will be returned if the operatio
n was | | * returned. A %G_IO_ERROR_CANCELLED error will be returned if the operatio
n was | |
| * cancelled. %G_IO_ERROR_FAILED will be returned for other errors. | | * cancelled. %G_IO_ERROR_FAILED will be returned for other errors. | |
| * | | * | |
| * Returns: the number of valid messages written to @messages on success | | * Returns: the number of valid messages written to @messages on success | |
|
| * (guaranteed to be greater than 0 unless @n_messages is 0), or -1 on erro | | * (guaranteed to be greater than 0 unless @n_messages is 0), 0 if the remo | |
| r | | te | |
| | | * peer closed the stream, or -1 on error | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| gint | | gint | |
| nice_agent_recv_messages ( | | nice_agent_recv_messages ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id, | | guint component_id, | |
| NiceInputMessage *messages, | | NiceInputMessage *messages, | |
| guint n_messages, | | guint n_messages, | |
| | | | |
| skipping to change at line 930 | | skipping to change at line 947 | |
| * @buf: (array length=buf_len) (out caller-allocates): caller-allocated bu
ffer | | * @buf: (array length=buf_len) (out caller-allocates): caller-allocated bu
ffer | |
| * to write the received data into, of length at least @buf_len | | * to write the received data into, of length at least @buf_len | |
| * @buf_len: length of @buf | | * @buf_len: length of @buf | |
| * @cancellable: (allow-none): a #GCancellable to allow the operation to be | | * @cancellable: (allow-none): a #GCancellable to allow the operation to be | |
| * cancelled from another thread, or %NULL | | * cancelled from another thread, or %NULL | |
| * @error: (allow-none): return location for a #GError, or %NULL | | * @error: (allow-none): return location for a #GError, or %NULL | |
| * | | * | |
| * A single-message version of nice_agent_recv_messages_nonblocking(). | | * A single-message version of nice_agent_recv_messages_nonblocking(). | |
| * | | * | |
| * Returns: the number of bytes received into @buf on success (guaranteed t
o be | | * Returns: the number of bytes received into @buf on success (guaranteed t
o be | |
|
| * greater than 0 unless @buf_len is 0), or -1 on error | | * greater than 0 unless @buf_len is 0), 0 if in reliable mode and the remo | |
| | | te | |
| | | * peer closed the stream, or -1 on error | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| gssize | | gssize | |
| nice_agent_recv_nonblocking ( | | nice_agent_recv_nonblocking ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id, | | guint component_id, | |
| guint8 *buf, | | guint8 *buf, | |
| gsize buf_len, | | gsize buf_len, | |
| | | | |
| skipping to change at line 979 | | skipping to change at line 997 | |
| * | | * | |
| * As this function is non-blocking, @cancellable is included only for pari
ty | | * As this function is non-blocking, @cancellable is included only for pari
ty | |
| * with nice_agent_recv_messages(). If @cancellable is cancelled before thi
s | | * with nice_agent_recv_messages(). If @cancellable is cancelled before thi
s | |
| * function is called, a %G_IO_ERROR_CANCELLED error will be returned | | * function is called, a %G_IO_ERROR_CANCELLED error will be returned | |
| * immediately. | | * immediately. | |
| * | | * | |
| * This must not be used in combination with nice_agent_attach_recv() on th
e | | * This must not be used in combination with nice_agent_attach_recv() on th
e | |
| * same stream/component pair. | | * same stream/component pair. | |
| * | | * | |
| * Returns: the number of valid messages written to @messages on success | | * Returns: the number of valid messages written to @messages on success | |
|
| * (guaranteed to be greater than 0 unless @n_messages is 0), or -1 on erro | | * (guaranteed to be greater than 0 unless @n_messages is 0), 0 if in relia | |
| r | | ble | |
| | | * mode and the remote peer closed the stream, or -1 on error | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| gint | | gint | |
| nice_agent_recv_messages_nonblocking ( | | nice_agent_recv_messages_nonblocking ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id, | | guint component_id, | |
| NiceInputMessage *messages, | | NiceInputMessage *messages, | |
| guint n_messages, | | guint n_messages, | |
| | | | |
| skipping to change at line 1057 | | skipping to change at line 1076 | |
| * This is useful for adding ICE support to legacy applications that alread
y | | * This is useful for adding ICE support to legacy applications that alread
y | |
| * have a protocol that maintains a connection. If the socket is duplicated | | * have a protocol that maintains a connection. If the socket is duplicated | |
| * before unrefing the agent, the application can take over and continue to
use | | * before unrefing the agent, the application can take over and continue to
use | |
| * it. New applications are encouraged to use the built in libnice stream | | * it. New applications are encouraged to use the built in libnice stream | |
| * handling instead and let libnice handle the connection maintenance. | | * handling instead and let libnice handle the connection maintenance. | |
| * | | * | |
| * Users of this method are encouraged to not use a TURN relay or any kind | | * Users of this method are encouraged to not use a TURN relay or any kind | |
| * of proxy, as in this case, the socket will not be available to the | | * of proxy, as in this case, the socket will not be available to the | |
| * application because the packets are encapsulated. | | * application because the packets are encapsulated. | |
| * | | * | |
|
| * Returns: (transfer full) pointer to the #GSocket, or NULL if there is no | | * Returns: (transfer full) (nullable): pointer to the #GSocket, or %NULL i | |
| * selected candidate or if the selected candidate is a relayed candidate. | | f | |
| | | * there is no selected candidate or if the selected candidate is a relayed | |
| | | * candidate. | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| GSocket * | | GSocket * | |
| nice_agent_get_selected_socket ( | | nice_agent_get_selected_socket ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id); | | guint component_id); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 1355 | | skipping to change at line 1375 | |
| * @pwd: Pointer to store the ice password if non %NULL. Must be freed with | | * @pwd: Pointer to store the ice password if non %NULL. Must be freed with | |
| * g_free() after use | | * g_free() after use | |
| * | | * | |
| * Parse an SDP string representing a single stream and extracts candidates | | * Parse an SDP string representing a single stream and extracts candidates | |
| * and credentials from it. | | * and credentials from it. | |
| * | | * | |
| * <para>See also: nice_agent_generate_local_stream_sdp() </para> | | * <para>See also: nice_agent_generate_local_stream_sdp() </para> | |
| * <para>See also: nice_agent_parse_remote_sdp() </para> | | * <para>See also: nice_agent_parse_remote_sdp() </para> | |
| * <para>See also: nice_agent_parse_remote_candidate_sdp() </para> | | * <para>See also: nice_agent_parse_remote_candidate_sdp() </para> | |
| * | | * | |
|
| * Returns: A #GSList of candidates parsed from the SDP, or %NULL in case o | | * Returns: (element-type NiceCandidate) (transfer full): A #GSList of | |
| f | | * candidates parsed from the SDP, or %NULL in case of errors | |
| * errors | | | |
| * | | * | |
| * Since: 0.1.4 | | * Since: 0.1.4 | |
| **/ | | **/ | |
| GSList * | | GSList * | |
| nice_agent_parse_remote_stream_sdp ( | | nice_agent_parse_remote_stream_sdp ( | |
| NiceAgent *agent, | | NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| const gchar *sdp, | | const gchar *sdp, | |
| gchar **ufrag, | | gchar **ufrag, | |
| gchar **pwd); | | gchar **pwd); | |
| | | | |
| skipping to change at line 1448 | | skipping to change at line 1468 | |
| * | | * | |
| * Returns: %FALSE if the component could not be found, %TRUE otherwise | | * Returns: %FALSE if the component could not be found, %TRUE otherwise | |
| * | | * | |
| * Since: 0.1.6 | | * Since: 0.1.6 | |
| */ | | */ | |
| gboolean | | gboolean | |
| nice_agent_forget_relays (NiceAgent *agent, | | nice_agent_forget_relays (NiceAgent *agent, | |
| guint stream_id, | | guint stream_id, | |
| guint component_id); | | guint component_id); | |
| | | | |
|
| | | /** | |
| | | * nice_agent_get_component_state: | |
| | | * @agent: The #NiceAgent Object | |
| | | * @stream_id: The ID of the stream | |
| | | * @component_id: The ID of the component | |
| | | * | |
| | | * Retrieves the current state of a component. | |
| | | * | |
| | | * Returns: the #NiceComponentState of the component and | |
| | | * %NICE_COMPONENT_STATE_FAILED if the component was invalid. | |
| | | * | |
| | | * Since: 0.1.8 | |
| | | */ | |
| | | NiceComponentState | |
| | | nice_agent_get_component_state (NiceAgent *agent, | |
| | | guint stream_id, | |
| | | guint component_id); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
| #endif /* _AGENT_H */ | | #endif /* _AGENT_H */ | |
| | | | |
End of changes. 21 change blocks. |
| 72 lines changed or deleted | | 121 lines changed or added | |
|
| candidate.h | | candidate.h | |
| | | | |
| skipping to change at line 43 | | skipping to change at line 43 | |
| * LGPL and not to allow others to use your version of this file under 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 | | * MPL, indicate your decision by deleting the provisions above and replace | |
| * them with the notice and other provisions required by the LGPL. If you d
o | | * them with the notice and other provisions required by the LGPL. If you d
o | |
| * not delete the provisions above, a recipient may use your version of thi
s | | * not delete the provisions above, a recipient may use your version of thi
s | |
| * file under either the MPL or the LGPL. | | * file under either the MPL or the LGPL. | |
| */ | | */ | |
| | | | |
| #ifndef _CANDIDATE_H | | #ifndef _CANDIDATE_H | |
| #define _CANDIDATE_H | | #define _CANDIDATE_H | |
| | | | |
|
| | | #include <glib.h> | |
| | | #include <glib-object.h> | |
| | | | |
| /** | | /** | |
| * SECTION:candidate | | * SECTION:candidate | |
| * @short_description: ICE candidate representation | | * @short_description: ICE candidate representation | |
| * @see_also: #NiceAddress | | * @see_also: #NiceAddress | |
| * @stability: Stable | | * @stability: Stable | |
| * | | * | |
| * A representation of an ICE candidate. Make sure you read the ICE drafts[
1] to | | * A representation of an ICE candidate. Make sure you read the ICE drafts[
1] to | |
| * understand correctly the concept of ICE candidates. | | * understand correctly the concept of ICE candidates. | |
| * | | * | |
| * [1] http://tools.ietf.org/wg/mmusic/draft-ietf-mmusic-ice/ | | * [1] http://tools.ietf.org/wg/mmusic/draft-ietf-mmusic-ice/ | |
| */ | | */ | |
| | | | |
| G_BEGIN_DECLS | | G_BEGIN_DECLS | |
| | | | |
|
| | | /* Constants for determining candidate priorities */ | |
| #define NICE_CANDIDATE_TYPE_PREF_HOST 120 | | #define NICE_CANDIDATE_TYPE_PREF_HOST 120 | |
| #define NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE 110 | | #define NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE 110 | |
|
| | | #define NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED 105 | |
| #define NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE 100 | | #define NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE 100 | |
|
| #define NICE_CANDIDATE_TYPE_PREF_RELAYED 60 | | #define NICE_CANDIDATE_TYPE_PREF_UDP_TUNNELED 75 | |
| | | #define NICE_CANDIDATE_TYPE_PREF_RELAYED 10 | |
| | | | |
| | | /* Priority preference constants for MS-ICE compatibility */ | |
| | | #define NICE_CANDIDATE_TRANSPORT_MS_PREF_UDP 15 | |
| | | #define NICE_CANDIDATE_TRANSPORT_MS_PREF_TCP 6 | |
| | | #define NICE_CANDIDATE_DIRECTION_MS_PREF_PASSIVE 2 | |
| | | #define NICE_CANDIDATE_DIRECTION_MS_PREF_ACTIVE 5 | |
| | | | |
| /* Max foundation size '1*32ice-char' plus terminating NULL, ICE ID-19 */ | | /* Max foundation size '1*32ice-char' plus terminating NULL, ICE ID-19 */ | |
| /** | | /** | |
| * NICE_CANDIDATE_MAX_FOUNDATION: | | * NICE_CANDIDATE_MAX_FOUNDATION: | |
| * | | * | |
| * The maximum size a candidate foundation can have. | | * The maximum size a candidate foundation can have. | |
| */ | | */ | |
| #define NICE_CANDIDATE_MAX_FOUNDATION (32+1) | | #define NICE_CANDIDATE_MAX_FOUNDATION (32+1) | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 102 | |
| { | | { | |
| NICE_CANDIDATE_TYPE_HOST, | | NICE_CANDIDATE_TYPE_HOST, | |
| NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE, | | NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE, | |
| NICE_CANDIDATE_TYPE_PEER_REFLEXIVE, | | NICE_CANDIDATE_TYPE_PEER_REFLEXIVE, | |
| NICE_CANDIDATE_TYPE_RELAYED, | | NICE_CANDIDATE_TYPE_RELAYED, | |
| } NiceCandidateType; | | } NiceCandidateType; | |
| | | | |
| /** | | /** | |
| * NiceCandidateTransport: | | * NiceCandidateTransport: | |
| * @NICE_CANDIDATE_TRANSPORT_UDP: UDP transport | | * @NICE_CANDIDATE_TRANSPORT_UDP: UDP transport | |
|
| | | * @NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE: TCP Active transport | |
| | | * @NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE: TCP Passive transport | |
| | | * @NICE_CANDIDATE_TRANSPORT_TCP_SO: TCP Simultaneous-Open transport | |
| * | | * | |
| * An enum representing the type of transport to use | | * An enum representing the type of transport to use | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| NICE_CANDIDATE_TRANSPORT_UDP, | | NICE_CANDIDATE_TRANSPORT_UDP, | |
|
| | | NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE, | |
| | | NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE, | |
| | | NICE_CANDIDATE_TRANSPORT_TCP_SO, | |
| } NiceCandidateTransport; | | } NiceCandidateTransport; | |
| | | | |
| /** | | /** | |
| * NiceRelayType: | | * NiceRelayType: | |
| * @NICE_RELAY_TYPE_TURN_UDP: A TURN relay using UDP | | * @NICE_RELAY_TYPE_TURN_UDP: A TURN relay using UDP | |
| * @NICE_RELAY_TYPE_TURN_TCP: A TURN relay using TCP | | * @NICE_RELAY_TYPE_TURN_TCP: A TURN relay using TCP | |
| * @NICE_RELAY_TYPE_TURN_TLS: A TURN relay using TLS over TCP | | * @NICE_RELAY_TYPE_TURN_TLS: A TURN relay using TLS over TCP | |
| * | | * | |
| * An enum representing the type of relay to use | | * An enum representing the type of relay to use | |
| */ | | */ | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 136 | |
| NICE_RELAY_TYPE_TURN_TCP, | | NICE_RELAY_TYPE_TURN_TCP, | |
| NICE_RELAY_TYPE_TURN_TLS | | NICE_RELAY_TYPE_TURN_TLS | |
| } NiceRelayType; | | } NiceRelayType; | |
| | | | |
| typedef struct _NiceCandidate NiceCandidate; | | typedef struct _NiceCandidate NiceCandidate; | |
| | | | |
| typedef struct _TurnServer TurnServer; | | typedef struct _TurnServer TurnServer; | |
| | | | |
| /** | | /** | |
| * TurnServer: | | * TurnServer: | |
|
| | | * @ref_count: Reference count for the structure. | |
| * @server: The #NiceAddress of the TURN server | | * @server: The #NiceAddress of the TURN server | |
| * @username: The TURN username | | * @username: The TURN username | |
| * @password: The TURN password | | * @password: The TURN password | |
| * @type: The #NiceRelayType of the server | | * @type: The #NiceRelayType of the server | |
| * | | * | |
| * A structure to store the TURN relay settings | | * A structure to store the TURN relay settings | |
| */ | | */ | |
| struct _TurnServer | | struct _TurnServer | |
| { | | { | |
| gint ref_count; | | gint ref_count; | |
| | | | |
|
| NiceAddress server; /**< TURN server address */ | | NiceAddress server; | |
| gchar *username; /**< TURN username */ | | gchar *username; | |
| gchar *password; /**< TURN password */ | | gchar *password; | |
| NiceRelayType type; /**< TURN type */ | | NiceRelayType type; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * NiceCandidate: | | * NiceCandidate: | |
| * @type: The type of candidate | | * @type: The type of candidate | |
| * @transport: The transport being used for the candidate | | * @transport: The transport being used for the candidate | |
| * @addr: The #NiceAddress of the candidate | | * @addr: The #NiceAddress of the candidate | |
| * @base_addr: The #NiceAddress of the base address used by the candidate | | * @base_addr: The #NiceAddress of the base address used by the candidate | |
| * @priority: The priority of the candidate <emphasis> see note </emphasis> | | * @priority: The priority of the candidate <emphasis> see note </emphasis> | |
| * @stream_id: The ID of the stream to which belongs the candidate | | * @stream_id: The ID of the stream to which belongs the candidate | |
| | | | |
| skipping to change at line 210 | | skipping to change at line 229 | |
| * nice_candidate_copy: | | * nice_candidate_copy: | |
| * @candidate: The candidate to copy | | * @candidate: The candidate to copy | |
| * | | * | |
| * Makes a copy of a #NiceCandidate | | * Makes a copy of a #NiceCandidate | |
| * | | * | |
| * Returns: A new #NiceCandidate, a copy of @candidate | | * Returns: A new #NiceCandidate, a copy of @candidate | |
| */ | | */ | |
| NiceCandidate * | | NiceCandidate * | |
| nice_candidate_copy (const NiceCandidate *candidate); | | nice_candidate_copy (const NiceCandidate *candidate); | |
| | | | |
|
| guint32 | | GType nice_candidate_get_type (void); | |
| nice_candidate_jingle_priority (NiceCandidate *candidate); | | | |
| | | | |
| guint32 | | | |
| nice_candidate_msn_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); | | * NICE_TYPE_CANDIDATE: | |
| | | * | |
| guint64 | | * A boxed type for a #NiceCandidate. | |
| nice_candidate_pair_priority (guint32 o_prio, guint32 a_prio); | | */ | |
| | | #define NICE_TYPE_CANDIDATE nice_candidate_get_type () | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
| #endif /* _CANDIDATE_H */ | | #endif /* _CANDIDATE_H */ | |
| | | | |
End of changes. 10 change blocks. |
| 19 lines changed or deleted | | 31 lines changed or added | |
|
| pseudotcp.h | | pseudotcp.h | |
| /* | | /* | |
| * This file is part of the Nice GLib ICE library. | | * This file is part of the Nice GLib ICE library. | |
| * | | * | |
|
| * (C) 2010 Collabora Ltd. | | * (C) 2010, 2014 Collabora Ltd. | |
| * Contact: Youness Alaoui | | * Contact: Philip Withnall | |
| | | | |
| * | | * | |
| * The contents of this file are subject to the Mozilla Public License Vers
ion | | * The contents of this file are subject to the Mozilla Public License Vers
ion | |
| * 1.1 (the "License"); you may not use this file except in compliance with | | * 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 | | * the License. You may obtain a copy of the License at | |
| * http://www.mozilla.org/MPL/ | | * http://www.mozilla.org/MPL/ | |
| * | | * | |
| * Software distributed under the License is distributed on an "AS IS" basi
s, | | * Software distributed under the License is distributed on an "AS IS" basi
s, | |
| * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| * for the specific language governing rights and limitations under the | | * for the specific language governing rights and limitations under the | |
| * License. | | * License. | |
| * | | * | |
| * The Original Code is the Nice GLib ICE library. | | * The Original Code is the Nice GLib ICE library. | |
| * | | * | |
| * The Initial Developers of the Original Code are Collabora Ltd and Nokia | | * The Initial Developers of the Original Code are Collabora Ltd and Nokia | |
| * Corporation. All Rights Reserved. | | * Corporation. All Rights Reserved. | |
| * | | * | |
| * Contributors: | | * Contributors: | |
| * Youness Alaoui, Collabora Ltd. | | * Youness Alaoui, Collabora Ltd. | |
|
| | | * Philip Withnall, Collabora Ltd. | |
| * | | * | |
| * Alternatively, the contents of this file may be used under the terms of
the | | * 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 | | * 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 yo
u | | * case the provisions of LGPL are applicable instead of those above. If yo
u | |
| * wish to allow use of your version of this file only under the terms of t
he | | * wish to allow use of your version of this file only under the terms of t
he | |
| * LGPL and not to allow others to use your version of this file under 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 | | * MPL, indicate your decision by deleting the provisions above and replace | |
| * them with the notice and other provisions required by the LGPL. If you d
o | | * them with the notice and other provisions required by the LGPL. If you d
o | |
| * not delete the provisions above, a recipient may use your version of thi
s | | * not delete the provisions above, a recipient may use your version of thi
s | |
| * file under either the MPL or the LGPL. | | * file under either the MPL or the LGPL. | |
| | | | |
| skipping to change at line 59 | | skipping to change at line 60 | |
| * transport over non-reliable sockets (such as UDP). | | * transport over non-reliable sockets (such as UDP). | |
| * | | * | |
| * See the file tests/test-pseudotcp.c in the source package for an example | | * See the file tests/test-pseudotcp.c in the source package for an example | |
| * of how to use the object. | | * of how to use the object. | |
| * | | * | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| */ | | */ | |
| | | | |
| #include <glib-object.h> | | #include <glib-object.h> | |
| | | | |
|
| | | #ifndef __GTK_DOC_IGNORE__ | |
| #ifdef G_OS_WIN32 | | #ifdef G_OS_WIN32 | |
| # include <winsock2.h> | | # include <winsock2.h> | |
| # define ECONNABORTED WSAECONNABORTED | | # define ECONNABORTED WSAECONNABORTED | |
| # define ENOTCONN WSAENOTCONN | | # define ENOTCONN WSAENOTCONN | |
| # define EWOULDBLOCK WSAEWOULDBLOCK | | # define EWOULDBLOCK WSAEWOULDBLOCK | |
| # define ECONNRESET WSAECONNRESET | | # define ECONNRESET WSAECONNRESET | |
| #endif | | #endif | |
|
| | | #endif | |
| | | | |
| #include "agent.h" | | #include "agent.h" | |
| | | | |
| G_BEGIN_DECLS | | G_BEGIN_DECLS | |
| | | | |
| /** | | /** | |
| * PseudoTcpSocket: | | * PseudoTcpSocket: | |
| * | | * | |
| * The #PseudoTcpSocket is the GObject implementing the Pseudo TCP Socket | | * The #PseudoTcpSocket is the GObject implementing the Pseudo TCP Socket | |
| * | | * | |
| | | | |
| skipping to change at line 137 | | skipping to change at line 140 | |
| | | | |
| /** | | /** | |
| * PseudoTcpState: | | * PseudoTcpState: | |
| * @TCP_LISTEN: The socket's initial state. The socket isn't connected and
is | | * @TCP_LISTEN: The socket's initial state. The socket isn't connected and
is | |
| * listening for an incoming connection | | * listening for an incoming connection | |
| * @TCP_SYN_SENT: The socket has sent a connection request (SYN) packet and
is | | * @TCP_SYN_SENT: The socket has sent a connection request (SYN) packet and
is | |
| * waiting for an answer | | * waiting for an answer | |
| * @TCP_SYN_RECEIVED: The socket has received a connection request (SYN) pa
cket. | | * @TCP_SYN_RECEIVED: The socket has received a connection request (SYN) pa
cket. | |
| * @TCP_ESTABLISHED: The socket is connected | | * @TCP_ESTABLISHED: The socket is connected | |
| * @TCP_CLOSED: The socket has been closed | | * @TCP_CLOSED: The socket has been closed | |
|
| | | * @TCP_FIN_WAIT_1: The socket has been closed locally but not remotely | |
| | | * (Since: 0.1.8) | |
| | | * @TCP_FIN_WAIT_2: The socket has been closed locally but not remotely | |
| | | * (Since: 0.1.8) | |
| | | * @TCP_CLOSING: The socket has been closed locally and remotely | |
| | | * (Since: 0.1.8) | |
| | | * @TCP_TIME_WAIT: The socket has been closed locally and remotely | |
| | | * (Since: 0.1.8) | |
| | | * @TCP_CLOSE_WAIT: The socket has been closed remotely but not locally | |
| | | * (Since: 0.1.8) | |
| | | * @TCP_LAST_ACK: The socket has been closed locally and remotely | |
| | | * (Since: 0.1.8) | |
| * | | * | |
|
| * An enum representing the state of the #PseudoTcpSocket. | | * An enum representing the state of the #PseudoTcpSocket. These states | |
| | | * correspond to the TCP states in RFC 793. | |
| * <para> See also: #PseudoTcpSocket:state </para> | | * <para> See also: #PseudoTcpSocket:state </para> | |
| * | | * | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| TCP_LISTEN, | | TCP_LISTEN, | |
| TCP_SYN_SENT, | | TCP_SYN_SENT, | |
| TCP_SYN_RECEIVED, | | TCP_SYN_RECEIVED, | |
| TCP_ESTABLISHED, | | TCP_ESTABLISHED, | |
|
| TCP_CLOSED | | TCP_CLOSED, | |
| | | TCP_FIN_WAIT_1, | |
| | | TCP_FIN_WAIT_2, | |
| | | TCP_CLOSING, | |
| | | TCP_TIME_WAIT, | |
| | | TCP_CLOSE_WAIT, | |
| | | TCP_LAST_ACK, | |
| } PseudoTcpState; | | } PseudoTcpState; | |
| | | | |
| /** | | /** | |
| * PseudoTcpWriteResult: | | * PseudoTcpWriteResult: | |
| * @WR_SUCCESS: The write operation was successful | | * @WR_SUCCESS: The write operation was successful | |
| * @WR_TOO_LARGE: The socket type requires that message be sent atomically | | * @WR_TOO_LARGE: The socket type requires that message be sent atomically | |
| * and the size of the message to be sent made this impossible. | | * and the size of the message to be sent made this impossible. | |
| * @WR_FAIL: There was an error sending the message | | * @WR_FAIL: There was an error sending the message | |
| * | | * | |
| * An enum representing the result value of the write operation requested b
y | | * An enum representing the result value of the write operation requested b
y | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 193 | |
| * | | * | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| WR_SUCCESS, | | WR_SUCCESS, | |
| WR_TOO_LARGE, | | WR_TOO_LARGE, | |
| WR_FAIL | | WR_FAIL | |
| } PseudoTcpWriteResult; | | } PseudoTcpWriteResult; | |
| | | | |
| /** | | /** | |
|
| | | * PseudoTcpShutdown: | |
| | | * @PSEUDO_TCP_SHUTDOWN_RD: Shut down the local reader only | |
| | | * @PSEUDO_TCP_SHUTDOWN_WR: Shut down the local writer only | |
| | | * @PSEUDO_TCP_SHUTDOWN_RDWR: Shut down both reading and writing | |
| | | * | |
| | | * Options for which parts of a connection to shut down when calling | |
| | | * pseudo_tcp_socket_shutdown(). These correspond to the values passed to P | |
| | | OSIX | |
| | | * shutdown(). | |
| | | * | |
| | | * Since: 0.1.8 | |
| | | */ | |
| | | typedef enum { | |
| | | PSEUDO_TCP_SHUTDOWN_RD, | |
| | | PSEUDO_TCP_SHUTDOWN_WR, | |
| | | PSEUDO_TCP_SHUTDOWN_RDWR, | |
| | | } PseudoTcpShutdown; | |
| | | | |
| | | /** | |
| * PseudoTcpCallbacks: | | * PseudoTcpCallbacks: | |
| * @user_data: A user defined pointer to be passed to the callbacks | | * @user_data: A user defined pointer to be passed to the callbacks | |
| * @PseudoTcpOpened: The #PseudoTcpSocket is now connected | | * @PseudoTcpOpened: The #PseudoTcpSocket is now connected | |
| * @PseudoTcpReadable: The socket is readable | | * @PseudoTcpReadable: The socket is readable | |
| * @PseudoTcpWritable: The socket is writable | | * @PseudoTcpWritable: The socket is writable | |
|
| * @PseudoTcpClosed: The socket was closed | | * @PseudoTcpClosed: The socket was closed (both sides) | |
| * @WritePacket: This callback is called when the socket needs to send data
. | | * @WritePacket: This callback is called when the socket needs to send data
. | |
| * | | * | |
| * A structure containing callbacks functions that will be called by the | | * A structure containing callbacks functions that will be called by the | |
| * #PseudoTcpSocket when some events happen. | | * #PseudoTcpSocket when some events happen. | |
| * <para> See also: #PseudoTcpWriteResult </para> | | * <para> See also: #PseudoTcpWriteResult </para> | |
| * | | * | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| gpointer user_data; | | gpointer user_data; | |
| | | | |
| skipping to change at line 291 | | skipping to change at line 331 | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| */ | | */ | |
| gint pseudo_tcp_socket_send(PseudoTcpSocket *self, const char * buffer, | | gint pseudo_tcp_socket_send(PseudoTcpSocket *self, const char * buffer, | |
| guint32 len); | | guint32 len); | |
| | | | |
| /** | | /** | |
| * pseudo_tcp_socket_close: | | * pseudo_tcp_socket_close: | |
| * @self: The #PseudoTcpSocket object. | | * @self: The #PseudoTcpSocket object. | |
| * @force: %TRUE to close the socket forcefully, %FALSE to close it gracefu
lly | | * @force: %TRUE to close the socket forcefully, %FALSE to close it gracefu
lly | |
| * | | * | |
|
| * Close the socket. IF @force is set to %FALSE, the socket will finish sen | | * Close the socket for sending. If @force is set to %FALSE, the socket wil | |
| ding | | l | |
| * pending data before closing. | | * finish sending pending data before closing. If it is set to %TRUE, the s | |
| | | ocket | |
| | | * will discard pending data and close the connection immediately (sending | |
| | | a TCP | |
| | | * RST segment). | |
| | | * | |
| | | * The socket will be closed in both directions – sending and receiving â | |
| | | €“ and | |
| | | * any pending received data must be read before calling this function, by | |
| | | * calling pseudo_tcp_socket_recv() until it blocks. If any pending data is | |
| | | in | |
| | | * the receive buffer when pseudo_tcp_socket_close() is called, a TCP RST | |
| | | * segment will be sent to the peer to notify it of the data loss. | |
| * | | * | |
| <note> | | <note> | |
| <para> | | <para> | |
| The %PseudoTcpCallbacks:PseudoTcpClosed callback will not be called on
ce | | The %PseudoTcpCallbacks:PseudoTcpClosed callback will not be called on
ce | |
| the socket gets closed. It is only used for aborted connection. | | the socket gets closed. It is only used for aborted connection. | |
| Instead, the socket gets closed when the pseudo_tcp_socket_get_next_cl
ock() | | Instead, the socket gets closed when the pseudo_tcp_socket_get_next_cl
ock() | |
| function returns FALSE. | | function returns FALSE. | |
| </para> | | </para> | |
| </note> | | </note> | |
| * | | * | |
| * <para> See also: pseudo_tcp_socket_get_next_clock() </para> | | * <para> See also: pseudo_tcp_socket_get_next_clock() </para> | |
| * | | * | |
| * Since: 0.0.11 | | * Since: 0.0.11 | |
| */ | | */ | |
| void pseudo_tcp_socket_close(PseudoTcpSocket *self, gboolean force); | | void pseudo_tcp_socket_close(PseudoTcpSocket *self, gboolean force); | |
| | | | |
| /** | | /** | |
|
| | | * pseudo_tcp_socket_shutdown: | |
| | | * @self: The #PseudoTcpSocket object. | |
| | | * @how: The directions of the connection to shut down. | |
| | | * | |
| | | * Shut down sending, receiving, or both on the socket, depending on the va | |
| | | lue | |
| | | * of @how. The behaviour of pseudo_tcp_socket_send() and | |
| | | * pseudo_tcp_socket_recv() will immediately change after this function ret | |
| | | urns | |
| | | * (depending on the value of @how), though the socket may continue to proc | |
| | | ess | |
| | | * network traffic in the background even if sending or receiving data is | |
| | | * forbidden. | |
| | | * | |
| | | * This is equivalent to the POSIX shutdown() function. Setting @how to | |
| | | * %PSEUDO_TCP_SHUTDOWN_RDWR is equivalent to calling pseudo_tcp_socket_clo | |
| | | se(). | |
| | | * | |
| | | * Since: 0.1.8 | |
| | | */ | |
| | | void pseudo_tcp_socket_shutdown (PseudoTcpSocket *self, PseudoTcpShutdown h | |
| | | ow); | |
| | | | |
| | | /** | |
| * pseudo_tcp_socket_get_error: | | * pseudo_tcp_socket_get_error: | |
| * @self: The #PseudoTcpSocket object. | | * @self: The #PseudoTcpSocket object. | |
| * | | * | |
| * Return the last encountered error. | | * Return the last encountered error. | |
| * | | * | |
| <note> | | <note> | |
| <para> | | <para> | |
| The return value can be : | | The return value can be : | |
| <para> | | <para> | |
| EINVAL (for pseudo_tcp_socket_connect()). | | EINVAL (for pseudo_tcp_socket_connect()). | |
| | | | |
| skipping to change at line 454 | | skipping to change at line 521 | |
| */ | | */ | |
| | | | |
| gboolean pseudo_tcp_socket_can_send (PseudoTcpSocket *self); | | gboolean pseudo_tcp_socket_can_send (PseudoTcpSocket *self); | |
| | | | |
| /** | | /** | |
| * pseudo_tcp_socket_get_available_send_space: | | * pseudo_tcp_socket_get_available_send_space: | |
| * @self: The #PseudoTcpSocket object. | | * @self: The #PseudoTcpSocket object. | |
| * | | * | |
| * Gets the number of bytes of space available in the transmission buffer. | | * Gets the number of bytes of space available in the transmission buffer. | |
| * | | * | |
|
| * Returns: The numbero f bytes, or 0 if the connection is not established. | | * Returns: The number of bytes, or 0 if the connection is not established. | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| gsize pseudo_tcp_socket_get_available_send_space (PseudoTcpSocket *self); | | gsize pseudo_tcp_socket_get_available_send_space (PseudoTcpSocket *self); | |
| | | | |
|
| | | /** | |
| | | * pseudo_tcp_socket_set_time: | |
| | | * @self: The #PseudoTcpSocket object. | |
| | | * @current_time: Current monotonic time, in milliseconds; or zero to use t | |
| | | he | |
| | | * system monotonic clock. | |
| | | * | |
| | | * Sets the current monotonic time to be used by the TCP socket when calcul | |
| | | ating | |
| | | * timeouts and expiry times. If this function is not called, or is called | |
| | | with | |
| | | * @current_time as zero, g_get_monotonic_time() will be used. Otherwise, t | |
| | | he | |
| | | * specified @current_time will be used until it is updated by calling this | |
| | | * function again. | |
| | | * | |
| | | * This function is intended for testing only, and should not be used in | |
| | | * production code. | |
| | | * | |
| | | * Since: 0.1.8 | |
| | | */ | |
| | | void pseudo_tcp_socket_set_time (PseudoTcpSocket *self, guint32 current_tim | |
| | | e); | |
| | | | |
| | | /** | |
| | | * pseudo_tcp_socket_is_closed: | |
| | | * @self: The #PseudoTcpSocket object. | |
| | | * | |
| | | * Gets whether the socket is closed, with the shutdown handshake completed | |
| | | , | |
| | | * and both peers no longer able to read or write data to the connection. | |
| | | * | |
| | | * Returns: %TRUE if the socket is closed in both directions, %FALSE otherw | |
| | | ise | |
| | | * Since: 0.1.8 | |
| | | */ | |
| | | gboolean pseudo_tcp_socket_is_closed (PseudoTcpSocket *self); | |
| | | | |
| | | /** | |
| | | * pseudo_tcp_socket_is_closed_remotely: | |
| | | * @self: The #PseudoTcpSocket object. | |
| | | * | |
| | | * Gets whether the socket has been closed on the remote peer’s side of t | |
| | | he | |
| | | * connection (i.e. whether pseudo_tcp_socket_close() has been called there | |
| | | ). | |
| | | * This is guaranteed to return %TRUE if pseudo_tcp_socket_is_closed() retu | |
| | | rns | |
| | | * %TRUE. It will not return %TRUE after pseudo_tcp_socket_close() is calle | |
| | | d | |
| | | * until a FIN segment is received from the remote peer. | |
| | | * | |
| | | * Returns: %TRUE if the remote peer has closed its side of the connection, | |
| | | * %FALSE otherwise | |
| | | * Since: 0.1.8 | |
| | | */ | |
| | | gboolean pseudo_tcp_socket_is_closed_remotely (PseudoTcpSocket *self); | |
| | | | |
| G_END_DECLS | | G_END_DECLS | |
| | | | |
| #endif /* _PSEUDOTCP_H */ | | #endif /* _PSEUDOTCP_H */ | |
| | | | |
End of changes. 13 change blocks. |
| 9 lines changed or deleted | | 144 lines changed or added | |
|
| stunmessage.h | | stunmessage.h | |
| | | | |
| skipping to change at line 211 | | skipping to change at line 211 | |
| * by TURN draft 09 and 12 | | * by TURN draft 09 and 12 | |
| * @STUN_ATTRIBUTE_CONNECT_STAT: The CONNECT-STAT attribute as defined by T
URN | | * @STUN_ATTRIBUTE_CONNECT_STAT: The CONNECT-STAT attribute as defined by T
URN | |
| * draft 04 | | * draft 04 | |
| * @STUN_ATTRIBUTE_PRIORITY: The PRIORITY attribute as defined by ICE draft
19 | | * @STUN_ATTRIBUTE_PRIORITY: The PRIORITY attribute as defined by ICE draft
19 | |
| * @STUN_ATTRIBUTE_USE_CANDIDATE: The USE-CANDIDATE attribute as defined by | | * @STUN_ATTRIBUTE_USE_CANDIDATE: The USE-CANDIDATE attribute as defined by | |
| * ICE draft 19 | | * ICE draft 19 | |
| * @STUN_ATTRIBUTE_OPTIONS: The OPTIONS optional attribute as defined by | | * @STUN_ATTRIBUTE_OPTIONS: The OPTIONS optional attribute as defined by | |
| * libjingle | | * libjingle | |
| * @STUN_ATTRIBUTE_MS_VERSION: The MS-VERSION optional attribute as defined | | * @STUN_ATTRIBUTE_MS_VERSION: The MS-VERSION optional attribute as defined | |
| * by [MS-TURN] | | * by [MS-TURN] | |
|
| | | * @STUN_ATTRIBUTE_MS_XOR_MAPPED_ADDRESS: The XOR-MAPPED-ADDRESS optional | |
| | | * attribute as defined by [MS-TURN] | |
| * @STUN_ATTRIBUTE_SOFTWARE: The SOFTWARE optional attribute as defined by
RFC5389 | | * @STUN_ATTRIBUTE_SOFTWARE: The SOFTWARE optional attribute as defined by
RFC5389 | |
| * @STUN_ATTRIBUTE_ALTERNATE_SERVER: The ALTERNATE-SERVER optional attribut
e as | | * @STUN_ATTRIBUTE_ALTERNATE_SERVER: The ALTERNATE-SERVER optional attribut
e as | |
| * defined by RFC5389 | | * defined by RFC5389 | |
| * @STUN_ATTRIBUTE_FINGERPRINT: The FINGERPRINT optional attribute as defin
ed | | * @STUN_ATTRIBUTE_FINGERPRINT: The FINGERPRINT optional attribute as defin
ed | |
| * by RFC5389 | | * by RFC5389 | |
| * @STUN_ATTRIBUTE_ICE_CONTROLLED: The ICE-CONTROLLED optional attribute as | | * @STUN_ATTRIBUTE_ICE_CONTROLLED: The ICE-CONTROLLED optional attribute as | |
| * defined by ICE draft 19 | | * defined by ICE draft 19 | |
| * @STUN_ATTRIBUTE_ICE_CONTROLLING: The ICE-CONTROLLING optional attribute
as | | * @STUN_ATTRIBUTE_ICE_CONTROLLING: The ICE-CONTROLLING optional attribute
as | |
| * defined by ICE draft 19 | | * defined by ICE draft 19 | |
| * @STUN_ATTRIBUTE_MS_SEQUENCE_NUMBER: The MS-SEQUENCE NUMBER optional attr
ibute | | * @STUN_ATTRIBUTE_MS_SEQUENCE_NUMBER: The MS-SEQUENCE NUMBER optional attr
ibute | |
| | | | |
| skipping to change at line 288 | | skipping to change at line 290 | |
| /* 0x0026 */ /* reserved */ | | /* 0x0026 */ /* reserved */ | |
| /* 0x0027 */ /* reserved */ | | /* 0x0027 */ /* reserved */ | |
| /* 0x0028 */ /* reserved */ | | /* 0x0028 */ /* reserved */ | |
| /* 0x0029 */ /* reserved */ | | /* 0x0029 */ /* reserved */ | |
| /* 0x002A-0x7fff */ /* reserved */ | | /* 0x002A-0x7fff */ /* reserved */ | |
| | | | |
| /* Optional attributes */ | | /* Optional attributes */ | |
| /* 0x8000-0x8021 */ /* reserved */ | | /* 0x8000-0x8021 */ /* reserved */ | |
| STUN_ATTRIBUTE_OPTIONS=0x8001, /* libjingle */ | | STUN_ATTRIBUTE_OPTIONS=0x8001, /* libjingle */ | |
| STUN_ATTRIBUTE_MS_VERSION=0x8008, /* MS-TURN */ | | STUN_ATTRIBUTE_MS_VERSION=0x8008, /* MS-TURN */ | |
|
| | | STUN_ATTRIBUTE_MS_XOR_MAPPED_ADDRESS=0x8020, /* MS-TURN */ | |
| STUN_ATTRIBUTE_SOFTWARE=0x8022, /* RFC5389 */ | | STUN_ATTRIBUTE_SOFTWARE=0x8022, /* RFC5389 */ | |
| STUN_ATTRIBUTE_ALTERNATE_SERVER=0x8023, /* RFC5389 */ | | STUN_ATTRIBUTE_ALTERNATE_SERVER=0x8023, /* RFC5389 */ | |
| /* 0x8024 */ /* reserved */ | | /* 0x8024 */ /* reserved */ | |
| /* 0x8025 */ /* reserved */ | | /* 0x8025 */ /* reserved */ | |
| /* 0x8026 */ /* reserved */ | | /* 0x8026 */ /* reserved */ | |
| /* 0x8027 */ /* reserved */ | | /* 0x8027 */ /* reserved */ | |
| STUN_ATTRIBUTE_FINGERPRINT=0x8028, /* RFC5389 */ | | STUN_ATTRIBUTE_FINGERPRINT=0x8028, /* RFC5389 */ | |
| STUN_ATTRIBUTE_ICE_CONTROLLED=0x8029, /* ICE-19 */ | | STUN_ATTRIBUTE_ICE_CONTROLLED=0x8029, /* ICE-19 */ | |
| STUN_ATTRIBUTE_ICE_CONTROLLING=0x802A, /* ICE-19 */ | | STUN_ATTRIBUTE_ICE_CONTROLLING=0x802A, /* ICE-19 */ | |
| /* 0x802B-0x804F */ /* reserved */ | | /* 0x802B-0x804F */ /* reserved */ | |
| | | | |
| skipping to change at line 894 | | skipping to change at line 897 | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| const uint8_t *buffer; | | const uint8_t *buffer; | |
| size_t size; | | size_t size; | |
| } StunInputVector; | | } StunInputVector; | |
| | | | |
| /** | | /** | |
| * stun_message_validate_buffer_length_fast: | | * stun_message_validate_buffer_length_fast: | |
| * @buffers: (array length=n_buffers) (in caller-allocated): array of conti
guous | | * @buffers: (array length=n_buffers) (in caller-allocated): array of conti
guous | |
| * #StunInputVectors containing already-received message data | | * #StunInputVectors containing already-received message data | |
|
| * @n_buffers: number of entries in @buffers | | * @n_buffers: number of entries in @buffers or if -1 , then buffers is | |
| | | * terminated by a #StunInputVector with the buffer pointer being %NULL. | |
| * @total_length: total number of valid bytes stored consecutively in @buff
ers | | * @total_length: total number of valid bytes stored consecutively in @buff
ers | |
| * @has_padding: %TRUE if attributes should be padded to 4-byte boundaries | | * @has_padding: %TRUE if attributes should be padded to 4-byte boundaries | |
| * | | * | |
| * Quickly validate whether the message in the given @buffers is potentiall
y a | | * Quickly validate whether the message in the given @buffers is potentiall
y a | |
| * valid STUN message, an incomplete STUN message, or if it’s definitely
not one | | * valid STUN message, an incomplete STUN message, or if it’s definitely
not one | |
| * at all. | | * at all. | |
| * | | * | |
| * This is designed as a first-pass validation only, and does not check the | | * This is designed as a first-pass validation only, and does not check the | |
| * message’s attributes for validity. If this function returns success, t
he | | * message’s attributes for validity. If this function returns success, t
he | |
| * buffers can be compacted and a more thorough validation can be performed | | * buffers can be compacted and a more thorough validation can be performed | |
| | | | |
| skipping to change at line 916 | | skipping to change at line 920 | |
| * definitely do not contain a complete, valid STUN message. | | * definitely do not contain a complete, valid STUN message. | |
| * | | * | |
| * Returns: The length of the valid STUN message in the buffer, or zero or
-1 on | | * Returns: The length of the valid STUN message in the buffer, or zero or
-1 on | |
| * failure | | * failure | |
| * <para> See also: #STUN_MESSAGE_BUFFER_INCOMPLETE </para> | | * <para> See also: #STUN_MESSAGE_BUFFER_INCOMPLETE </para> | |
| * <para> See also: #STUN_MESSAGE_BUFFER_INVALID </para> | | * <para> See also: #STUN_MESSAGE_BUFFER_INVALID </para> | |
| * | | * | |
| * Since: 0.1.5 | | * Since: 0.1.5 | |
| */ | | */ | |
| ssize_t stun_message_validate_buffer_length_fast (StunInputVector *buffers, | | ssize_t stun_message_validate_buffer_length_fast (StunInputVector *buffers, | |
|
| unsigned int n_buffers, size_t total_length, bool has_padding); | | int n_buffers, size_t total_length, bool has_padding); | |
| | | | |
| /** | | /** | |
| * stun_message_id: | | * stun_message_id: | |
| * @msg: The #StunMessage | | * @msg: The #StunMessage | |
| * @id: The #StunTransactionId to fill | | * @id: The #StunTransactionId to fill | |
| * | | * | |
| * Retreive the STUN transaction id from a STUN message | | * Retreive the STUN transaction id from a STUN message | |
| */ | | */ | |
| void stun_message_id (const StunMessage *msg, StunTransactionId id); | | void stun_message_id (const StunMessage *msg, StunTransactionId id); | |
| | | | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 6 lines changed or added | |
|