Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / inet / InetLayerEvents.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2013-2017 Nest Labs, Inc.
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 enumerates and defines the different types of events
22  *      generated at the Inet layer.
23  *
24  */
25
26 #pragma once
27
28 #include <inet/InetConfig.h>
29
30 #include <system/SystemEvent.h>
31
32 #if CHIP_SYSTEM_CONFIG_USE_LWIP
33
34 namespace chip {
35 namespace Inet {
36
37 /**
38  *   The Inet layer event type definitions.
39  *
40  */
41 enum
42 {
43     kInetEvent_TCPConnectComplete    = _INET_CONFIG_EVENT(0), /**< The event for TCP connection completion */
44     kInetEvent_TCPConnectionReceived = _INET_CONFIG_EVENT(1), /**< The event for TCP connection reception */
45     kInetEvent_TCPDataReceived       = _INET_CONFIG_EVENT(2), /**< The event for data reception over a TCP connection */
46     kInetEvent_TCPDataSent           = _INET_CONFIG_EVENT(3), /**< The event for data transmission over a TCP connection */
47     kInetEvent_TCPError              = _INET_CONFIG_EVENT(4), /**< The event for an error on a TCP connection */
48     kInetEvent_UDPDataReceived       = _INET_CONFIG_EVENT(5), /**< The event for data reception over UDP */
49     kInetEvent_DNSResolveComplete    = _INET_CONFIG_EVENT(6), /**< The event for DNS name resolution completion */
50     kInetEvent_RawDataReceived       = _INET_CONFIG_EVENT(7)  /**< The event for data reception over an InetLayer raw endpoint */
51 };
52
53 /**
54  *  Check to verify if a System::EventType is a valid Inet layer event type.
55  *
56  *  @param[in]  aType  A chip System Layer event type.
57  *
58  *  @return true if it falls within the enumerated range; otherwise, false.
59  *
60  */
61 static inline bool INET_IsInetEvent(chip::System::EventType aType)
62 {
63     return (aType >= kInetEvent_TCPConnectComplete && aType <= kInetEvent_RawDataReceived);
64 }
65
66 } // namespace Inet
67 } // namespace chip
68
69 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP