File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
common/src/com/android/net/module/util/bpf Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2023 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+ package com .android .net .module .util .bpf ;
18+
19+ import com .android .net .module .util .Struct ;
20+
21+ import java .net .Inet6Address ;
22+
23+ /** Key type for ingress discard map */
24+ public class IngressDiscardKey extends Struct {
25+ // The destination ip of the incoming packet. IPv4 uses IPv4-mapped IPv6 address.
26+ @ Field (order = 0 , type = Type .Ipv6Address )
27+ public final Inet6Address dstAddr ;
28+
29+ public IngressDiscardKey (final Inet6Address dstAddr ) {
30+ this .dstAddr = dstAddr ;
31+ }
32+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2023 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+ package com .android .net .module .util .bpf ;
18+
19+ import com .android .net .module .util .Struct ;
20+
21+ /** Value type for ingress discard map */
22+ public class IngressDiscardValue extends Struct {
23+ // Allowed interface indexes.
24+ // Use the same value for iif1 and iif2 if there is only a single allowed interface index.
25+ @ Field (order = 0 , type = Type .S32 )
26+ public final int iif1 ;
27+ @ Field (order = 1 , type = Type .S32 )
28+ public final int iif2 ;
29+
30+ public IngressDiscardValue (final int iif1 , final int iif2 ) {
31+ this .iif1 = iif1 ;
32+ this .iif2 = iif2 ;
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments