summaryrefslogtreecommitdiffstats
path: root/lib/libtdekrb/src/tdekrbsocket.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-18 02:14:12 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-18 02:14:12 -0500
commit35dc01b709fc5f201ac02e68c026c5a500333a65 (patch)
treed2b83341836d5addb8360b867e9522823930a98c /lib/libtdekrb/src/tdekrbsocket.h
parent0e11c4ce6d21acd0139345c19b6341971e679b23 (diff)
downloadulab-35dc01b709fc5f201ac02e68c026c5a500333a65.tar.gz
ulab-35dc01b709fc5f201ac02e68c026c5a500333a65.zip
Added common directories
Diffstat (limited to 'lib/libtdekrb/src/tdekrbsocket.h')
-rw-r--r--lib/libtdekrb/src/tdekrbsocket.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/libtdekrb/src/tdekrbsocket.h b/lib/libtdekrb/src/tdekrbsocket.h
new file mode 100644
index 0000000..591b579
--- /dev/null
+++ b/lib/libtdekrb/src/tdekrbsocket.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * kb9vqf@pearsoncomputing.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef TDEKRBSOCKET_H
+#define TDEKRBSOCKET_H
+
+#include <tqsocket.h>
+
+#define N_CALLBACKS 3
+
+class SASLDataPrivate;
+
+class TDEKerberosClientSocket : public TQSocket
+{
+ Q_OBJECT
+
+ public:
+ TDEKerberosClientSocket(TQObject *parent=0, const char *name=0);
+ virtual ~TDEKerberosClientSocket();
+
+ bool open(int mode);
+ void close();
+ Q_LONG readBlock(char *data, Q_ULONG maxlen);
+ Q_LONG writeBlock(const char *data, Q_ULONG len);
+ Q_LONG readLine(char *data, Q_ULONG maxlen);
+ TQString readLine();
+ void writeLine(TQString);
+
+ int setUsingKerberos(bool krbactive);
+ void setServiceName(TQString name);
+ void setServerFQDN(TQString name);
+
+ private:
+ int initializeKerberosInterface();
+ void freeKerberosConnection();
+ void sendSASLDataToNetwork(const char *buffer, unsigned length, int netfd);
+ unsigned int getSASLDataFromNetwork(char *buf, int trunclen);
+ int transmitEncryptedData(int fd, const char* readbuf, int cc);
+ int receiveEncryptedData(char *buf, int trunclen);
+
+ private:
+ bool m_kerberosRequested;
+ TQString m_serviceName;
+ TQString m_serverFQDN;
+
+ private:
+ SASLDataPrivate *saslData;
+};
+
+#endif // TDEKRBSOCKET_H \ No newline at end of file