Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Sep 2, 2021
1 parent f85b437 commit fee7323
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
14 changes: 10 additions & 4 deletions src/transport/SecureSessionMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ CHIP_ERROR SecureSessionMgr::PrepareMessage(SessionHandle session, PayloadHeader
MessageCounter & counter = GetSendCounterForPacket(payloadHeader, *state);
ReturnErrorOnFailure(SecureMessageCodec::Encode(state, payloadHeader, packetHeader, message, counter));

ChipLogProgress(Inet, "Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32 " on exchange %d with MessageId %" PRIu32 ".",
ChipLogProgress(Inet,
"Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32
" on exchange %d with MessageId %" PRIu32 ".",
"encrypted", &preparedMessage, ChipLogValueX64(state->GetPeerNodeId()), payloadHeader.GetMessageType(),
payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(), packetHeader.GetMessageId());
payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(),
packetHeader.GetMessageId());
}
else
{
Expand All @@ -136,9 +139,12 @@ CHIP_ERROR SecureSessionMgr::PrepareMessage(SessionHandle session, PayloadHeader

packetHeader.SetMessageId(messageId);

ChipLogProgress(Inet, "Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32 " on exchange %d with MessageId %" PRIu32 ".",
ChipLogProgress(Inet,
"Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32
" on exchange %d with MessageId %" PRIu32 ".",
"plaintext", &preparedMessage, ChipLogValueX64(kUndefinedNodeId), payloadHeader.GetMessageType(),
payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(), packetHeader.GetMessageId());
payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(),
packetHeader.GetMessageId());
}

ReturnErrorOnFailure(packetHeader.EncodeBeforeData(message));
Expand Down
21 changes: 11 additions & 10 deletions src/transport/UnauthenticatedSessionTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,20 @@ class UnauthenticatedSessionTable

static bool MatchPeerAddress(const PeerAddress & a1, const PeerAddress & a2)
{
if (a1.GetTransportType() != a2.GetTransportType()) return false;
if (a1.GetTransportType() != a2.GetTransportType())
return false;

switch (a1.GetTransportType())
{
case Transport::Type::kUndefined:
return false;
case Transport::Type::kUdp:
case Transport::Type::kTcp:
// Ingore interface in the address
return a1.GetIPAddress() == a2.GetIPAddress() && a1.GetPort() == a2.GetPort();
case Transport::Type::kBle:
// TODO: complete BLE address comparation
return true;
case Transport::Type::kUndefined:
return false;
case Transport::Type::kUdp:
case Transport::Type::kTcp:
// Ingore interface in the address
return a1.GetIPAddress() == a2.GetIPAddress() && a1.GetPort() == a2.GetPort();
case Transport::Type::kBle:
// TODO: complete BLE address comparation
return true;
}

return false;
Expand Down

0 comments on commit fee7323

Please sign in to comment.