-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data logging using the tracing module for message send/receive (#…
…27281) * Add message loging structures and definitions * Run clang-format * Fix a comment * Restyled by clang-format * Fix dependencies in build.gn * Fix compile error for mac .. size_t cannot be easilu converted and we know size fits in a UInt * Fix typo --------- Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
Showing
12 changed files
with
203 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#pragma once | ||
|
||
#include <lib/support/Span.h> | ||
#include <transport/Session.h> | ||
#include <transport/raw/MessageHeader.h> | ||
|
||
namespace chip { | ||
namespace Tracing { | ||
|
||
/// Concrete definitions of the message tracing info that session managers | ||
/// report | ||
|
||
enum class OutgoingMessageType | ||
{ | ||
kGroupMessage, | ||
kSecureSession, | ||
kUnauthenticated, | ||
}; | ||
|
||
/// A message is about to be sent | ||
struct MessageSendInfo | ||
{ | ||
OutgoingMessageType messageType; | ||
const PayloadHeader * payloadHeader; | ||
const PacketHeader * packetHeader; | ||
const chip::ByteSpan payload; | ||
}; | ||
|
||
enum class IncomingMessageType | ||
{ | ||
kGroupMessage, | ||
kSecureUnicast, | ||
kUnauthenticated, | ||
}; | ||
|
||
/// A message has been received | ||
struct MessageReceivedInfo | ||
{ | ||
const IncomingMessageType messageType; | ||
const PayloadHeader * payloadHeader; | ||
const PacketHeader * packetHeader; | ||
const Transport::Session * session; | ||
const Transport::PeerAddress * peerAddress; | ||
const chip::ByteSpan payload; | ||
}; | ||
|
||
} // namespace Tracing | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters