summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/SUdpClient.cpp
blob: cd6fe898fe51eac8c5f424986317c56934a98a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#include <Ice/SUdpClient.h>
#include <Ice/CryptKey.h>
#include <Ice/MessageAuthenticator.h>

using Ice::Long;
using IceSecurity::SecureUdp::CryptKeyPtr;
using IceSecurity::SecureUdp::MessageAuthenticatorPtr;

void ::IceInternal::incRef(::IceSecurity::SecureUdp::SUdpClient* p) { p->__incRef(); }
void ::IceInternal::decRef(::IceSecurity::SecureUdp::SUdpClient* p) { p->__decRef(); }

IceSecurity::SecureUdp::SUdpClient::SUdpClient(Long clientID,
                                               const ClientChannelPtr& clientChannel,
                                               const MessageAuthenticatorPtr& messageAuthenticator) :
                                   _clientID(clientID),
                                   _clientChannel(clientChannel),
                                   _messageAuthenticator(messageAuthenticator)
{
}

IceSecurity::SecureUdp::SUdpClient::~SUdpClient()
{
}

void
IceSecurity::SecureUdp::SUdpClient::serverHello(const CryptKeyPtr& key)
{
    _clientChannel->serverHello(_clientID, key->toByteSeq());
}

void
IceSecurity::SecureUdp::SUdpClient::serverKeyChange(const CryptKeyPtr& key)
{
    _clientChannel->serverKeyChange(key->toByteSeq());
}

void
IceSecurity::SecureUdp::SUdpClient::serverGoodbye()
{
    _clientChannel->serverGoodbye();
}

Long
IceSecurity::SecureUdp::SUdpClient::getClientID() const
{
    return _clientID;
}

const CryptKeyPtr&
IceSecurity::SecureUdp::SUdpClient::getCryptKey() const
{
    return _cryptKey;
}

const CryptKeyPtr&
IceSecurity::SecureUdp::SUdpClient::getCryptKey(Long msgID) const
{
    // TODO: Must be able to return a CryptKey based on a msgID
    return _cryptKey;
}

const MessageAuthenticatorPtr&
IceSecurity::SecureUdp::SUdpClient::getMessageAuthenticator() const
{
    return _messageAuthenticator;
}

void
IceSecurity::SecureUdp::SUdpClient::setNewCryptKey(Long msgID, const CryptKeyPtr& cryptKey)
{
    _cryptKey = cryptKey;
}