1 /* 2 * Copyright (C) 2022 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 #pragma once 18 19 /* -=-=-=-=-= WARNING -=-=-=-=-=- 20 * 21 * DO *NOT* *EVER* CHANGE THESE - they *MUST* match what the Tethering mainline module provides! 22 * 23 * You cannot even change them in sync, since newer module must work on older Android T releases. 24 * 25 * You could with difficulty, uprevs of the bpfloader, api detection logic in mainline, etc, 26 * change this in Android U or later, but even that is a very bad idea and not worth the hassle. 27 * 28 * 29 * Mainline Tethering module on T+ is expected to make available to netd (for use by 30 * BandwidthController iptables initialization code) four xt_bpf programs at the following 31 * locations: 32 */ 33 #define XT_BPF_NETD(NAME) "/sys/fs/bpf/netd_shared/prog_netd_skfilter_" NAME "_xtbpf" 34 #define XT_BPF_ALLOWLIST_PROG_PATH XT_BPF_NETD("allowlist") 35 #define XT_BPF_DENYLIST_PROG_PATH XT_BPF_NETD("denylist") 36 #define XT_BPF_EGRESS_PROG_PATH XT_BPF_NETD("egress") 37 #define XT_BPF_INGRESS_PROG_PATH XT_BPF_NETD("ingress") 38