blob: bc8415fd646277b6f3763fea226a727a4239f2a9 [file] [log] [blame]
Hungming Chen41b2ae12020-02-04 15:09:37 +08001/*
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 Żenczykowski565b6fb2020-01-27 01:58:40 -080023DEFINE_BPF_MAP_GRW(tether_ingress_map, HASH, TetherIngressKey, TetherIngressValue, 64,
24 AID_NETWORK_STACK)
Hungming Chen41b2ae12020-02-04 15:09:37 +080025
Maciej Żenczykowski0510b012020-02-12 05:03:05 -080026// Tethering stats, indexed by upstream interface.
Maciej Żenczykowski565b6fb2020-01-27 01:58:40 -080027DEFINE_BPF_MAP_GRW(tether_stats_map, HASH, uint32_t, TetherStatsValue, 16, AID_NETWORK_STACK)
Maciej Żenczykowski0510b012020-02-12 05:03:05 -080028
Hungming Chen41b2ae12020-02-04 15:09:37 +080029SEC("schedcls/ingress/tether_ether")
30int sched_cls_ingress_tether_ether(struct __sk_buff* skb) {
31 // TODO
32 return TC_ACT_OK;
33}
34
35SEC("schedcls/ingress/tether_rawip")
36int sched_cls_ingress_tether_rawip(struct __sk_buff* skb) {
37 // TODO
38 return TC_ACT_OK;
39}
40
41char _license[] SEC("license") = "Apache 2.0";