tizen 2.3 release
[kernel/api/system-resource.git] / src / utils / test-net-activity.c
1 /*
2  *
3  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18
19 /*
20  * @file testgrabbing.c
21  * @desc Functionality for testing ktgrabber communications
22  *      and related procedures
23  */
24
25 #include "trace.h"
26
27 #include <data_usage.h>
28 #include <mcheck.h>
29 #include <Ecore.h>
30
31 resourced_cb_ret net_activity_func(struct net_activity_info *info)
32 {
33         printf("%20s\t|%8d\t|%8d\t|%8d\t|\n", info->appid, info->iftype,
34                info->type, info->bytes);
35         return RESOURCED_CONTINUE;
36 }
37
38 int main(int argc, char **argv)
39 {
40         resourced_ret_c ret;
41 #ifdef DEBUG_ENABLED
42         mtrace();
43         mcheck(0);
44 #endif
45         printf("%20s\t|%8s\t|%8s\t|%8s\t|\n", "appid", "iftype",
46                "type", "bytes");
47
48         ret = register_net_activity_cb(net_activity_func);
49         ecore_main_loop_begin();
50         return 0;
51 }