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
b08c2237
Commit
b08c2237
authored
Feb 23, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stun agent usage flags are now into an enum too
parent
30275785
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
10 deletions
+40
-10
stun/stunagent.c
stun/stunagent.c
+1
-1
stun/stunagent.h
stun/stunagent.h
+39
-9
No files found.
stun/stunagent.c
View file @
b08c2237
...
@@ -49,7 +49,7 @@ static unsigned stun_agent_find_unknowns (StunAgent *agent,
...
@@ -49,7 +49,7 @@ static unsigned stun_agent_find_unknowns (StunAgent *agent,
const
StunMessage
*
msg
,
uint16_t
*
list
,
unsigned
max
);
const
StunMessage
*
msg
,
uint16_t
*
list
,
unsigned
max
);
void
stun_agent_init
(
StunAgent
*
agent
,
const
uint16_t
*
known_attributes
,
void
stun_agent_init
(
StunAgent
*
agent
,
const
uint16_t
*
known_attributes
,
StunCompatibility
compatibility
,
uint32_t
usage_flags
)
StunCompatibility
compatibility
,
StunAgentUsageFlags
usage_flags
)
{
{
int
i
;
int
i
;
...
...
stun/stunagent.h
View file @
b08c2237
...
@@ -86,14 +86,44 @@ typedef enum {
...
@@ -86,14 +86,44 @@ typedef enum {
STUN_VALIDATION_UNKNOWN_ATTRIBUTE
,
STUN_VALIDATION_UNKNOWN_ATTRIBUTE
,
}
StunValidationStatus
;
}
StunValidationStatus
;
/**
#define STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS 0x0001
* StunAgentUsageFlags:
#define STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS 0x0002
* @STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS: The agent should be using the short
#define STUN_AGENT_USAGE_USE_FINGERPRINT 0x0004
* term credentials mechanism for authenticating STUN messages
#define STUN_AGENT_USAGE_ADD_SOFTWARE 0x0008
* @STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS: The agent should be using the long
#define STUN_AGENT_USAGE_IGNORE_CREDENTIALS 0x0010
* term credentials mechanism for authenticating STUN messages
#define STUN_AGENT_USAGE_NO_INDICATION_AUTH 0x0020
* @STUN_AGENT_USAGE_USE_FINGERPRINT: The agent should add the FINGERPRINT
#define STUN_AGENT_USAGE_FORCE_VALIDATER 0x0040
* attribute to the STUN messages it creates.
* @STUN_AGENT_USAGE_ADD_SOFTWARE: The agent should add the SOFTWARE attribute
* to the STUN messages it creates
* @STUN_AGENT_USAGE_IGNORE_CREDENTIALS: The agent should ignore any credentials
* in the STUN messages it receives (the MESSAGE-INTEGRITY attribute
* will never be validated by stun_agent_validate())
* @STUN_AGENT_USAGE_NO_INDICATION_AUTH: The agent should ignore credentials
* in the STUN messages it receives if the #StunClass of the message is
* #STUN_INDICATION (some implementation require #STUN_INDICATION messages to
* be authenticated, while others never add a MESSAGE-INTEGRITY attribute to a
* #STUN_INDICATION message)
* @STUN_AGENT_USAGE_FORCE_VALIDATER: The agent should always try to validate
* the password of a STUN message, even if it already knows what the password
* should be (a response to a previously created request). This means that the
* #StunMessageIntegrityValidate callback will always be called when there is
* a MESSAGE-INTEGRITY attribute.
*
* This enum defines a bitflag usages for a #StunAgent and they will define how
* the agent should behave, independently of the compatibility mode it uses.
* <para> See also: stun_agent_init() </para>
* <para> See also: stun_agent_validate() </para>
*/
typedef
enum
{
STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS
=
(
1
<<
0
),
STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS
=
(
1
<<
1
),
STUN_AGENT_USAGE_USE_FINGERPRINT
=
(
1
<<
2
),
STUN_AGENT_USAGE_ADD_SOFTWARE
=
(
1
<<
3
),
STUN_AGENT_USAGE_IGNORE_CREDENTIALS
=
(
1
<<
4
),
STUN_AGENT_USAGE_NO_INDICATION_AUTH
=
(
1
<<
5
),
STUN_AGENT_USAGE_FORCE_VALIDATER
=
(
1
<<
6
),
}
StunAgentUsageFlags
;
typedef
struct
{
typedef
struct
{
...
@@ -110,7 +140,7 @@ struct stun_agent_t {
...
@@ -110,7 +140,7 @@ struct stun_agent_t {
StunCompatibility
compatibility
;
StunCompatibility
compatibility
;
StunAgentSavedIds
sent_ids
[
STUN_AGENT_MAX_SAVED_IDS
];
StunAgentSavedIds
sent_ids
[
STUN_AGENT_MAX_SAVED_IDS
];
uint16_t
*
known_attributes
;
uint16_t
*
known_attributes
;
uint32_t
usage_flags
;
StunAgentUsageFlags
usage_flags
;
};
};
typedef
struct
{
typedef
struct
{
...
...
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