blob: 4a4904d201ee40b3efd45226501de6972ecc03aa [file] [log] [blame]
Chenbo Feng36575d02018-02-05 15:19:15 -08001/*
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
Chenbo Fengdbbc0002018-04-12 19:05:19 -070019#define BPF_CGROUP_INGRESS_PROG_NAME "cgroup_ingress_prog"
20#define BPF_CGROUP_EGRESS_PROG_NAME "cgroup_egress_prog"
21#define XT_BPF_INGRESS_PROG_NAME "xt_ingress_prog"
22#define XT_BPF_EGRESS_PROG_NAME "xt_egress_prog"
Chenbo Feng36575d02018-02-05 15:19:15 -080023
24#define COOKIE_TAG_MAP 0xbfceaaffffffffff
25#define UID_COUNTERSET_MAP 0xbfdceeafffffffff
26#define UID_STATS_MAP 0xbfdaafffffffffff
27#define TAG_STATS_MAP 0xbfaaafffffffffff
Chenbo Feng5ed17992018-03-13 21:30:49 -070028#define IFACE_STATS_MAP 0xbf1faceaafffffff
Chenbo Feng89c12f12018-03-21 10:29:18 -070029#define DOZABLE_UID_MAP 0Xbfd0ab1e1dafffff
30#define STANDBY_UID_MAP 0Xbfadb1daffffffff
31#define POWERSAVE_UID_MAP 0Xbf0eae1dafffffff
32// These are also defined in NetdConstants.h, but we want to minimize the number of headers
33// included by the BPF kernel program.
34// TODO: refactor the the following constant into a seperate file so
35// NetdConstants.h can also include it from there.
36#define MIN_SYSTEM_UID 0
37#define MAX_SYSTEM_UID 9999
38#define UID_MAP_ENABLED UINT32_MAX