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
4e7c80a7
Commit
4e7c80a7
authored
Feb 16, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean the files from unwanted gtk-doc tags
parent
acf4804a
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
116 additions
and
159 deletions
+116
-159
agent/agent-priv.h
agent/agent-priv.h
+29
-29
agent/agent.c
agent/agent.c
+2
-2
agent/candidate.c
agent/candidate.c
+4
-4
agent/component.c
agent/component.c
+5
-5
agent/conncheck.c
agent/conncheck.c
+40
-40
agent/discovery.c
agent/discovery.c
+16
-16
agent/stream.c
agent/stream.c
+4
-4
agent/stream.h
agent/stream.h
+3
-3
random/random.c
random/random.c
+6
-6
stun/stun5389.h
stun/stun5389.h
+1
-1
stun/stunhmac.h
stun/stunhmac.h
+3
-3
stun/stunmessage.c
stun/stunmessage.c
+0
-44
stun/stunmessage.h
stun/stunmessage.h
+3
-2
No files found.
agent/agent-priv.h
View file @
4e7c80a7
...
...
@@ -62,41 +62,41 @@
#define NICE_AGENT_MAX_CONNECTIVITY_CHECKS_DEFAULT 100
/* see spec 5.7.3 (ID-19) */
/*
*
An upper limit to size of STUN packets handled (based on Ethernet
/* 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 */
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
*
proxy_ip
;
/*
*<
property: Proxy server IP */
guint
proxy_port
;
/*
*<
property: Proxy server port */
NiceProxyType
proxy_type
;
/*
*<
property: Proxy type */
gchar
*
proxy_username
;
/*
*<
property: Proxy username */
gchar
*
proxy_password
;
/*
*<
property: Proxy password */
gboolean
controlling_mode
;
/*
*<
property: controlling-mode */
guint
timer_ta
;
/*
*<
property: timer Ta */
guint
max_conn_checks
;
/*
*<
property: max connectivity checks */
GSList
*
local_addresses
;
/*
*<
list of NiceAddresses for local
GObject
parent
;
/* gobject pointer */
gboolean
full_mode
;
/* property: full-mode */
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
*
proxy_ip
;
/* property: Proxy server IP */
guint
proxy_port
;
/* property: Proxy server port */
NiceProxyType
proxy_type
;
/* property: Proxy type */
gchar
*
proxy_username
;
/* property: Proxy username */
gchar
*
proxy_password
;
/* property: Proxy password */
gboolean
controlling_mode
;
/* property: controlling-mode */
guint
timer_ta
;
/* property: timer Ta */
guint
max_conn_checks
;
/* property: max connectivity checks */
GSList
*
local_addresses
;
/* list of NiceAddresses for local
interfaces */
GSList
*
streams
;
/*
*<
list of Stream objects */
GMainContext
*
main_context
;
/*
*<
main context pointer */
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 */
GSource
*
discovery_timer_source
;
/*
*<
source of discovery timer */
GSource
*
conncheck_timer_source
;
/*
*<
source of conncheck timer */
GSource
*
keepalive_timer_source
;
/*
*<
source of keepalive timer */
GSList
*
refresh_list
;
/*
*<
list of CandidateRefresh items */
guint64
tie_breaker
;
/*
*<
tie breaker (ICE sect 5.2
GSList
*
streams
;
/* list of Stream objects */
GMainContext
*
main_context
;
/* main context pointer */
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 */
GSource
*
discovery_timer_source
;
/* source of discovery timer */
GSource
*
conncheck_timer_source
;
/* source of conncheck timer */
GSource
*
keepalive_timer_source
;
/* source of keepalive timer */
GSList
*
refresh_list
;
/* list of CandidateRefresh items */
guint64
tie_breaker
;
/* tie breaker (ICE sect 5.2
"Determining Role" ID-19) */
GStaticRecMutex
mutex
;
/* Mutex used for thread-safe lib */
NiceCompatibility
compatibility
;
/* property: Compatibility mode */
...
...
agent/agent.c
View file @
4e7c80a7
...
...
@@ -1820,7 +1820,7 @@ agent_attach_stream_component_socket (NiceAgent *agent,
}
/*
*
/*
* Attaches socket handles of 'stream' to the main eventloop
* context.
*
...
...
@@ -1838,7 +1838,7 @@ priv_attach_stream_component (NiceAgent *agent,
return
TRUE
;
}
/*
*
/*
* Detaches socket handles of 'stream' from the main eventloop
* context.
*
...
...
agent/candidate.c
View file @
4e7c80a7
...
...
@@ -36,7 +36,7 @@
* file under either the MPL or the LGPL.
*/
/*
*
/*
* @file candidate.c
* @brief ICE candidate functions
*/
...
...
@@ -114,7 +114,7 @@ nice_candidate_msn_priority (NiceCandidate *candidate)
}
/*
*
/*
* ICE 4.1.2.1. "Recommended Formula" (ID-19):
* returns number between 1 and 0x7effffff
*/
...
...
@@ -155,7 +155,7 @@ nice_candidate_ice_priority (const NiceCandidate *candidate)
return
nice_candidate_ice_priority_full
(
type_preference
,
1
,
candidate
->
component_id
);
}
/*
*
/*
* Calculates the pair priority as specified in ICE
* sect 5.7.2. "Computing Pair Priority and Ordering Pairs" (ID-19).
*/
...
...
@@ -168,7 +168,7 @@ nice_candidate_pair_priority (guint32 o_prio, guint32 a_prio)
return
((
guint64
)
1
<<
32
)
*
min
+
2
*
max
+
(
o_prio
>
a_prio
?
1
:
0
);
}
/*
*
/*
* Copies a candidate
*/
NICEAPI_EXPORT
NiceCandidate
*
...
...
agent/component.c
View file @
4e7c80a7
...
...
@@ -36,7 +36,7 @@
* file under either the MPL or the LGPL.
*/
/*
*
/*
* @file component.c
* @brief ICE component functions
*/
...
...
@@ -120,7 +120,7 @@ component_free (Component *cmp)
g_slice_free
(
Component
,
cmp
);
}
/*
*
/*
* Finds a candidate pair that has matching foundation ids.
*
* @return TRUE if pair found, pointer to pair stored at 'pair'
...
...
@@ -157,7 +157,7 @@ component_find_pair (Component *cmp, NiceAgent *agent, const gchar *lfoundation,
return
FALSE
;
}
/*
*
/*
* Resets the component state to that of a ICE restarted
* session.
*/
...
...
@@ -193,7 +193,7 @@ component_restart (Component *cmp)
return
TRUE
;
}
/*
*
/*
* Changes the selected pair for the component to 'pair'. Does not
* emit the "selected-pair-changed" signal.
*/
...
...
@@ -208,7 +208,7 @@ void component_update_selected_pair (Component *component, const CandidatePair *
component
->
selected_pair
.
priority
=
pair
->
priority
;
}
/*
*
/*
* Finds a remote candidate with matching address and
* transport.
*
...
...
agent/conncheck.c
View file @
4e7c80a7
This diff is collapsed.
Click to expand it.
agent/discovery.c
View file @
4e7c80a7
...
...
@@ -33,7 +33,7 @@
* file under either the MPL or the LGPL.
*/
/*
*
/*
* @file discovery.c
* @brief ICE candidate discovery functions
*/
...
...
@@ -66,7 +66,7 @@ static inline int priv_timer_expired (GTimeVal *timer, GTimeVal *now)
now
->
tv_sec
>=
timer
->
tv_sec
;
}
/*
*
/*
* Frees the CandidateDiscovery structure pointed to
* by 'user data'. Compatible with g_slist_foreach().
*/
...
...
@@ -79,7 +79,7 @@ void discovery_free_item (gpointer data, gpointer user_data)
g_slice_free
(
CandidateDiscovery
,
cand
);
}
/*
*
/*
* Frees all discovery related resources for the agent.
*/
void
discovery_free
(
NiceAgent
*
agent
)
...
...
@@ -100,7 +100,7 @@ void discovery_free (NiceAgent *agent)
}
}
/*
*
/*
* Prunes the list of discovery processes for items related
* to stream 'stream_id'.
*
...
...
@@ -128,7 +128,7 @@ void discovery_prune_stream (NiceAgent *agent, guint stream_id)
}
/*
*
/*
* Frees the CandidateDiscovery structure pointed to
* by 'user data'. Compatible with g_slist_foreach().
*/
...
...
@@ -189,7 +189,7 @@ void refresh_free_item (gpointer data, gpointer user_data)
g_slice_free
(
CandidateRefresh
,
cand
);
}
/*
*
/*
* Frees all discovery related resources for the agent.
*/
void
refresh_free
(
NiceAgent
*
agent
)
...
...
@@ -204,7 +204,7 @@ void refresh_free (NiceAgent *agent)
}
}
/*
*
/*
* Prunes the list of discovery processes for items related
* to stream 'stream_id'.
*
...
...
@@ -235,7 +235,7 @@ void refresh_cancel (CandidateRefresh *refresh)
refresh_free_item
(
refresh
,
NULL
);
}
/*
*
/*
* Adds a new local candidate. Implements the candidate pruning
* defined in ICE spec section 4.1.3 "Eliminating Redundant
* Candidates" (ID-19).
...
...
@@ -263,7 +263,7 @@ static gboolean priv_add_local_candidate_pruned (Component *component, NiceCandi
return
TRUE
;
}
/*
*
/*
* Assings a foundation to the candidate.
*
* Implements the mechanism described in ICE sect
...
...
@@ -350,7 +350,7 @@ void priv_generate_candidate_credentials (NiceAgent *agent,
}
/*
*
/*
* Creates a local host candidate for 'component_id' of stream
* 'stream_id'.
*
...
...
@@ -433,7 +433,7 @@ NiceCandidate *discovery_add_local_host_candidate (
return
candidate
;
}
/*
*
/*
* Creates a server reflexive candidate for 'component_id' of stream
* 'stream_id'.
*
...
...
@@ -490,7 +490,7 @@ discovery_add_server_reflexive_candidate (
}
/*
*
/*
* Creates a server reflexive candidate for 'component_id' of stream
* 'stream_id'.
*
...
...
@@ -580,7 +580,7 @@ discovery_add_relay_candidate (
return
candidate
;
}
/*
*
/*
* Creates a peer reflexive candidate for 'component_id' of stream
* 'stream_id'.
*
...
...
@@ -689,7 +689,7 @@ static guint priv_highest_remote_foundation (Component *component)
return
highest
;
}
/*
*
/*
* Adds a new peer reflexive candidate to the list of known
* remote candidates. The candidate is however not paired with
* existing local candidates.
...
...
@@ -778,7 +778,7 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate (
return
candidate
;
}
/*
*
/*
* Timer callback that handles scheduling new candidate discovery
* processes (paced by the Ta timer), and handles running of the
* existing discovery processes.
...
...
@@ -963,7 +963,7 @@ static gboolean priv_discovery_tick (gpointer pointer)
return
ret
;
}
/*
*
/*
* Initiates the candidate discovery process by starting
* the necessary timers.
*
...
...
agent/stream.c
View file @
4e7c80a7
...
...
@@ -42,7 +42,7 @@
#include "stream.h"
/*
*
/*
* @file stream.c
* @brief ICE stream functionality
*/
...
...
@@ -108,7 +108,7 @@ stream_find_component_by_id (const Stream *stream, guint id)
return
NULL
;
}
/*
*
/*
* Returns true if all components of the stream are either
* 'CONNECTED' or 'READY' (connected plus nominated).
*/
...
...
@@ -129,7 +129,7 @@ stream_all_components_ready (const Stream *stream)
}
/*
*
/*
* Initialized the local crendentials for the stream.
*/
void
stream_initialize_credentials
(
Stream
*
stream
,
NiceRNG
*
rng
)
...
...
@@ -140,7 +140,7 @@ void stream_initialize_credentials (Stream *stream, NiceRNG *rng)
nice_rng_generate_bytes_print
(
rng
,
NICE_STREAM_DEF_PWD
-
1
,
stream
->
local_password
);
}
/*
*
/*
* Resets the stream state to that of a ICE restarted
* session.
*/
...
...
agent/stream.h
View file @
4e7c80a7
...
...
@@ -55,7 +55,7 @@ G_BEGIN_DECLS
#define NICE_STREAM_DEF_UFRAG 4 + 1
/* ufrag + NULL */
#define NICE_STREAM_DEF_PWD 22 + 1
/* pwd + NULL */
/*
*
/*
* Checklist states. These match the definition given in
* the ICE spec sect 5.7.4. "Computing States" (ID-19).
*/
...
...
@@ -76,8 +76,8 @@ struct _Stream
guint
n_components
;
gboolean
initial_binding_request_received
;
GSList
*
components
;
/* list of 'Component' structs */
GSList
*
conncheck_list
;
/*
*<
list of CandidatePair items */
NiceCheckListState
conncheck_state
;
/*
*<
checklist state */
GSList
*
conncheck_list
;
/* list of CandidatePair items */
NiceCheckListState
conncheck_state
;
/* checklist state */
gchar
local_ufrag
[
NICE_STREAM_MAX_UFRAG
];
gchar
local_password
[
NICE_STREAM_MAX_PWD
];
gchar
remote_ufrag
[
NICE_STREAM_MAX_UFRAG
];
...
...
random/random.c
View file @
4e7c80a7
...
...
@@ -46,7 +46,7 @@
static
NiceRNG
*
(
*
nice_rng_new_func
)
(
void
)
=
NULL
;
/*
*
/*
* Creates a new random number generator instance.
*/
NiceRNG
*
...
...
@@ -58,7 +58,7 @@ nice_rng_new (void)
return
nice_rng_new_func
();
}
/*
*
/*
* Sets a new generator function.
*/
void
...
...
@@ -67,7 +67,7 @@ nice_rng_set_new_func (NiceRNG * (*func) (void))
nice_rng_new_func
=
func
;
}
/*
*
/*
* Frees the random number generator instance.
*
* @param rng context
...
...
@@ -78,7 +78,7 @@ nice_rng_free (NiceRNG *rng)
rng
->
free
(
rng
);
}
/*
*
/*
* Generates random octets.
*
* @param rng context
...
...
@@ -91,7 +91,7 @@ nice_rng_generate_bytes (NiceRNG *rng, guint len, gchar *buf)
rng
->
generate_bytes
(
rng
,
len
,
buf
);
}
/*
*
/*
* Generates a random unsigned integer.
*
* @param rng context
...
...
@@ -104,7 +104,7 @@ nice_rng_generate_int (NiceRNG *rng, guint low, guint high)
return
rng
->
generate_int
(
rng
,
low
,
high
);
}
/*
*
/*
* Generates a stream of octets containing only characters
* with ASCII codecs of 0x41-5A (A-Z), 0x61-7A (a-z),
* 0x30-39 (0-9), 0x2b (+) and 0x2f (/). This matches
...
...
stun/stun5389.h
View file @
4e7c80a7
...
...
@@ -49,7 +49,7 @@
# include <sys/types.h>
/*
*
/*
* Computes the FINGERPRINT checksum of a STUN message.
* @param msg pointer to the STUN message
* @param len size of the message from header (inclusive) and up to
...
...
stun/stunhmac.h
View file @
4e7c80a7
...
...
@@ -37,7 +37,7 @@
#include "stunmessage.h"
/*
*
/*
* Computes the MESSAGE-INTEGRITY hash of a STUN message.
* @param msg pointer to the STUN message
* @param len size of the message from header (inclusive) and up to
...
...
@@ -51,7 +51,7 @@
void
stun_sha1
(
const
uint8_t
*
msg
,
size_t
len
,
size_t
msg_len
,
uint8_t
*
sha
,
const
void
*
key
,
size_t
keylen
,
int
padding
);
/*
*
/*
* SIP H(A1) computation
*/
...
...
@@ -59,7 +59,7 @@ void stun_hash_creds (const uint8_t *realm, size_t realm_len,
const
uint8_t
*
username
,
size_t
username_len
,
const
uint8_t
*
password
,
size_t
password_len
,
unsigned
char
md5
[
16
]);
/*
*
/*
* Generates a pseudo-random secure STUN transaction ID.
*/
void
stun_make_transid
(
StunTransactionId
id
);
...
...
stun/stunmessage.c
View file @
4e7c80a7
...
...
@@ -306,17 +306,6 @@ stun_message_find_error (const StunMessage *msg, int *code)
return
STUN_MESSAGE_RETURN_SUCCESS
;
}
/**
* Reserves room for appending an attribute to an unfinished STUN message.
* @param msg STUN message buffer
* @param msize STUN message buffer size
* @param type message type (host byte order)
* @param length attribute payload byte length
* @return a pointer to an unitialized buffer of <length> bytes to
* where the attribute payload must be written, or NULL if there is not
* enough room in the STUN message buffer. Return value is always on a
* 32-bits boundary.
*/
void
*
stun_message_append
(
StunMessage
*
msg
,
StunAttribute
type
,
size_t
length
)
{
...
...
@@ -343,15 +332,6 @@ stun_message_append (StunMessage *msg, StunAttribute type, size_t length)
}
/**
* Appends an attribute from memory.
* @param msg STUN message buffer
* @param msize STUN message buffer size
* @param type attribute type (host byte order)
* @param data memory address to copy payload from
* @param len attribute payload length
* @return 0 on success, ENOBUFS on error.
*/
StunMessageReturn
stun_message_append_bytes
(
StunMessage
*
msg
,
StunAttribute
type
,
const
void
*
data
,
size_t
len
)
...
...
@@ -496,13 +476,6 @@ stun_message_append_xor_addr_full (StunMessage *msg, StunAttribute type,
/**
* Appends an ERROR-CODE attribute.
* @param msg STUN message buffer
* @param msize STUN message buffer size
* @param code STUN host-byte order integer error code
* @return 0 on success, or ENOBUFS otherwise
*/
StunMessageReturn
stun_message_append_error
(
StunMessage
*
msg
,
StunError
code
)
{
...
...
@@ -586,17 +559,11 @@ int stun_message_validate_buffer_length (const uint8_t *msg, size_t length)
return
mlen
;
}
/**
* copies STUN message transaction ID
*/
void
stun_message_id
(
const
StunMessage
*
msg
,
StunTransactionId
id
)
{
memcpy
(
id
,
msg
->
buffer
+
STUN_MESSAGE_TRANS_ID_POS
,
STUN_MESSAGE_TRANS_ID_LEN
);
}
/**
* @return STUN message method (value from 0 to 0xfff)
*/
StunMethod
stun_message_get_method
(
const
StunMessage
*
msg
)
{
uint16_t
t
=
stun_getw
(
msg
->
buffer
);
...
...
@@ -615,9 +582,6 @@ StunMethod stun_message_get_method (const StunMessage *msg)
}
/**
* @return STUN message class in host byte order (value from 0 to 3)
*/
StunClass
stun_message_get_class
(
const
StunMessage
*
msg
)
{
uint16_t
t
=
stun_getw
(
msg
->
buffer
);
...
...
@@ -634,14 +598,6 @@ StunClass stun_message_get_class (const StunMessage *msg)
return
(
StunClass
)(((
t
&
0x0100
)
>>
7
)
|
((
t
&
0x0010
)
>>
4
));
}
/**
* Checks if an attribute is present within a STUN message.
*
* @param msg valid STUN message
* @param type STUN attribute type (host byte order)
*
* @return whether there is a MESSAGE-INTEGRITY attribute
*/
bool
stun_message_has_attribute
(
const
StunMessage
*
msg
,
StunAttribute
type
)
{
uint16_t
dummy
;
...
...
stun/stunmessage.h
View file @
4e7c80a7
...
...
@@ -122,7 +122,6 @@ typedef enum
/**
* StunAttribute:
*
* @STUN_ATTRIBUTE_MAPPED_ADDRESS: The MAPPED-ADDRESS attribute as defined
* by RFC5389
* @STUN_ATTRIBUTE_RESPONSE_ADDRESS: The RESPONSE-ADDRESS attribute as defined
...
...
@@ -195,7 +194,8 @@ typedef enum
* @STUN_ATTRIBUTE_SOFTWARE: The SOFTWARE optional attribute as defined by RFC5389
* @STUN_ATTRIBUTE_ALTERNATE_SERVER: The ALTERNATE-SERVER optional attribute as
* defined by RFC5389
* @STUN_ATTRIBUTE_FINGERPRINT: The FINGERPRINT optional attribute as defined by RFC5389
* @STUN_ATTRIBUTE_FINGERPRINT: The FINGERPRINT optional attribute as defined
* by RFC5389
* @STUN_ATTRIBUTE_ICE_CONTROLLED: The ICE-CONTROLLED optional attribute as
* defined by ICE draft 19
* @STUN_ATTRIBUTE_ICE_CONTROLLING: The ICE-CONTROLLING optional attribute as
...
...
@@ -326,6 +326,7 @@ static const uint16_t STUN_ALL_KNOWN_ATTRIBUTES[] =
/**
* StunTransactionId:
*
* A type that holds a STUN transaction id.
*/
typedef
uint8_t
StunTransactionId
[
STUN_MESSAGE_TRANS_ID_LEN
];
...
...
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