Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / transport / SessionEstablishmentDelegate.h
1 /*
2  *
3  *    Copyright (c) 2021 Project CHIP Authors
4  *    All rights reserved.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18
19 /**
20  *    @file
21  *      This file defines the Delegate class that contains callbacks to
22  *      establish a secure session and update status of the session establishment process.
23  *
24  */
25
26 #pragma once
27
28 #include <system/SystemPacketBuffer.h>
29 #include <transport/raw/MessageHeader.h>
30 #include <transport/raw/PeerAddress.h>
31
32 namespace chip {
33
34 class DLL_EXPORT SessionEstablishmentDelegate
35 {
36 public:
37     /**
38      * @brief
39      *   Called when the session establishment process generates a new message that should be sent to peer.
40      *
41      * @param header the message header for the sent message
42      * @param peerAddress the destination of the message
43      * @param msgBuf the raw data for the message being sent
44      * @return CHIP_ERROR Error thrown when sending the message
45      *
46      * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468
47      */
48     virtual CHIP_ERROR SendSessionEstablishmentMessage(const PacketHeader & header, const Transport::PeerAddress & peerAddress,
49                                                        System::PacketBufferHandle msgBuf)
50     {
51         return CHIP_ERROR_NOT_IMPLEMENTED;
52     }
53
54     /**
55      * @brief
56      *   Called when session establishment fails with an error
57      *
58      * @param error error code
59      *
60      * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468
61      */
62     virtual void OnSessionEstablishmentError(CHIP_ERROR error) {}
63
64     /**
65      * @brief
66      *   Called when the new secure session has been established
67      *
68      * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468
69      */
70     virtual void OnSessionEstablished() {}
71
72     virtual ~SessionEstablishmentDelegate() {}
73 };
74
75 } // namespace chip