[Development] Define security types as rdr::U8 values.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4034 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/SSecurityFactoryStandard.cxx b/common/rfb/SSecurityFactoryStandard.cxx
index 01f77bf..6056a19 100644
--- a/common/rfb/SSecurityFactoryStandard.cxx
+++ b/common/rfb/SSecurityFactoryStandard.cxx
@@ -65,8 +65,8 @@
     secTypesStr.buf = rev_sec_types.getData();
   else
     secTypesStr.buf = sec_types.getData();
-  std::list<int> configured = parseSecTypes(secTypesStr.buf);
-  std::list<int>::iterator i;
+  std::list<rdr::U8> configured = parseSecTypes(secTypesStr.buf);
+  std::list<rdr::U8>::iterator i;
   for (i=configured.begin(); i!=configured.end(); i++) {
     if (isSecTypeSupported(*i))
       secTypes->push_back(*i);
diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx
index 830d844..67acf5c 100644
--- a/common/rfb/Security.cxx
+++ b/common/rfb/Security.cxx
@@ -22,7 +22,7 @@
 #include <rfb/secTypes.h>
 #include <rfb/util.h>
 
-int rfb::secTypeNum(const char* name)
+rdr::U8 rfb::secTypeNum(const char* name)
 {
   if (strcasecmp(name, "None") == 0)       return secTypeNone;
   if (strcasecmp(name, "VncAuth") == 0)    return secTypeVncAuth;
@@ -34,7 +34,7 @@
   return secTypeInvalid;
 }
 
-const char* rfb::secTypeName(int num)
+const char* rfb::secTypeName(rdr::U8 num)
 {
   switch (num) {
   case secTypeNone:       return "None";
@@ -48,7 +48,7 @@
   }
 }
 
-bool rfb::secTypeEncrypts(int num)
+bool rfb::secTypeEncrypts(rdr::U8 num)
 {
   switch (num) {
   case secTypeRA2:
@@ -59,13 +59,13 @@
   }
 }
 
-std::list<int> rfb::parseSecTypes(const char* types_)
+std::list<rdr::U8> rfb::parseSecTypes(const char* types_)
 {
-  std::list<int> result;
+  std::list<rdr::U8> result;
   CharArray types(strDup(types_)), type;
   while (types.buf) {
     strSplit(types.buf, ',', &type.buf, &types.buf);
-    int typeNum = secTypeNum(type.buf);
+    rdr::U8 typeNum = secTypeNum(type.buf);
     if (typeNum != secTypeInvalid)
       result.push_back(typeNum);
   }
diff --git a/common/rfb/Security.h b/common/rfb/Security.h
index 3cf783b..d890d56 100644
--- a/common/rfb/Security.h
+++ b/common/rfb/Security.h
@@ -22,33 +22,34 @@
 #ifndef __RFB_SECTYPES_H__
 #define __RFB_SECTYPES_H__
 
+#include <rdr/types.h>
 #include <list>
 
 namespace rfb {
-  const int secTypeInvalid = 0;
-  const int secTypeNone    = 1;
-  const int secTypeVncAuth = 2;
+  const rdr::U8 secTypeInvalid = 0;
+  const rdr::U8 secTypeNone    = 1;
+  const rdr::U8 secTypeVncAuth = 2;
 
-  const int secTypeRA2     = 5;
-  const int secTypeRA2ne   = 6;
+  const rdr::U8 secTypeRA2     = 5;
+  const rdr::U8 secTypeRA2ne   = 6;
 
-  const int secTypeSSPI    = 7;
-  const int secTypeSSPIne    = 8;
+  const rdr::U8 secTypeSSPI    = 7;
+  const rdr::U8 secTypeSSPIne    = 8;
 
-  const int secTypeTight   = 16;
-  const int secTypeUltra   = 17;
-  const int secTypeTLS     = 18;
+  const rdr::U8 secTypeTight   = 16;
+  const rdr::U8 secTypeUltra   = 17;
+  const rdr::U8 secTypeTLS     = 18;
 
   // result types
 
-  const int secResultOK = 0;
-  const int secResultFailed = 1;
-  const int secResultTooMany = 2; // deprecated
+  const rdr::U32 secResultOK = 0;
+  const rdr::U32 secResultFailed = 1;
+  const rdr::U32 secResultTooMany = 2; // deprecated
 
-  const char* secTypeName(int num);
-  int secTypeNum(const char* name);
-  bool secTypeEncrypts(int num);
-  std::list<int> parseSecTypes(const char* types);
+  const char* secTypeName(rdr::U8 num);
+  rdr::U8 secTypeNum(const char* name);
+  bool secTypeEncrypts(rdr::U8 num);
+  std::list<rdr::U8> parseSecTypes(const char* types);
 }
 
 #endif