diff options
author | Anthony Neal <aneal@zeroc.com> | 2002-01-21 18:25:23 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2002-01-21 18:25:23 +0000 |
commit | af55fcdcfb0857a3516f30fb61176ffe9bc31110 (patch) | |
tree | d92b8bd808ab3f6420e2733295024d1fbf6a1d7b /cpp/src/Ice/SUdpServerControlChannel.h | |
parent | adding server; removing wstring (diff) | |
download | ice-af55fcdcfb0857a3516f30fb61176ffe9bc31110.tar.bz2 ice-af55fcdcfb0857a3516f30fb61176ffe9bc31110.tar.xz ice-af55fcdcfb0857a3516f30fb61176ffe9bc31110.zip |
Update of SUDP (Secure UDP) related code. SUDP is still not active, but
compiles as is under Linux and Windows.
Diffstat (limited to 'cpp/src/Ice/SUdpServerControlChannel.h')
-rw-r--r-- | cpp/src/Ice/SUdpServerControlChannel.h | 145 |
1 files changed, 92 insertions, 53 deletions
diff --git a/cpp/src/Ice/SUdpServerControlChannel.h b/cpp/src/Ice/SUdpServerControlChannel.h index 7a403caf918..10b0a88ecb4 100644 --- a/cpp/src/Ice/SUdpServerControlChannel.h +++ b/cpp/src/Ice/SUdpServerControlChannel.h @@ -1,53 +1,92 @@ -// ********************************************************************** -// -// Copyright (c) 2002 -// MutableRealms, Inc. -// Huntsville, AL, USA -// -// All Rights Reserved -// -// ********************************************************************** - -#ifndef ICE_SUDP_SERVER_CONTROL_CHANNEL_H -#define ICE_SUDP_SERVER_CONTROL_CHANNEL_H - -#include <Ice/SUdpControlChannel.h> -#include <Ice/SecureUdp.h> - -namespace IceSecurity -{ - -namespace SecureUdp -{ - -using IceInternal::SUdpTransceiver; - -class ServerControlChannel : public ControlChannel, public ServerChannel -{ - -public: - virtual void clientHello(const ClientChannelPtr&, const ::Ice::ByteSeq&, const ::Ice::Current&); - - virtual void clientKeyAcknowledge(::Ice::Long, ::Ice::Long, const ::Ice::Current&); - - virtual void clientKeyRequest(::Ice::Long, const ::Ice::Current&); - - virtual void clientGoodbye(::Ice::Long, const ::Ice::Current&); - -protected: - - ServerControlChannel(const SUdpTransceiverPtr&, const InstancePtr&, int); - - virtual ~ServerControlChannel(); - - friend IceInternal::SUdpTransceiver; - - int _port; - Ice::ObjectAdapterPtr _adapter; -}; - -} - -} - -#endif +// **********************************************************************
+//
+// Copyright (c) 2002
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#ifndef ICE_SUDP_SERVER_CONTROL_CHANNEL_H
+#define ICE_SUDP_SERVER_CONTROL_CHANNEL_H
+
+#include <Ice/SUdpControlChannel.h>
+#include <Ice/SecureUdp.h>
+#include <IceUtil/Mutex.h>
+#include <Ice/Buffer.h>
+#include <Ice/SUdpClientF.h>
+#include <map>
+
+namespace IceInternal
+{
+
+// class SUdpTransceiverPtr;
+
+}
+
+namespace IceSecurity
+{
+
+namespace SecureUdp
+{
+
+// typedef pair<Long, CryptKeyPtr> MsgKeyPair;
+// typedef vector<MsgKeyPair> MsgKeyVector;
+
+// Encryption key and historical list
+// MsgKeyVector _msgEncryptionKeys;
+// MsgKeyPair _currentEncryptionInfo;
+
+using IceInternal::Buffer;
+using IceInternal::SUdpTransceiver;
+using Ice::ObjectAdapterPtr;
+using Ice::Long;
+using Ice::ByteSeq;
+using Ice::Current;
+
+typedef std::map<Long, SUdpClientPtr> SUdpClientMap;
+
+class ServerControlChannel : public ControlChannel, public ServerChannel
+{
+
+public:
+
+ // Messages received from Client
+ virtual void clientHello(const ClientChannelPtr&, const ByteSeq&, const Current&);
+ virtual void clientKeyAcknowledge(Long, Long, const ByteSeq&, const Current&);
+ virtual void clientKeyRequest(Long, const Current&);
+ virtual void clientGoodbye(Long, const Current&);
+
+protected:
+
+ ServerControlChannel(const SUdpTransceiverPtr&, const InstancePtr&, int);
+
+ virtual ~ServerControlChannel();
+
+ friend IceInternal::SUdpTransceiver;
+
+ void decryptPacket(Buffer&, Buffer&);
+ Long getNewClientID();
+
+ SUdpClientPtr& getSUdpClient(Long);
+ void newSUdpClient(const SUdpClientPtr&);
+ void deleteSUdpClient(Long);
+
+ ObjectAdapterPtr _adapter;
+
+ // Keep a listing of all clients connected to us.
+ SUdpClientMap _clientMap;
+ Mutex _clientMapMutex;
+
+ // Generate unique Client ID numbers
+ Long _clientIDGenerator;
+ Mutex _clientIDMutex;
+};
+
+}
+
+}
+
+#endif
+
|