Change owner and group of /usr/lib/udev/rules.d/99-wifiusb-dev.rules
[platform/core/connectivity/net-config.git] / haltests / haltests.h
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef __NETCONFIG_UNITTEST_H__
17 #define __NETCONFIG_UNITTEST_H__
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #include <glib.h>
24
25 #define GMAINTIMEOUT   20000
26 #define MAX_AP_LENGTH  33
27 #define MAX_KEY_LENGTH 64
28 #define MAX_PATH_LENGTH 256
29
30 #define FEATURE_WIFI       "http://tizen.org/feature/network.wifi"
31 #define WIFIDIRECT_FEATURE "http://tizen.org/feature/network.wifi.direct"
32
33 #define WIFI_ADDRESS_PATH    "/sys/class/net/wlan0/address"
34 #define WIFI_P2P_PATH        "/sys/class/net/p2p0/address"
35 #define WIFI_P2P_CONFIG_PATH "/etc/wifi-direct/wifi-direct-manager.conf"
36 #define WFD_CONF_GROUP_NAME  "wfd-manager"
37
38 GMainLoop *g_pMainLoop;
39 guint g_nTimeoutId;
40 bool g_bFeatureWifi;
41 bool g_bFeatureP2P;
42
43 #define RUN_GMAIN_LOOP(callback) {\
44         g_pMainLoop = g_main_loop_new(NULL, false);\
45         g_nTimeoutId = g_timeout_add(GMAINTIMEOUT, callback, g_pMainLoop);\
46         g_main_loop_run(g_pMainLoop);\
47         g_source_remove(g_nTimeoutId);\
48         g_pMainLoop = NULL;\
49 }
50
51 #define QUIT_GMAIN_LOOP {\
52         if (g_pMainLoop)\
53                 g_main_loop_quit(g_pMainLoop);\
54 }
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif /* __NETCONFIG_UNITTEST_H__ */