Chenbo Feng | 36575d0 | 2018-02-05 15:19:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // const values shared by both kernel program and userspace bpfloader |
| 18 | |
| 19 | #define BPF_PROG_SEC_NAME "kern_prog" |
| 20 | |
| 21 | #define COOKIE_TAG_MAP 0xbfceaaffffffffff |
| 22 | #define UID_COUNTERSET_MAP 0xbfdceeafffffffff |
| 23 | #define UID_STATS_MAP 0xbfdaafffffffffff |
| 24 | #define TAG_STATS_MAP 0xbfaaafffffffffff |
Chenbo Feng | 5ed1799 | 2018-03-13 21:30:49 -0700 | [diff] [blame] | 25 | #define IFACE_STATS_MAP 0xbf1faceaafffffff |
Chenbo Feng | 89c12f1 | 2018-03-21 10:29:18 -0700 | [diff] [blame] | 26 | #define DOZABLE_UID_MAP 0Xbfd0ab1e1dafffff |
| 27 | #define STANDBY_UID_MAP 0Xbfadb1daffffffff |
| 28 | #define POWERSAVE_UID_MAP 0Xbf0eae1dafffffff |
| 29 | // These are also defined in NetdConstants.h, but we want to minimize the number of headers |
| 30 | // included by the BPF kernel program. |
| 31 | // TODO: refactor the the following constant into a seperate file so |
| 32 | // NetdConstants.h can also include it from there. |
| 33 | #define MIN_SYSTEM_UID 0 |
| 34 | #define MAX_SYSTEM_UID 9999 |
| 35 | #define UID_MAP_ENABLED UINT32_MAX |