From a9a7b4b34a6b586312f7f253ba07f2b8f0531399 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Tue, 1 Feb 2011 14:34:55 +0000 Subject: [Development] Add Security::ToString method git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4245 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/Security.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'common/rfb/Security.cxx') 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::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; -- cgit v1.2.3