Commit 9e5d7436 authored by Dafydd Harries's avatar Dafydd Harries

stun_attribute_username_new

darcs-hash:20070130112714-c9803-7af1e55e269dadfb83fa6447eda28fc41b9c403d.gz
parent fabb0ad0
......@@ -38,6 +38,18 @@ stun_attribute_mapped_address_new (guint32 ip, guint16 port)
return attr;
}
StunAttribute *
stun_attribute_username_new (const gchar *username)
{
StunAttribute *attr;
attr = stun_attribute_new (STUN_ATTRIBUTE_USERNAME);
g_assert (strlen (username) < sizeof (attr->username));
attr->length = strlen (username);
strcpy (attr->username, username);
return attr;
}
void
stun_attribute_free (StunAttribute *attr)
{
......
......@@ -80,6 +80,8 @@ struct _StunMessage {
G_GNUC_WARN_UNUSED_RESULT
StunAttribute *
stun_attribute_mapped_address_new (guint32 ip_address, guint16 port);
StunAttribute *
stun_attribute_username_new (const gchar *username);
void
stun_attribute_free (StunAttribute *attr);
G_GNUC_WARN_UNUSED_RESULT
......
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