2 * Network Configuration Module
4 * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
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.
23 #ifdef USE_NETCONFIG_LOG
28 #define NETCONFIG_TAG "NETCONFIG"
29 #define __LOG(level, format, arg...) \
31 SLOG(level, NETCONFIG_TAG, format, ## arg); \
34 #define DBG(format, arg...) __LOG(LOG_DEBUG, format, ## arg)
35 #define ERR(format, arg...) __LOG(LOG_ERROR, format, ## arg)
38 #define ONLINE_MONITOR_CONF "/var/lib/net-config/online_monitor.conf"
41 ONLINE_MONITOR_STATE_UNINITIALIZED = 0,
42 ONLINE_MONITOR_STATE_INITIALIZED = 1,
43 ONLINE_MONITOR_STATE_MONITORING_STARTED = 2,
44 ONLINE_MONITOR_STATE_MONITORING_STOPPED = 3,
45 ONLINE_MONITOR_STATE_OFFLINE_DETECTED = 4,
46 ONLINE_MONITOR_STATE_URL_CHECK_SUCCEEDED = 5,
47 ONLINE_MONITOR_STATE_URL_CHECK_FAILED = 6,
48 } online_monitor_state_e;
51 ONLINE_MONITOR_DETECTION_NONE = 0,
52 ONLINE_MONITOR_DETECTION_UNREACHABLE = 1,
53 ONLINE_MONITOR_DETECTION_DNS_REFUSED = 2,
54 ONLINE_MONITOR_DETECTION_NO_DNS_RESPONSE = 3,
55 } online_monitor_detection_e;
61 gboolean supplicant_log;
65 } online_monitor_config_t;
67 typedef void(*online_monitor_state_chaged_cb)
68 (online_monitor_state_e state, char *ifname, online_monitor_detection_e reason);
70 void online_monitor_url_check_result(gboolean result);
71 void online_monitor_notifier_register(online_monitor_state_chaged_cb notifier);
72 void online_monitor_notifier_unregister(online_monitor_state_chaged_cb notifier);
73 online_monitor_config_t *online_monitor_get_configuration(void);
75 int report_manager_init(void);
76 int report_manager_deinit(void);
77 int url_checker_init(void);
78 int url_checker_deinit(void);