3 * Copyright (c) 2020-2021 Project CHIP Authors
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * This file defines flags for messaging layer.
27 #include <support/BitFlags.h>
34 * Flags associated with a inbound or outbound CHIP message.
36 * The values defined here are for use within the ChipMessageInfo.Flags field.
38 enum class MessageFlagValues : uint32_t
40 /**< Indicates that the existing source node identifier must be reused. */
41 kReuseSourceId = 0x00000020,
42 /**< Indicates that the CHIP message is already encoded. */
43 kMessageEncoded = 0x00001000,
44 /**< Indicates that default IPv6 source address selection should be used when sending IPv6 multicast messages. */
45 kDefaultMulticastSourceAddress = 0x00002000,
46 /**< Indicates that the sender of the message requested an acknowledgment. */
47 kPeerRequestedAck = 0x00004000,
48 /**< Indicates that the message is a duplicate of a previously received message. */
49 kDuplicateMessage = 0x00008000,
50 /**< Indicates that the peer's group key message counter is not synchronized. */
51 kPeerGroupMsgIdNotSynchronized = 0x00010000,
52 /**< Indicates that the source of the message is the initiator of the CHIP exchange. */
53 kFromInitiator = 0x00020000,
54 /**< Indicates that message is being sent/received via the local ephemeral UDP port. */
55 kViaEphemeralUDPPort = 0x00040000,
58 using MessageFlags = BitFlags<MessageFlagValues>;
60 enum class SendMessageFlags : uint16_t
63 /**< Used to indicate that automatic retransmission is enabled. */
64 kAutoRetrans = 0x0001,
65 /**< Used to indicate that a response is expected within a specified timeout. */
66 kExpectResponse = 0x0002,
67 /**< Used to indicate that the source node ID in the message header can be reused. */
68 kReuseSourceId = 0x0020,
69 /**< Used to indicate that the message is already encoded. */
70 kAlreadyEncoded = 0x0080,
71 /**< Used to indicate that default IPv6 source address selection should be used when sending IPv6 multicast messages. */
72 kDefaultMulticastSourceAddress = 0x0100,
73 /**< Used to indicate that the current message is the initiator of the exchange. */
74 kFromInitiator = 0x0200,
75 /**< Suppress the auto-request acknowledgment feature when sending a message. */
76 kNoAutoRequestAck = 0x0400,
79 using SendFlags = BitFlags<SendMessageFlags>;
81 } // namespace Messaging