1*8542734aSAndroid Build Coastguard Worker /* 2*8542734aSAndroid Build Coastguard Worker * Copyright (C) 2022 The Android Open Source Project 3*8542734aSAndroid Build Coastguard Worker * 4*8542734aSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*8542734aSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*8542734aSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*8542734aSAndroid Build Coastguard Worker * 8*8542734aSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*8542734aSAndroid Build Coastguard Worker * 10*8542734aSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*8542734aSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*8542734aSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*8542734aSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*8542734aSAndroid Build Coastguard Worker * limitations under the License. 15*8542734aSAndroid Build Coastguard Worker */ 16*8542734aSAndroid Build Coastguard Worker 17*8542734aSAndroid Build Coastguard Worker #pragma once 18*8542734aSAndroid Build Coastguard Worker 19*8542734aSAndroid Build Coastguard Worker /* -=-=-=-=-= WARNING -=-=-=-=-=- 20*8542734aSAndroid Build Coastguard Worker * 21*8542734aSAndroid Build Coastguard Worker * DO *NOT* *EVER* CHANGE THESE - they *MUST* match what the Tethering mainline module provides! 22*8542734aSAndroid Build Coastguard Worker * 23*8542734aSAndroid Build Coastguard Worker * You cannot even change them in sync, since newer module must work on older Android T releases. 24*8542734aSAndroid Build Coastguard Worker * 25*8542734aSAndroid Build Coastguard Worker * You could with difficulty, uprevs of the bpfloader, api detection logic in mainline, etc, 26*8542734aSAndroid Build Coastguard Worker * change this in Android U or later, but even that is a very bad idea and not worth the hassle. 27*8542734aSAndroid Build Coastguard Worker * 28*8542734aSAndroid Build Coastguard Worker * 29*8542734aSAndroid Build Coastguard Worker * Mainline Tethering module on T+ is expected to make available to netd (for use by 30*8542734aSAndroid Build Coastguard Worker * BandwidthController iptables initialization code) four xt_bpf programs at the following 31*8542734aSAndroid Build Coastguard Worker * locations: 32*8542734aSAndroid Build Coastguard Worker */ 33*8542734aSAndroid Build Coastguard Worker #define XT_BPF_NETD(NAME) "/sys/fs/bpf/netd_shared/prog_netd_skfilter_" NAME "_xtbpf" 34*8542734aSAndroid Build Coastguard Worker #define XT_BPF_ALLOWLIST_PROG_PATH XT_BPF_NETD("allowlist") 35*8542734aSAndroid Build Coastguard Worker #define XT_BPF_DENYLIST_PROG_PATH XT_BPF_NETD("denylist") 36*8542734aSAndroid Build Coastguard Worker #define XT_BPF_EGRESS_PROG_PATH XT_BPF_NETD("egress") 37*8542734aSAndroid Build Coastguard Worker #define XT_BPF_INGRESS_PROG_PATH XT_BPF_NETD("ingress") 38