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
b92c102f
Commit
b92c102f
authored
Mar 16, 2007
by
Dafydd Harries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stun_message_find_attribute ()
darcs-hash:20070316024908-c9803-904bbc4e085072d1be34c7f131bb769dd838f6fd.gz
parent
f80aa521
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletion
+41
-1
stun/Makefile.am
stun/Makefile.am
+3
-1
stun/stun.c
stun/stun.c
+14
-0
stun/stun.h
stun/stun.h
+3
-0
stun/test-message-find-attribute.c
stun/test-message-find-attribute.c
+21
-0
No files found.
stun/Makefile.am
View file @
b92c102f
...
...
@@ -25,7 +25,8 @@ check_PROGRAMS = \
test-message-pack
\
test-message-dump
\
test-message-dump-unknown
\
test-message-unpack
test-message-unpack
\
test-message-find-attribute
test_attribute_pack_LDADD
=
libstun.la
test_attribute_pack_unknown_LDADD
=
libstun.la
...
...
@@ -38,6 +39,7 @@ test_message_pack_LDADD = libstun.la
test_message_dump_LDADD
=
libstun.la
test_message_dump_unknown_LDADD
=
libstun.la
test_message_unpack_LDADD
=
libstun.la
test_message_find_attribute_LDADD
=
libstun.la
TESTS
=
$(check_PROGRAMS)
stun/stun.c
View file @
b92c102f
...
...
@@ -338,3 +338,17 @@ stun_message_dump (StunMessage *msg)
return
g_string_free
(
tmp
,
FALSE
);
}
StunAttribute
*
stun_message_find_attribute
(
StunMessage
*
msg
,
StunAttributeType
type
)
{
StunAttribute
**
attr
;
if
(
!
msg
->
attributes
)
return
NULL
;
for
(
attr
=
msg
->
attributes
;
*
attr
;
attr
++
)
if
((
*
attr
)
->
type
==
type
)
return
*
attr
;
return
NULL
;
}
stun/stun.h
View file @
b92c102f
...
...
@@ -123,6 +123,9 @@ G_GNUC_WARN_UNUSED_RESULT
StunMessage
*
stun_message_unpack
(
guint
length
,
const
gchar
*
s
);
StunAttribute
*
stun_message_find_attribute
(
StunMessage
*
msg
,
StunAttributeType
type
);
G_END_DECLS
#endif
/* __STUN_H__ */
...
...
stun/test-message-find-attribute.c
0 → 100644
View file @
b92c102f
#include "stun.h"
int
main
(
void
)
{
StunMessage
*
msg
;
msg
=
stun_message_new
(
STUN_MESSAGE_BINDING_REQUEST
,
NULL
,
1
);
g_assert
(
NULL
==
stun_message_find_attribute
(
msg
,
STUN_ATTRIBUTE_MAPPED_ADDRESS
));
msg
->
attributes
[
0
]
=
stun_attribute_mapped_address_new
(
0x01020304
,
1234
);
g_assert
(
msg
->
attributes
[
0
]
==
stun_message_find_attribute
(
msg
,
STUN_ATTRIBUTE_MAPPED_ADDRESS
));
return
0
;
}
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