[Nice] [nice/master] Replace the SERVER attribute with the SOFTWARE attribute per draft 17

Olivier Crête olivier.crete at collabora.co.uk
Wed Nov 5 14:02:16 PST 2008


---
 stun/stun3489bis.c |    8 ++++----
 stun/stun3489bis.h |    2 +-
 stun/stunagent.c   |    8 ++++----
 stun/stunagent.h   |    2 +-
 stun/stunmessage.h |    2 +-
 stun/tools/stund.c |    2 +-
 stun/usages/bind.c |    2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/stun/stun3489bis.c b/stun/stun3489bis.c
index 53518da..266c8af 100644
--- a/stun/stun3489bis.c
+++ b/stun/stun3489bis.c
@@ -74,10 +74,10 @@ bool stun_has_cookie (const StunMessage *msg)
 }
 
 
-int stun_message_append_server (StunMessage *msg)
+int stun_message_append_software (StunMessage *msg)
 {
-  static const char server[] = PACKAGE_STRING;
-  // assert (strlen (server) < 128);
+  static const char software[] = PACKAGE_STRING;
+  // assert (strlen (software) < 128);
 
-  return stun_message_append_string (msg, STUN_ATTRIBUTE_SERVER, server);
+  return stun_message_append_string (msg, STUN_ATTRIBUTE_SOFTWARE, software);
 }
diff --git a/stun/stun3489bis.h b/stun/stun3489bis.h
index 1562839..aad784f 100644
--- a/stun/stun3489bis.h
+++ b/stun/stun3489bis.h
@@ -56,7 +56,7 @@ uint32_t stun_fingerprint (const uint8_t *msg, size_t len);
 
 bool stun_has_cookie (const StunMessage *msg);
 
-int stun_message_append_server (StunMessage *msg);
+int stun_message_append_software (StunMessage *msg);
 
 
 #endif /* _STUN_3489BIS_H */
diff --git a/stun/stunagent.c b/stun/stunagent.c
index 2b8c8dc..9377c37 100644
--- a/stun/stunagent.c
+++ b/stun/stunagent.c
@@ -354,8 +354,8 @@ bool stun_agent_init_response (StunAgent *agent, StunMessage *msg,
           stun_message_get_method (request), id)) {
 
     if (agent->compatibility == STUN_COMPATIBILITY_3489BIS &&
-      agent->usage_flags & STUN_AGENT_USAGE_ADD_SERVER) {
-      stun_message_append_server (msg);
+      agent->usage_flags & STUN_AGENT_USAGE_ADD_SOFTWARE) {
+      stun_message_append_software (msg);
     }
     return TRUE;
   }
@@ -386,8 +386,8 @@ bool stun_agent_init_error (StunAgent *agent, StunMessage *msg,
           stun_message_get_method (request), id)) {
 
     if (agent->compatibility == STUN_COMPATIBILITY_3489BIS &&
-      agent->usage_flags & STUN_AGENT_USAGE_ADD_SERVER) {
-      stun_message_append_server (msg);
+      agent->usage_flags & STUN_AGENT_USAGE_ADD_SOFTWARE) {
+      stun_message_append_software (msg);
     }
     if (stun_message_append_error (msg, err) == 0) {
       return TRUE;
diff --git a/stun/stunagent.h b/stun/stunagent.h
index b97c1ab..6712dcd 100644
--- a/stun/stunagent.h
+++ b/stun/stunagent.h
@@ -82,7 +82,7 @@ typedef enum {
 #define STUN_AGENT_USAGE_SHORT_TERM_CREDENTIALS 	0x0001
 #define STUN_AGENT_USAGE_LONG_TERM_CREDENTIALS 		0x0002
 #define STUN_AGENT_USAGE_USE_FINGERPRINT 		0x0004
-#define STUN_AGENT_USAGE_ADD_SERVER 			0x0008
+#define STUN_AGENT_USAGE_ADD_SOFTWARE 			0x0008
 #define STUN_AGENT_USAGE_IGNORE_CREDENTIALS		0x0010
 #define STUN_AGENT_USAGE_FORCE_VALIDATER		0x0020
 
diff --git a/stun/stunmessage.h b/stun/stunmessage.h
index def2a6d..5df0678 100644
--- a/stun/stunmessage.h
+++ b/stun/stunmessage.h
@@ -122,7 +122,7 @@ typedef enum
 
   /* Optional attributes */
   /* 0x8000-0x8021 */      /* reserved */
-  STUN_ATTRIBUTE_SERVER=0x8022,      /* RFC3489bis-11 */
+  STUN_ATTRIBUTE_SOFTWARE=0x8022,      /* RFC3489bis-17 */
   STUN_ATTRIBUTE_ALTERNATE_SERVER=0x8023,    /* RFC3489bis-11 */
   STUN_ATTRIBUTE_REFRESH_INTERVAL=0x8024,    /* wing-nat-control-04 */
   /* 0x8025 */        /* reserved */
diff --git a/stun/tools/stund.c b/stun/tools/stund.c
index 43d5ce6..b1f965e 100644
--- a/stun/tools/stund.c
+++ b/stun/tools/stund.c
@@ -265,7 +265,7 @@ static int run (int family, int protocol, unsigned port)
 
 
   stun_agent_init (&agent, known_attributes,
-      STUN_COMPATIBILITY_3489BIS, STUN_AGENT_USAGE_ADD_SERVER |
+      STUN_COMPATIBILITY_3489BIS, STUN_AGENT_USAGE_ADD_SOFTWARE |
       STUN_AGENT_USAGE_USE_FINGERPRINT);
 
   for (;;)
diff --git a/stun/usages/bind.c b/stun/usages/bind.c
index 24772b9..a4f76f0 100644
--- a/stun/usages/bind.c
+++ b/stun/usages/bind.c
@@ -168,7 +168,7 @@ StunUsageBindReturn stun_usage_bind_run (const struct sockaddr *srv,
 
   stun_agent_init (&agent, STUN_ALL_KNOWN_ATTRIBUTES,
       STUN_COMPATIBILITY_3489BIS,
-      STUN_AGENT_USAGE_ADD_SERVER |
+      STUN_AGENT_USAGE_ADD_SOFTWARE |
       STUN_AGENT_USAGE_USE_FINGERPRINT);
 
   len = stun_usage_bind_create (&agent, &req, req_buf, sizeof(req_buf));
-- 
1.5.6.5




More information about the Nice mailing list