Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / transport / TransportMgrBase.h
1 /*
2  *
3  *    Copyright (c) 2020-2021 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  */
16
17 #pragma once
18
19 #include <support/CodeUtils.h>
20 #include <system/SystemPacketBuffer.h>
21 #include <transport/raw/Base.h>
22 #include <transport/raw/MessageHeader.h>
23 #include <transport/raw/PeerAddress.h>
24
25 namespace chip {
26
27 namespace Transport {
28 class Base;
29 }
30
31 class TransportMgrDelegate;
32
33 class TransportMgrBase : public Transport::RawTransportDelegate
34 {
35 public:
36     CHIP_ERROR Init(Transport::Base * transport);
37
38     CHIP_ERROR SendMessage(const PacketHeader & header, const Transport::PeerAddress & address,
39                            System::PacketBufferHandle && msgBuf);
40
41     void Disconnect(const Transport::PeerAddress & address);
42
43     void SetSecureSessionMgr(TransportMgrDelegate * secureSessionMgr) { mSecureSessionMgr = secureSessionMgr; }
44
45     void SetRendezvousSession(TransportMgrDelegate * rendezvousSessionMgr) { mRendezvous = rendezvousSessionMgr; }
46
47     void HandleMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress,
48                                System::PacketBufferHandle msg) override;
49
50 private:
51     TransportMgrDelegate * mSecureSessionMgr = nullptr;
52     TransportMgrDelegate * mRendezvous       = nullptr;
53     Transport::Base * mTransport             = nullptr;
54 };
55
56 } // namespace chip