summaryrefslogtreecommitdiffstats
path: root/common/rfb/Security.cxx
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-02-01 14:34:55 +0000
committerAdam Tkac <atkac@redhat.com>2011-02-01 14:34:55 +0000
commita9a7b4b34a6b586312f7f253ba07f2b8f0531399 (patch)
tree8915bae71513d47cca2eb325d76617055bf48333 /common/rfb/Security.cxx
parent98bf0e9c15b3a752ff4ae825834f10618a8d8b53 (diff)
downloadtigervnc-a9a7b4b34a6b586312f7f253ba07f2b8f0531399.tar.gz
tigervnc-a9a7b4b34a6b586312f7f253ba07f2b8f0531399.zip
[Development] Add Security::ToString method
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4245 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/Security.cxx')
-rw-r--r--common/rfb/Security.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx
index cbc72aef..dba14fdb 100644
--- a/common/rfb/Security.cxx
+++ b/common/rfb/Security.cxx
@@ -108,6 +108,30 @@ bool Security::IsSupported(U32 secType)
return false;
}
+char *Security::ToString(void)
+{
+ list<U32>::iterator i;
+ static char out[128]; /* Should be enough */
+ bool firstpass = true;
+ const char *name;
+
+ memset(out, 0, sizeof(out));
+
+ for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) {
+ name = secTypeName(*i);
+ if (name[0] == '[') /* Unknown security type */
+ continue;
+
+ if (!firstpass)
+ strncat(out, ",", sizeof(out) - 1);
+ else
+ firstpass = false;
+ strncat(out, name, sizeof(out) - 1);
+ }
+
+ return out;
+}
+
rdr::U32 rfb::secTypeNum(const char* name)
{
if (strcasecmp(name, "None") == 0) return secTypeNone;