Skip to content

Commit 1a98665

Browse files
Motomu UtsumiExactExampl
authored andcommitted
Add java class for Ingress discard bpf map key value
Bug: 295800201 Test: TH Change-Id: Ic9ac423aee2a8fb9709b0acf012ec57cdfa019f9
1 parent 5c070d5 commit 1a98665

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}

0 commit comments

Comments
 (0)