Commit 76a23767 authored by Dafydd Harries's avatar Dafydd Harries
Browse files

better support for dumping unrecognised STUN messages

darcs-hash:20070202091809-c9803-5335f39c00adb89e42e165cbecfe8d06014914c8.gz
parent e98392a6
......@@ -22,6 +22,7 @@ check_PROGRAMS = \
test-attribute-unpack-wrong-length \
test-message-pack \
test-message-dump \
test-message-dump-unknown \
test-message-unpack
test_attribute_pack_LDADD = libstun.la
......@@ -33,6 +34,7 @@ test_attribute_unpack_unknown_LDADD = libstun.la
test_attribute_unpack_wrong_length_LDADD = libstun.la
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
TESTS = $(check_PROGRAMS)
......
......@@ -318,7 +318,7 @@ stun_message_dump (StunMessage *msg)
name = "BINDING-RESPONSE";
break;
default:
return NULL;
name = "(UNKNOWN)";
}
g_string_printf (tmp,
......
#include <string.h>
#include "stun.h"
int
main (void)
{
StunMessage *msg;
gchar *dump;
msg = stun_message_new (0xffff, NULL, 0);
dump = stun_message_dump (msg);
g_assert (0 == strcmp (dump,
"(UNKNOWN) 00000000:00000000:00000000:00000000\n"));
stun_message_free (msg);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment