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
c7072612
Commit
c7072612
authored
Jun 17, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a static const for all the known atttributes.. fixes stunbdc with stunserver.org
parent
3f29f7d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
stun/stunmessage.h
stun/stunmessage.h
+33
-0
stun/tools/bind.c
stun/tools/bind.c
+2
-13
No files found.
stun/stunmessage.h
View file @
c7072612
...
@@ -131,6 +131,39 @@ typedef enum
...
@@ -131,6 +131,39 @@ typedef enum
}
stun_attr_type_t
;
}
stun_attr_type_t
;
static
const
uint16_t
STUN_ALL_KNOWN_ATTRIBUTES
[]
=
{
STUN_ATTRIBUTE_MAPPED_ADDRESS
,
STUN_ATTRIBUTE_OLD_RESPONSE_ADDRESS
,
STUN_ATTRIBUTE_OLD_CHANGE_REQUEST
,
STUN_ATTRIBUTE_OLD_SOURCE_ADDRESS
,
STUN_ATTRIBUTE_OLD_CHANGED_ADDRESS
,
STUN_ATTRIBUTE_USERNAME
,
STUN_ATTRIBUTE_OLD_PASSWORD
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
STUN_ATTRIBUTE_ERROR_CODE
,
STUN_ATTRIBUTE_UNKNOWN_ATTRIBUTES
,
STUN_ATTRIBUTE_OLD_REFLECTED_FROM
,
STUN_ATTRIBUTE_LIFETIME
,
STUN_ATTRIBUTE_BANDWIDTH
,
STUN_ATTRIBUTE_REMOTE_ADDRESS
,
STUN_ATTRIBUTE_DATA
,
STUN_ATTRIBUTE_REALM
,
STUN_ATTRIBUTE_NONCE
,
STUN_ATTRIBUTE_RELAY_ADDRESS
,
STUN_ATTRIBUTE_REQUESTED_ADDRESS_TYPE
,
STUN_ATTRIBUTE_REQUESTED_PORT_PROPS
,
STUN_ATTRIBUTE_REQUESTED_TRANSPORT
,
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
,
STUN_ATTRIBUTE_TIMER_VAL
,
STUN_ATTRIBUTE_REQUESTED_IP
,
STUN_ATTRIBUTE_CONNECT_STAT
,
STUN_ATTRIBUTE_PRIORITY
,
STUN_ATTRIBUTE_USE_CANDIDATE
,
STUN_ATTRIBUTE_XOR_INTERNAL_ADDRESS
,
0
};
typedef
uint8_t
stun_transid_t
[
STUN_MESSAGE_TRANS_ID_LEN
];
typedef
uint8_t
stun_transid_t
[
STUN_MESSAGE_TRANS_ID_LEN
];
...
...
stun/tools/bind.c
View file @
c7072612
...
@@ -63,17 +63,6 @@ struct stun_bind_s
...
@@ -63,17 +63,6 @@ struct stun_bind_s
StunAgent
agent
;
StunAgent
agent
;
};
};
static
const
uint16_t
known_attributes
[]
=
{
STUN_ATTRIBUTE_MAPPED_ADDRESS
,
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS
,
STUN_ATTRIBUTE_XOR_INTERNAL_ADDRESS
,
STUN_ATTRIBUTE_PRIORITY
,
STUN_ATTRIBUTE_USE_CANDIDATE
,
STUN_ATTRIBUTE_USERNAME
,
STUN_ATTRIBUTE_MESSAGE_INTEGRITY
,
STUN_ATTRIBUTE_ERROR_CODE
,
0
};
/** Initialization/deinitization */
/** Initialization/deinitization */
...
@@ -112,7 +101,7 @@ stun_bind_alloc (stun_bind_t **restrict context, int fd,
...
@@ -112,7 +101,7 @@ stun_bind_alloc (stun_bind_t **restrict context, int fd,
return
val
;
return
val
;
}
}
stun_agent_init
(
&
ctx
->
agent
,
known_attributes
,
stun_agent_init
(
&
ctx
->
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_3489BIS
,
STUN_COMPATIBILITY_3489BIS
,
STUN_AGENT_USAGE_ADD_SERVER
);
STUN_AGENT_USAGE_ADD_SERVER
);
...
@@ -265,7 +254,7 @@ stun_bind_keepalive (int fd, const struct sockaddr *restrict srv,
...
@@ -265,7 +254,7 @@ stun_bind_keepalive (int fd, const struct sockaddr *restrict srv,
StunAgent
agent
;
StunAgent
agent
;
StunMessage
msg
;
StunMessage
msg
;
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
agent
,
STUN_ALL_KNOWN_ATTRIBUTES
,
STUN_COMPATIBILITY_3489BIS
,
STUN_COMPATIBILITY_3489BIS
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
STUN_AGENT_USAGE_USE_FINGERPRINT
);
stun_agent_init_indication
(
&
agent
,
&
msg
,
stun_agent_init_indication
(
&
agent
,
&
msg
,
...
...
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