Add U32 S64 subclasses to Struct
BPF maps require classes to extend struct. Adding U32 and S64
classes to be used in QoS and BpfBitmaps.
Bug: 202871011
Change-Id: Idc0660240fafba0b199772b100ff69c362599403
diff --git a/staticlibs/device/com/android/net/module/util/Struct.java b/staticlibs/device/com/android/net/module/util/Struct.java
index b43e2c4..f4d4163 100644
--- a/staticlibs/device/com/android/net/module/util/Struct.java
+++ b/staticlibs/device/com/android/net/module/util/Struct.java
@@ -730,4 +730,22 @@
}
return sb.toString();
}
+
+ public static class U32 extends Struct {
+ @Struct.Field(order = 0, type = Struct.Type.U32)
+ public final long val;
+
+ public U32(final long val) {
+ this.val = val;
+ }
+ }
+
+ public static class S64 extends Struct {
+ @Struct.Field(order = 0, type = Struct.Type.S64)
+ public final long val;
+
+ public S64(final long val) {
+ this.val = val;
+ }
+ }
}