tizen 2.3.1 release
[kernel/api/system-resource.git] / src / common / const.h
1 /*
2  *  resourced
3  *
4  * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 /*
21  *  @file: const.h
22  *
23  *  @desc Application stat entity
24  *  @version 1.0
25  *
26  */
27
28 #ifndef _RESOURCED_CONST_H
29 #define _RESOURCED_CONST_H
30
31 #define TASK_FILE_NAME "/tasks"
32 #define CGROUP_FILE_NAME "/cgroup.procs"
33 #define UNKNOWN_APP "(unknown)"
34
35 #define MAX_PATH_LENGTH 512
36 #define MAX_NAME_LENGTH 256
37
38 #define COMMA_DELIMETER ","
39
40 #define COUNTER_UPDATE_PERIOD 60
41 #define FLUSH_PERIOD 60
42 #define STORE_DELAY_INTERVAL 1
43
44 #define NONE_QUOTA_ID 0
45
46 #define TIME_TO_SAFE_DATA 1 /* one second */
47
48 /*
49  * @desc reserved classid enums
50  * internal structure, we don't provide it externally
51 */
52 enum resourced_reserved_classid {
53         RESOURCED_UNKNOWN_CLASSID,
54         RESOURCED_ALL_APP_CLASSID,              /**< kernel expects 1 for
55                                                 handling restriction for all
56                                                 applications  */
57         RESOURCED_TETHERING_APP_CLASSID,        /**< it uses in user space logic
58                                                 for counting tethering traffic */
59         RESOURCED_RESERVED_CLASSID_MAX,
60 };
61
62 enum resourced_counter_state {
63         RESOURCED_DEFAULT_STATE = 0,
64         RESOURCED_FORCIBLY_FLUSH_STATE = 1 << 1,
65         RESOURCED_FORCIBLY_QUIT_STATE = 1 << 2,
66         RESOURCED_NET_BLOCKED_STATE = 1 << 3,
67 };
68
69 #endif /* _RESOURCED_CONST_H */