4 * Copyright (c) 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.
20 * @file netstat-common.h
22 * @desc Datausage module control structures
24 * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
28 #ifndef __RESOURCED_NETSTAT_COMMON_H__
29 #define __RESOURCED_NETSTAT_COMMON_H__
33 #include <resourced.h>
37 enum netstat_control_type {
38 NET_CTRL_TYPE_UNKNOWN,
40 NET_CTRL_TYPE_LAST_ELEM,
43 struct netstat_data_type
45 enum netstat_control_type op_type;
50 * @brief It creates an appropriate cgroup,
51 * it generates classid for the network performance control.
52 * This function uses module's control callback interface to
53 * invoke join_app_performance
54 * @param app_id[in] - application identifier, it's package name now
55 * @param pid - pid to put in to cgroup, or self pid of 0
56 * @return 0 if success or error code
58 resourced_ret_c join_net_cls(const char *app_id, const pid_t pid);
60 iface_callback *create_counter_callback(void);
63 void keep_counter(struct nfacct_rule *counter);
65 #endif /* __RESOURCED_NETSTAT_COMMON_H__ */