blob: 987e2311950dc98a43a461115c2fbb2bef2021c0 [file] [log] [blame]
Andrei Litvinb5a8d9c2023-06-19 11:32:58 -04001/*
2 * Copyright (c) 2023 Project CHIP Authors
3 * All rights reserved.
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 * limitations under the License.
16 */
17#pragma once
18
19#include <lib/support/Span.h>
20#include <transport/Session.h>
21#include <transport/raw/MessageHeader.h>
achaulk-googc4699cf2024-04-25 08:55:56 -040022#include <transport/raw/PeerAddress.h>
Andrei Litvinb5a8d9c2023-06-19 11:32:58 -040023
24namespace chip {
25namespace Tracing {
26
27/// Concrete definitions of the message tracing info that session managers
28/// report
29
30enum class OutgoingMessageType
31{
32 kGroupMessage,
33 kSecureSession,
34 kUnauthenticated,
35};
36
37/// A message is about to be sent
38struct MessageSendInfo
39{
40 OutgoingMessageType messageType;
41 const PayloadHeader * payloadHeader;
42 const PacketHeader * packetHeader;
43 const chip::ByteSpan payload;
44};
45
46enum class IncomingMessageType
47{
48 kGroupMessage,
49 kSecureUnicast,
50 kUnauthenticated,
51};
52
53/// A message has been received
54struct MessageReceivedInfo
55{
56 const IncomingMessageType messageType;
57 const PayloadHeader * payloadHeader;
58 const PacketHeader * packetHeader;
59 const Transport::Session * session;
60 const Transport::PeerAddress * peerAddress;
61 const chip::ByteSpan payload;
62};
63
64} // namespace Tracing
65} // namespace chip