Hungming Chen | 41b2ae1 | 2020-02-04 15:09:37 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 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 | #include <linux/if.h> |
| 18 | #include <linux/pkt_cls.h> |
| 19 | |
| 20 | #include "bpf_helpers.h" |
| 21 | #include "netdbpf/bpf_shared.h" |
| 22 | |
Maciej Żenczykowski | 565b6fb | 2020-01-27 01:58:40 -0800 | [diff] [blame] | 23 | DEFINE_BPF_MAP_GRW(tether_ingress_map, HASH, TetherIngressKey, TetherIngressValue, 64, |
| 24 | AID_NETWORK_STACK) |
Hungming Chen | 41b2ae1 | 2020-02-04 15:09:37 +0800 | [diff] [blame] | 25 | |
Maciej Żenczykowski | 0510b01 | 2020-02-12 05:03:05 -0800 | [diff] [blame] | 26 | // Tethering stats, indexed by upstream interface. |
Maciej Żenczykowski | 565b6fb | 2020-01-27 01:58:40 -0800 | [diff] [blame] | 27 | DEFINE_BPF_MAP_GRW(tether_stats_map, HASH, uint32_t, TetherStatsValue, 16, AID_NETWORK_STACK) |
Maciej Żenczykowski | 0510b01 | 2020-02-12 05:03:05 -0800 | [diff] [blame] | 28 | |
Hungming Chen | 41b2ae1 | 2020-02-04 15:09:37 +0800 | [diff] [blame] | 29 | SEC("schedcls/ingress/tether_ether") |
| 30 | int sched_cls_ingress_tether_ether(struct __sk_buff* skb) { |
| 31 | // TODO |
| 32 | return TC_ACT_OK; |
| 33 | } |
| 34 | |
| 35 | SEC("schedcls/ingress/tether_rawip") |
| 36 | int sched_cls_ingress_tether_rawip(struct __sk_buff* skb) { |
| 37 | // TODO |
| 38 | return TC_ACT_OK; |
| 39 | } |
| 40 | |
| 41 | char _license[] SEC("license") = "Apache 2.0"; |