Commit 8982db7a authored by Dafydd Harries's avatar Dafydd Harries
Browse files

remove stun_message_binding_request_new

darcs-hash:20070202092645-c9803-738bd2844f7171bba65a7c1ec025e4ecbf48ae01.gz
parent 76a23767
...@@ -58,7 +58,7 @@ main (int argc, char **argv) ...@@ -58,7 +58,7 @@ main (int argc, char **argv)
sock = socket (AF_INET, SOCK_DGRAM, 0); sock = socket (AF_INET, SOCK_DGRAM, 0);
connect (sock, (struct sockaddr *) &sin, sizeof (struct sockaddr)); connect (sock, (struct sockaddr *) &sin, sizeof (struct sockaddr));
msg = stun_message_binding_request_new (); msg = stun_message_new (STUN_MESSAGE_BINDING_REQUEST, NULL, 0);
length = stun_message_pack (msg, &packed); length = stun_message_pack (msg, &packed);
#ifdef DEBUG #ifdef DEBUG
......
...@@ -203,12 +203,6 @@ stun_message_new (guint type, gchar *id, guint n_attributes) ...@@ -203,12 +203,6 @@ stun_message_new (guint type, gchar *id, guint n_attributes)
return msg; return msg;
} }
StunMessage *
stun_message_binding_request_new ()
{
return stun_message_new (STUN_MESSAGE_BINDING_REQUEST, NULL, 0);
}
void void
stun_message_free (StunMessage *msg) stun_message_free (StunMessage *msg)
{ {
......
...@@ -106,10 +106,6 @@ G_GNUC_WARN_UNUSED_RESULT ...@@ -106,10 +106,6 @@ G_GNUC_WARN_UNUSED_RESULT
StunMessage * StunMessage *
stun_message_new (guint type, gchar *id, guint n_attributes); stun_message_new (guint type, gchar *id, guint n_attributes);
G_GNUC_WARN_UNUSED_RESULT
StunMessage *
stun_message_binding_request_new (void);
void void
stun_message_free (StunMessage *msg); stun_message_free (StunMessage *msg);
G_GNUC_WARN_UNUSED_RESULT G_GNUC_WARN_UNUSED_RESULT
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
int int
main (void) main (void)
{ {
StunMessage *msg = stun_message_binding_request_new (); StunMessage *msg;
gchar *dump; gchar *dump;
msg->attributes = g_malloc0 (2 * sizeof (StunAttribute *)); msg = stun_message_new (STUN_MESSAGE_BINDING_REQUEST, NULL, 1);
msg->attributes[0] = stun_attribute_mapped_address_new (0x02030405, 2345); msg->attributes[0] = stun_attribute_mapped_address_new (0x02030405, 2345);
dump = stun_message_dump (msg); dump = stun_message_dump (msg);
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
int int
main (void) main (void)
{ {
StunMessage *msg = stun_message_binding_request_new (); StunMessage *msg;
gchar *packed; gchar *packed;
guint length; guint length;
msg = stun_message_new (STUN_MESSAGE_BINDING_REQUEST, NULL, 1);
memcpy (msg->transaction_id, memcpy (msg->transaction_id,
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 16); "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 16);
msg->attributes = g_malloc0 (2 * sizeof (StunAttribute *));
msg->attributes[0] = stun_attribute_mapped_address_new (0x02030405, 2345); msg->attributes[0] = stun_attribute_mapped_address_new (0x02030405, 2345);
length = stun_message_pack (msg, &packed); length = stun_message_pack (msg, &packed);
......
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