4 * Copyright (c) 2000 - 2013 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.
24 * @desc Utility for working with network interfaces
27 #ifndef TRESOURCED_LIBS_NET_IFACE_H_
28 #define TRESOURCED_LIBS_NET_IFACE_H_
33 #include "data_usage.h"
36 * @desc Storage now create an instance of this structure
39 void(*handle_iface_up)(int ifindex);
40 void(*handle_iface_down)(int ifindex);
43 int init_iftype(void);
44 void finalize_iftypes(void);
46 int is_allowed_ifindex(int ifindex);
48 resourced_iface_type get_iftype(int ifindex);
49 char *get_iftype_name(resourced_iface_type iftype);
50 bool is_address_exists(const char *name);
52 resourced_iface_type convert_iftype(const char *buffer);
54 void set_wifi_allowance(const resourced_option_state wifi_option);
55 void set_datacall_allowance(const resourced_option_state datacall_option);
57 typedef int(*ifindex_iterator)(int ifindex,
58 resourced_iface_type iftype, void *data);
60 void for_each_ifindex(ifindex_iterator iter, void(*empty_func)(void *),
63 typedef GList iface_callbacks;
65 #endif /*TRESOURCED_LIBS_NET_IFACE_H_*/