summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/SUdpServerControlChannel.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/SUdpServerControlChannel.h')
-rw-r--r--cpp/src/Ice/SUdpServerControlChannel.h145
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
+