Home | History | Annotate | Download | only in bpf
      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_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"
     23 
     24 #define COOKIE_TAG_MAP 0xbfceaaffffffffff
     25 #define UID_COUNTERSET_MAP 0xbfdceeafffffffff
     26 #define APP_UID_STATS_MAP 0xbfa1daafffffffff
     27 #define UID_STATS_MAP 0xbfdaafffffffffff
     28 #define TAG_STATS_MAP 0xbfaaafffffffffff
     29 #define IFACE_STATS_MAP 0xbf1faceaafffffff
     30 #define DOZABLE_UID_MAP 0Xbfd0ab1e1dafffff
     31 #define STANDBY_UID_MAP 0Xbfadb1daffffffff
     32 #define POWERSAVE_UID_MAP 0Xbf0eae1dafffffff
     33 // These are also defined in NetdConstants.h, but we want to minimize the number of headers
     34 // included by the BPF kernel program.
     35 // TODO: refactor the the following constant into a seperate file so
     36 // NetdConstants.h can also include it from there.
     37 #define MIN_SYSTEM_UID 0
     38 #define MAX_SYSTEM_UID 9999
     39 #define UID_MAP_ENABLED UINT32_MAX
     40