3 * Copyright (c) 2020-2021 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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
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>
31 class TransportMgrDelegate;
33 class TransportMgrBase : public Transport::RawTransportDelegate
36 CHIP_ERROR Init(Transport::Base * transport);
38 CHIP_ERROR SendMessage(const PacketHeader & header, const Transport::PeerAddress & address,
39 System::PacketBufferHandle && msgBuf);
41 void Disconnect(const Transport::PeerAddress & address);
43 void SetSecureSessionMgr(TransportMgrDelegate * secureSessionMgr) { mSecureSessionMgr = secureSessionMgr; }
45 void SetRendezvousSession(TransportMgrDelegate * rendezvousSessionMgr) { mRendezvous = rendezvousSessionMgr; }
47 void HandleMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress,
48 System::PacketBufferHandle msg) override;
51 TransportMgrDelegate * mSecureSessionMgr = nullptr;
52 TransportMgrDelegate * mRendezvous = nullptr;
53 Transport::Base * mTransport = nullptr;