Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'utils/x11_identify_auth_proto.c')
-rw-r--r--utils/x11_identify_auth_proto.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/x11_identify_auth_proto.c b/utils/x11_identify_auth_proto.c
new file mode 100644
index 00000000..46e26dc0
--- /dev/null
+++ b/utils/x11_identify_auth_proto.c
@@ -0,0 +1,17 @@
+/*
+ * Utility function to convert a textual representation of an X11
+ * auth protocol name into our integer protocol ids.
+ */
+
+#include "putty.h"
+#include "ssh.h"
+
+int x11_identify_auth_proto(ptrlen protoname)
+{
+ int protocol;
+
+ for (protocol = 1; protocol < lenof(x11_authnames); protocol++)
+ if (ptrlen_eq_string(protoname, x11_authnames[protocol]))
+ return protocol;
+ return -1;
+}