3 * Copyright (c) 2020 Project CHIP Authors
4 * Copyright (c) 2013-2017 Nest Labs, Inc.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 * This file defines constants, globals and interfaces common to
23 * and used by all CHP Inet layer library test applications and
26 * NOTE: These do not comprise a public part of the CHIP API and
27 * are subject to change without notice.
33 #ifndef __STDC_LIMIT_MACROS
34 #define __STDC_LIMIT_MACROS
42 #include <inet/InetLayer.h>
43 #include <support/CodeUtils.h>
44 #include <system/SystemLayer.h>
46 #define CHIP_TOOL_COPYRIGHT "Copyright (c) 2020 Project CHIP Authors\nAll rights reserved.\n"
48 #define INET_FAIL_ERROR(ERR, MSG) \
51 InetFailError((ERR), (MSG)); \
54 extern chip::System::Layer gSystemLayer;
56 extern chip::Inet::InetLayer gInet;
60 void InitTestInetCommon();
61 void InitSystemLayer();
62 void ShutdownSystemLayer();
63 void InetFailError(int32_t err, const char * msg);
66 void ServiceEvents(struct ::timeval & aSleepTime);
67 void ShutdownNetwork();
68 void DumpMemory(const uint8_t * mem, uint32_t len, const char * prefix, uint32_t rowWidth);
69 void DumpMemory(const uint8_t * mem, uint32_t len, const char * prefix);
71 inline static void ServiceNetwork(struct ::timeval & aSleepTime)
73 ServiceEvents(aSleepTime);