me.bechberger.ebpf.bpf.raw.bpf_link_info Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rawbpf Show documentation
Show all versions of rawbpf Show documentation
Raw Panama bindings for libbpf generated for jextract on 64-bit Linux
The newest version!
// Generated by jextract
package me.bechberger.ebpf.bpf.raw;
import java.lang.invoke.*;
import java.lang.foreign.*;
import java.nio.ByteOrder;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;
import static java.lang.foreign.ValueLayout.*;
import static java.lang.foreign.MemoryLayout.PathElement.*;
/**
* {@snippet lang=c :
* struct bpf_link_info {
* __u32 type;
* __u32 id;
* __u32 prog_id;
* union {
* struct {
* __u64 tp_name;
* __u32 tp_name_len;
* } raw_tracepoint;
* struct {
* __u32 attach_type;
* __u32 target_obj_id;
* __u32 target_btf_id;
* } tracing;
* struct {
* __u64 cgroup_id;
* __u32 attach_type;
* } cgroup;
* struct {
* __u64 target_name;
* __u32 target_name_len;
* union {
* struct {
* __u32 map_id;
* } map;
* };
* union {
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup;
* struct {
* __u32 tid;
* __u32 pid;
* } task;
* };
* } iter;
* struct {
* __u32 netns_ino;
* __u32 attach_type;
* } netns;
* struct {
* __u32 ifindex;
* } xdp;
* struct {
* __u32 map_id;
* } struct_ops;
* struct {
* __u32 pf;
* __u32 hooknum;
* __s32 priority;
* __u32 flags;
* } netfilter;
* struct {
* __u64 addrs;
* __u32 count;
* __u32 flags;
* __u64 missed;
* __u64 cookies;
* } kprobe_multi;
* struct {
* __u64 path;
* __u64 offsets;
* __u64 ref_ctr_offsets;
* __u64 cookies;
* __u32 path_size;
* __u32 count;
* __u32 flags;
* __u32 pid;
* } uprobe_multi;
* struct {
* __u32 type;
* __u32 : 32;
* union {
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe;
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe;
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint;
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event;
* };
* } perf_event;
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } tcx;
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } netkit;
* struct {
* __u32 map_id;
* __u32 attach_type;
* } sockmap;
* };
* }
* }
*/
public class bpf_link_info {
bpf_link_info() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("type"),
Lib.C_INT.withName("id"),
Lib.C_INT.withName("prog_id"),
MemoryLayout.paddingLayout(4),
MemoryLayout.unionLayout(
bpf_link_info.raw_tracepoint.layout().withName("raw_tracepoint"),
bpf_link_info.tracing.layout().withName("tracing"),
bpf_link_info.cgroup.layout().withName("cgroup"),
bpf_link_info.iter.layout().withName("iter"),
bpf_link_info.netns.layout().withName("netns"),
bpf_link_info.xdp.layout().withName("xdp"),
bpf_link_info.struct_ops.layout().withName("struct_ops"),
bpf_link_info.netfilter.layout().withName("netfilter"),
bpf_link_info.kprobe_multi.layout().withName("kprobe_multi"),
bpf_link_info.uprobe_multi.layout().withName("uprobe_multi"),
bpf_link_info.perf_event.layout().withName("perf_event"),
bpf_link_info.tcx.layout().withName("tcx"),
bpf_link_info.netkit.layout().withName("netkit"),
bpf_link_info.sockmap.layout().withName("sockmap")
).withName("$anon$6618:2")
).withName("bpf_link_info");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static final OfInt type$layout() {
return type$LAYOUT;
}
private static final long type$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static final long type$offset() {
return type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static int type(MemorySegment struct) {
return struct.get(type$LAYOUT, type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static void type(MemorySegment struct, int fieldValue) {
struct.set(type$LAYOUT, type$OFFSET, fieldValue);
}
private static final OfInt id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 id
* }
*/
public static final OfInt id$layout() {
return id$LAYOUT;
}
private static final long id$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 id
* }
*/
public static final long id$offset() {
return id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 id
* }
*/
public static int id(MemorySegment struct) {
return struct.get(id$LAYOUT, id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 id
* }
*/
public static void id(MemorySegment struct, int fieldValue) {
struct.set(id$LAYOUT, id$OFFSET, fieldValue);
}
private static final OfInt prog_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("prog_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 prog_id
* }
*/
public static final OfInt prog_id$layout() {
return prog_id$LAYOUT;
}
private static final long prog_id$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 prog_id
* }
*/
public static final long prog_id$offset() {
return prog_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 prog_id
* }
*/
public static int prog_id(MemorySegment struct) {
return struct.get(prog_id$LAYOUT, prog_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 prog_id
* }
*/
public static void prog_id(MemorySegment struct, int fieldValue) {
struct.set(prog_id$LAYOUT, prog_id$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 tp_name_len;
* }
* }
*/
public static class raw_tracepoint {
raw_tracepoint() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("tp_name"),
Lib.C_INT.withName("tp_name_len"),
MemoryLayout.paddingLayout(4)
).withName("$anon$6619:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong tp_name$LAYOUT = (OfLong)$LAYOUT.select(groupElement("tp_name"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static final OfLong tp_name$layout() {
return tp_name$LAYOUT;
}
private static final long tp_name$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static final long tp_name$offset() {
return tp_name$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static long tp_name(MemorySegment struct) {
return struct.get(tp_name$LAYOUT, tp_name$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static void tp_name(MemorySegment struct, long fieldValue) {
struct.set(tp_name$LAYOUT, tp_name$OFFSET, fieldValue);
}
private static final OfInt tp_name_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("tp_name_len"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 tp_name_len
* }
*/
public static final OfInt tp_name_len$layout() {
return tp_name_len$LAYOUT;
}
private static final long tp_name_len$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 tp_name_len
* }
*/
public static final long tp_name_len$offset() {
return tp_name_len$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 tp_name_len
* }
*/
public static int tp_name_len(MemorySegment struct) {
return struct.get(tp_name_len$LAYOUT, tp_name_len$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 tp_name_len
* }
*/
public static void tp_name_len(MemorySegment struct, int fieldValue) {
struct.set(tp_name_len$LAYOUT, tp_name_len$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout raw_tracepoint$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("raw_tracepoint"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 tp_name_len;
* } raw_tracepoint
* }
*/
public static final GroupLayout raw_tracepoint$layout() {
return raw_tracepoint$LAYOUT;
}
private static final long raw_tracepoint$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 tp_name_len;
* } raw_tracepoint
* }
*/
public static final long raw_tracepoint$offset() {
return raw_tracepoint$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 tp_name_len;
* } raw_tracepoint
* }
*/
public static MemorySegment raw_tracepoint(MemorySegment struct) {
return struct.asSlice(raw_tracepoint$OFFSET, raw_tracepoint$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 tp_name_len;
* } raw_tracepoint
* }
*/
public static void raw_tracepoint(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, raw_tracepoint$OFFSET, raw_tracepoint$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 attach_type;
* __u32 target_obj_id;
* __u32 target_btf_id;
* }
* }
*/
public static class tracing {
tracing() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("attach_type"),
Lib.C_INT.withName("target_obj_id"),
Lib.C_INT.withName("target_btf_id")
).withName("$anon$6623:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt attach_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final OfInt attach_type$layout() {
return attach_type$LAYOUT;
}
private static final long attach_type$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final long attach_type$offset() {
return attach_type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static int attach_type(MemorySegment struct) {
return struct.get(attach_type$LAYOUT, attach_type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static void attach_type(MemorySegment struct, int fieldValue) {
struct.set(attach_type$LAYOUT, attach_type$OFFSET, fieldValue);
}
private static final OfInt target_obj_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("target_obj_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 target_obj_id
* }
*/
public static final OfInt target_obj_id$layout() {
return target_obj_id$LAYOUT;
}
private static final long target_obj_id$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 target_obj_id
* }
*/
public static final long target_obj_id$offset() {
return target_obj_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 target_obj_id
* }
*/
public static int target_obj_id(MemorySegment struct) {
return struct.get(target_obj_id$LAYOUT, target_obj_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 target_obj_id
* }
*/
public static void target_obj_id(MemorySegment struct, int fieldValue) {
struct.set(target_obj_id$LAYOUT, target_obj_id$OFFSET, fieldValue);
}
private static final OfInt target_btf_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("target_btf_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 target_btf_id
* }
*/
public static final OfInt target_btf_id$layout() {
return target_btf_id$LAYOUT;
}
private static final long target_btf_id$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 target_btf_id
* }
*/
public static final long target_btf_id$offset() {
return target_btf_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 target_btf_id
* }
*/
public static int target_btf_id(MemorySegment struct) {
return struct.get(target_btf_id$LAYOUT, target_btf_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 target_btf_id
* }
*/
public static void target_btf_id(MemorySegment struct, int fieldValue) {
struct.set(target_btf_id$LAYOUT, target_btf_id$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout tracing$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("tracing"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 attach_type;
* __u32 target_obj_id;
* __u32 target_btf_id;
* } tracing
* }
*/
public static final GroupLayout tracing$layout() {
return tracing$LAYOUT;
}
private static final long tracing$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 attach_type;
* __u32 target_obj_id;
* __u32 target_btf_id;
* } tracing
* }
*/
public static final long tracing$offset() {
return tracing$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 attach_type;
* __u32 target_obj_id;
* __u32 target_btf_id;
* } tracing
* }
*/
public static MemorySegment tracing(MemorySegment struct) {
return struct.asSlice(tracing$OFFSET, tracing$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 attach_type;
* __u32 target_obj_id;
* __u32 target_btf_id;
* } tracing
* }
*/
public static void tracing(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, tracing$OFFSET, tracing$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 attach_type;
* }
* }
*/
public static class cgroup {
cgroup() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("cgroup_id"),
Lib.C_INT.withName("attach_type"),
MemoryLayout.paddingLayout(4)
).withName("$anon$6628:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong cgroup_id$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cgroup_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static final OfLong cgroup_id$layout() {
return cgroup_id$LAYOUT;
}
private static final long cgroup_id$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static final long cgroup_id$offset() {
return cgroup_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static long cgroup_id(MemorySegment struct) {
return struct.get(cgroup_id$LAYOUT, cgroup_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static void cgroup_id(MemorySegment struct, long fieldValue) {
struct.set(cgroup_id$LAYOUT, cgroup_id$OFFSET, fieldValue);
}
private static final OfInt attach_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final OfInt attach_type$layout() {
return attach_type$LAYOUT;
}
private static final long attach_type$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final long attach_type$offset() {
return attach_type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static int attach_type(MemorySegment struct) {
return struct.get(attach_type$LAYOUT, attach_type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static void attach_type(MemorySegment struct, int fieldValue) {
struct.set(attach_type$LAYOUT, attach_type$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout cgroup$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("cgroup"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 attach_type;
* } cgroup
* }
*/
public static final GroupLayout cgroup$layout() {
return cgroup$LAYOUT;
}
private static final long cgroup$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 attach_type;
* } cgroup
* }
*/
public static final long cgroup$offset() {
return cgroup$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 attach_type;
* } cgroup
* }
*/
public static MemorySegment cgroup(MemorySegment struct) {
return struct.asSlice(cgroup$OFFSET, cgroup$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 attach_type;
* } cgroup
* }
*/
public static void cgroup(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, cgroup$OFFSET, cgroup$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 target_name;
* __u32 target_name_len;
* union {
* struct {
* __u32 map_id;
* } map;
* };
* union {
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup;
* struct {
* __u32 tid;
* __u32 pid;
* } task;
* };
* }
* }
*/
public static class iter {
iter() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("target_name"),
Lib.C_INT.withName("target_name_len"),
MemoryLayout.unionLayout(
bpf_link_info.iter.map.layout().withName("map")
).withName("$anon$6640:4"),
MemoryLayout.unionLayout(
bpf_link_info.iter.cgroup.layout().withName("cgroup"),
bpf_link_info.iter.task.layout().withName("task")
).withName("$anon$6645:4")
).withName("$anon$6632:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong target_name$LAYOUT = (OfLong)$LAYOUT.select(groupElement("target_name"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 target_name
* }
*/
public static final OfLong target_name$layout() {
return target_name$LAYOUT;
}
private static final long target_name$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 target_name
* }
*/
public static final long target_name$offset() {
return target_name$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 target_name
* }
*/
public static long target_name(MemorySegment struct) {
return struct.get(target_name$LAYOUT, target_name$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 target_name
* }
*/
public static void target_name(MemorySegment struct, long fieldValue) {
struct.set(target_name$LAYOUT, target_name$OFFSET, fieldValue);
}
private static final OfInt target_name_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("target_name_len"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 target_name_len
* }
*/
public static final OfInt target_name_len$layout() {
return target_name_len$LAYOUT;
}
private static final long target_name_len$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 target_name_len
* }
*/
public static final long target_name_len$offset() {
return target_name_len$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 target_name_len
* }
*/
public static int target_name_len(MemorySegment struct) {
return struct.get(target_name_len$LAYOUT, target_name_len$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 target_name_len
* }
*/
public static void target_name_len(MemorySegment struct, int fieldValue) {
struct.set(target_name_len$LAYOUT, target_name_len$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* struct {
* __u32 map_id;
* }
* }
*/
public static class map {
map() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("map_id")
).withName("$anon$6641:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt map_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("map_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static final OfInt map_id$layout() {
return map_id$LAYOUT;
}
private static final long map_id$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static final long map_id$offset() {
return map_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static int map_id(MemorySegment struct) {
return struct.get(map_id$LAYOUT, map_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static void map_id(MemorySegment struct, int fieldValue) {
struct.set(map_id$LAYOUT, map_id$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout map$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6640:4"), groupElement("map"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } map
* }
*/
public static final GroupLayout map$layout() {
return map$LAYOUT;
}
private static final long map$OFFSET = 12;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } map
* }
*/
public static final long map$offset() {
return map$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } map
* }
*/
public static MemorySegment map(MemorySegment struct) {
return struct.asSlice(map$OFFSET, map$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } map
* }
*/
public static void map(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, map$OFFSET, map$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 order;
* }
* }
*/
public static class cgroup {
cgroup() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("cgroup_id"),
Lib.C_INT.withName("order"),
MemoryLayout.paddingLayout(4)
).withName("$anon$6646:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong cgroup_id$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cgroup_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static final OfLong cgroup_id$layout() {
return cgroup_id$LAYOUT;
}
private static final long cgroup_id$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static final long cgroup_id$offset() {
return cgroup_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static long cgroup_id(MemorySegment struct) {
return struct.get(cgroup_id$LAYOUT, cgroup_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cgroup_id
* }
*/
public static void cgroup_id(MemorySegment struct, long fieldValue) {
struct.set(cgroup_id$LAYOUT, cgroup_id$OFFSET, fieldValue);
}
private static final OfInt order$LAYOUT = (OfInt)$LAYOUT.select(groupElement("order"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 order
* }
*/
public static final OfInt order$layout() {
return order$LAYOUT;
}
private static final long order$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 order
* }
*/
public static final long order$offset() {
return order$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 order
* }
*/
public static int order(MemorySegment struct) {
return struct.get(order$LAYOUT, order$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 order
* }
*/
public static void order(MemorySegment struct, int fieldValue) {
struct.set(order$LAYOUT, order$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout cgroup$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6645:4"), groupElement("cgroup"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup
* }
*/
public static final GroupLayout cgroup$layout() {
return cgroup$LAYOUT;
}
private static final long cgroup$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup
* }
*/
public static final long cgroup$offset() {
return cgroup$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup
* }
*/
public static MemorySegment cgroup(MemorySegment struct) {
return struct.asSlice(cgroup$OFFSET, cgroup$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup
* }
*/
public static void cgroup(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, cgroup$OFFSET, cgroup$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 tid;
* __u32 pid;
* }
* }
*/
public static class task {
task() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("tid"),
Lib.C_INT.withName("pid")
).withName("$anon$6650:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt tid$LAYOUT = (OfInt)$LAYOUT.select(groupElement("tid"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 tid
* }
*/
public static final OfInt tid$layout() {
return tid$LAYOUT;
}
private static final long tid$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 tid
* }
*/
public static final long tid$offset() {
return tid$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 tid
* }
*/
public static int tid(MemorySegment struct) {
return struct.get(tid$LAYOUT, tid$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 tid
* }
*/
public static void tid(MemorySegment struct, int fieldValue) {
struct.set(tid$LAYOUT, tid$OFFSET, fieldValue);
}
private static final OfInt pid$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pid"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static final OfInt pid$layout() {
return pid$LAYOUT;
}
private static final long pid$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static final long pid$offset() {
return pid$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static int pid(MemorySegment struct) {
return struct.get(pid$LAYOUT, pid$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static void pid(MemorySegment struct, int fieldValue) {
struct.set(pid$LAYOUT, pid$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout task$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6645:4"), groupElement("task"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 tid;
* __u32 pid;
* } task
* }
*/
public static final GroupLayout task$layout() {
return task$LAYOUT;
}
private static final long task$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 tid;
* __u32 pid;
* } task
* }
*/
public static final long task$offset() {
return task$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 tid;
* __u32 pid;
* } task
* }
*/
public static MemorySegment task(MemorySegment struct) {
return struct.asSlice(task$OFFSET, task$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 tid;
* __u32 pid;
* } task
* }
*/
public static void task(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, task$OFFSET, task$LAYOUT.byteSize());
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout iter$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("iter"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 target_name;
* __u32 target_name_len;
* union {
* struct {
* __u32 map_id;
* } map;
* };
* union {
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup;
* struct {
* __u32 tid;
* __u32 pid;
* } task;
* };
* } iter
* }
*/
public static final GroupLayout iter$layout() {
return iter$LAYOUT;
}
private static final long iter$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 target_name;
* __u32 target_name_len;
* union {
* struct {
* __u32 map_id;
* } map;
* };
* union {
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup;
* struct {
* __u32 tid;
* __u32 pid;
* } task;
* };
* } iter
* }
*/
public static final long iter$offset() {
return iter$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 target_name;
* __u32 target_name_len;
* union {
* struct {
* __u32 map_id;
* } map;
* };
* union {
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup;
* struct {
* __u32 tid;
* __u32 pid;
* } task;
* };
* } iter
* }
*/
public static MemorySegment iter(MemorySegment struct) {
return struct.asSlice(iter$OFFSET, iter$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 target_name;
* __u32 target_name_len;
* union {
* struct {
* __u32 map_id;
* } map;
* };
* union {
* struct {
* __u64 cgroup_id;
* __u32 order;
* } cgroup;
* struct {
* __u32 tid;
* __u32 pid;
* } task;
* };
* } iter
* }
*/
public static void iter(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, iter$OFFSET, iter$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 netns_ino;
* __u32 attach_type;
* }
* }
*/
public static class netns {
netns() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("netns_ino"),
Lib.C_INT.withName("attach_type")
).withName("$anon$6656:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt netns_ino$LAYOUT = (OfInt)$LAYOUT.select(groupElement("netns_ino"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 netns_ino
* }
*/
public static final OfInt netns_ino$layout() {
return netns_ino$LAYOUT;
}
private static final long netns_ino$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 netns_ino
* }
*/
public static final long netns_ino$offset() {
return netns_ino$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 netns_ino
* }
*/
public static int netns_ino(MemorySegment struct) {
return struct.get(netns_ino$LAYOUT, netns_ino$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 netns_ino
* }
*/
public static void netns_ino(MemorySegment struct, int fieldValue) {
struct.set(netns_ino$LAYOUT, netns_ino$OFFSET, fieldValue);
}
private static final OfInt attach_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final OfInt attach_type$layout() {
return attach_type$LAYOUT;
}
private static final long attach_type$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final long attach_type$offset() {
return attach_type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static int attach_type(MemorySegment struct) {
return struct.get(attach_type$LAYOUT, attach_type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static void attach_type(MemorySegment struct, int fieldValue) {
struct.set(attach_type$LAYOUT, attach_type$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout netns$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("netns"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 netns_ino;
* __u32 attach_type;
* } netns
* }
*/
public static final GroupLayout netns$layout() {
return netns$LAYOUT;
}
private static final long netns$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 netns_ino;
* __u32 attach_type;
* } netns
* }
*/
public static final long netns$offset() {
return netns$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 netns_ino;
* __u32 attach_type;
* } netns
* }
*/
public static MemorySegment netns(MemorySegment struct) {
return struct.asSlice(netns$OFFSET, netns$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 netns_ino;
* __u32 attach_type;
* } netns
* }
*/
public static void netns(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, netns$OFFSET, netns$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* }
* }
*/
public static class xdp {
xdp() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("ifindex")
).withName("$anon$6660:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt ifindex$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ifindex"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static final OfInt ifindex$layout() {
return ifindex$LAYOUT;
}
private static final long ifindex$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static final long ifindex$offset() {
return ifindex$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static int ifindex(MemorySegment struct) {
return struct.get(ifindex$LAYOUT, ifindex$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static void ifindex(MemorySegment struct, int fieldValue) {
struct.set(ifindex$LAYOUT, ifindex$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout xdp$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("xdp"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* } xdp
* }
*/
public static final GroupLayout xdp$layout() {
return xdp$LAYOUT;
}
private static final long xdp$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* } xdp
* }
*/
public static final long xdp$offset() {
return xdp$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* } xdp
* }
*/
public static MemorySegment xdp(MemorySegment struct) {
return struct.asSlice(xdp$OFFSET, xdp$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* } xdp
* }
*/
public static void xdp(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, xdp$OFFSET, xdp$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 map_id;
* }
* }
*/
public static class struct_ops {
struct_ops() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("map_id")
).withName("$anon$6663:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt map_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("map_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static final OfInt map_id$layout() {
return map_id$LAYOUT;
}
private static final long map_id$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static final long map_id$offset() {
return map_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static int map_id(MemorySegment struct) {
return struct.get(map_id$LAYOUT, map_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static void map_id(MemorySegment struct, int fieldValue) {
struct.set(map_id$LAYOUT, map_id$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout struct_ops$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("struct_ops"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } struct_ops
* }
*/
public static final GroupLayout struct_ops$layout() {
return struct_ops$LAYOUT;
}
private static final long struct_ops$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } struct_ops
* }
*/
public static final long struct_ops$offset() {
return struct_ops$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } struct_ops
* }
*/
public static MemorySegment struct_ops(MemorySegment struct) {
return struct.asSlice(struct_ops$OFFSET, struct_ops$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* } struct_ops
* }
*/
public static void struct_ops(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, struct_ops$OFFSET, struct_ops$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 pf;
* __u32 hooknum;
* __s32 priority;
* __u32 flags;
* }
* }
*/
public static class netfilter {
netfilter() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("pf"),
Lib.C_INT.withName("hooknum"),
Lib.C_INT.withName("priority"),
Lib.C_INT.withName("flags")
).withName("$anon$6666:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt pf$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pf"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 pf
* }
*/
public static final OfInt pf$layout() {
return pf$LAYOUT;
}
private static final long pf$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 pf
* }
*/
public static final long pf$offset() {
return pf$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 pf
* }
*/
public static int pf(MemorySegment struct) {
return struct.get(pf$LAYOUT, pf$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 pf
* }
*/
public static void pf(MemorySegment struct, int fieldValue) {
struct.set(pf$LAYOUT, pf$OFFSET, fieldValue);
}
private static final OfInt hooknum$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hooknum"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 hooknum
* }
*/
public static final OfInt hooknum$layout() {
return hooknum$LAYOUT;
}
private static final long hooknum$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 hooknum
* }
*/
public static final long hooknum$offset() {
return hooknum$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 hooknum
* }
*/
public static int hooknum(MemorySegment struct) {
return struct.get(hooknum$LAYOUT, hooknum$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 hooknum
* }
*/
public static void hooknum(MemorySegment struct, int fieldValue) {
struct.set(hooknum$LAYOUT, hooknum$OFFSET, fieldValue);
}
private static final OfInt priority$LAYOUT = (OfInt)$LAYOUT.select(groupElement("priority"));
/**
* Layout for field:
* {@snippet lang=c :
* __s32 priority
* }
*/
public static final OfInt priority$layout() {
return priority$LAYOUT;
}
private static final long priority$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __s32 priority
* }
*/
public static final long priority$offset() {
return priority$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __s32 priority
* }
*/
public static int priority(MemorySegment struct) {
return struct.get(priority$LAYOUT, priority$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __s32 priority
* }
*/
public static void priority(MemorySegment struct, int fieldValue) {
struct.set(priority$LAYOUT, priority$OFFSET, fieldValue);
}
private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static final OfInt flags$layout() {
return flags$LAYOUT;
}
private static final long flags$OFFSET = 12;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static final long flags$offset() {
return flags$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static int flags(MemorySegment struct) {
return struct.get(flags$LAYOUT, flags$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static void flags(MemorySegment struct, int fieldValue) {
struct.set(flags$LAYOUT, flags$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout netfilter$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("netfilter"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 pf;
* __u32 hooknum;
* __s32 priority;
* __u32 flags;
* } netfilter
* }
*/
public static final GroupLayout netfilter$layout() {
return netfilter$LAYOUT;
}
private static final long netfilter$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 pf;
* __u32 hooknum;
* __s32 priority;
* __u32 flags;
* } netfilter
* }
*/
public static final long netfilter$offset() {
return netfilter$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 pf;
* __u32 hooknum;
* __s32 priority;
* __u32 flags;
* } netfilter
* }
*/
public static MemorySegment netfilter(MemorySegment struct) {
return struct.asSlice(netfilter$OFFSET, netfilter$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 pf;
* __u32 hooknum;
* __s32 priority;
* __u32 flags;
* } netfilter
* }
*/
public static void netfilter(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, netfilter$OFFSET, netfilter$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 addrs;
* __u32 count;
* __u32 flags;
* __u64 missed;
* __u64 cookies;
* }
* }
*/
public static class kprobe_multi {
kprobe_multi() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("addrs"),
Lib.C_INT.withName("count"),
Lib.C_INT.withName("flags"),
Lib.C_LONG_LONG.withName("missed"),
Lib.C_LONG_LONG.withName("cookies")
).withName("$anon$6672:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong addrs$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addrs"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 addrs
* }
*/
public static final OfLong addrs$layout() {
return addrs$LAYOUT;
}
private static final long addrs$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 addrs
* }
*/
public static final long addrs$offset() {
return addrs$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 addrs
* }
*/
public static long addrs(MemorySegment struct) {
return struct.get(addrs$LAYOUT, addrs$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 addrs
* }
*/
public static void addrs(MemorySegment struct, long fieldValue) {
struct.set(addrs$LAYOUT, addrs$OFFSET, fieldValue);
}
private static final OfInt count$LAYOUT = (OfInt)$LAYOUT.select(groupElement("count"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static final OfInt count$layout() {
return count$LAYOUT;
}
private static final long count$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static final long count$offset() {
return count$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static int count(MemorySegment struct) {
return struct.get(count$LAYOUT, count$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static void count(MemorySegment struct, int fieldValue) {
struct.set(count$LAYOUT, count$OFFSET, fieldValue);
}
private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static final OfInt flags$layout() {
return flags$LAYOUT;
}
private static final long flags$OFFSET = 12;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static final long flags$offset() {
return flags$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static int flags(MemorySegment struct) {
return struct.get(flags$LAYOUT, flags$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static void flags(MemorySegment struct, int fieldValue) {
struct.set(flags$LAYOUT, flags$OFFSET, fieldValue);
}
private static final OfLong missed$LAYOUT = (OfLong)$LAYOUT.select(groupElement("missed"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static final OfLong missed$layout() {
return missed$LAYOUT;
}
private static final long missed$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static final long missed$offset() {
return missed$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static long missed(MemorySegment struct) {
return struct.get(missed$LAYOUT, missed$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static void missed(MemorySegment struct, long fieldValue) {
struct.set(missed$LAYOUT, missed$OFFSET, fieldValue);
}
private static final OfLong cookies$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cookies"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static final OfLong cookies$layout() {
return cookies$LAYOUT;
}
private static final long cookies$OFFSET = 24;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static final long cookies$offset() {
return cookies$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static long cookies(MemorySegment struct) {
return struct.get(cookies$LAYOUT, cookies$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static void cookies(MemorySegment struct, long fieldValue) {
struct.set(cookies$LAYOUT, cookies$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout kprobe_multi$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("kprobe_multi"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 addrs;
* __u32 count;
* __u32 flags;
* __u64 missed;
* __u64 cookies;
* } kprobe_multi
* }
*/
public static final GroupLayout kprobe_multi$layout() {
return kprobe_multi$LAYOUT;
}
private static final long kprobe_multi$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 addrs;
* __u32 count;
* __u32 flags;
* __u64 missed;
* __u64 cookies;
* } kprobe_multi
* }
*/
public static final long kprobe_multi$offset() {
return kprobe_multi$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 addrs;
* __u32 count;
* __u32 flags;
* __u64 missed;
* __u64 cookies;
* } kprobe_multi
* }
*/
public static MemorySegment kprobe_multi(MemorySegment struct) {
return struct.asSlice(kprobe_multi$OFFSET, kprobe_multi$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 addrs;
* __u32 count;
* __u32 flags;
* __u64 missed;
* __u64 cookies;
* } kprobe_multi
* }
*/
public static void kprobe_multi(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, kprobe_multi$OFFSET, kprobe_multi$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 path;
* __u64 offsets;
* __u64 ref_ctr_offsets;
* __u64 cookies;
* __u32 path_size;
* __u32 count;
* __u32 flags;
* __u32 pid;
* }
* }
*/
public static class uprobe_multi {
uprobe_multi() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("path"),
Lib.C_LONG_LONG.withName("offsets"),
Lib.C_LONG_LONG.withName("ref_ctr_offsets"),
Lib.C_LONG_LONG.withName("cookies"),
Lib.C_INT.withName("path_size"),
Lib.C_INT.withName("count"),
Lib.C_INT.withName("flags"),
Lib.C_INT.withName("pid")
).withName("$anon$6679:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong path$LAYOUT = (OfLong)$LAYOUT.select(groupElement("path"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 path
* }
*/
public static final OfLong path$layout() {
return path$LAYOUT;
}
private static final long path$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 path
* }
*/
public static final long path$offset() {
return path$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 path
* }
*/
public static long path(MemorySegment struct) {
return struct.get(path$LAYOUT, path$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 path
* }
*/
public static void path(MemorySegment struct, long fieldValue) {
struct.set(path$LAYOUT, path$OFFSET, fieldValue);
}
private static final OfLong offsets$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offsets"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 offsets
* }
*/
public static final OfLong offsets$layout() {
return offsets$LAYOUT;
}
private static final long offsets$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 offsets
* }
*/
public static final long offsets$offset() {
return offsets$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 offsets
* }
*/
public static long offsets(MemorySegment struct) {
return struct.get(offsets$LAYOUT, offsets$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 offsets
* }
*/
public static void offsets(MemorySegment struct, long fieldValue) {
struct.set(offsets$LAYOUT, offsets$OFFSET, fieldValue);
}
private static final OfLong ref_ctr_offsets$LAYOUT = (OfLong)$LAYOUT.select(groupElement("ref_ctr_offsets"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 ref_ctr_offsets
* }
*/
public static final OfLong ref_ctr_offsets$layout() {
return ref_ctr_offsets$LAYOUT;
}
private static final long ref_ctr_offsets$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 ref_ctr_offsets
* }
*/
public static final long ref_ctr_offsets$offset() {
return ref_ctr_offsets$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 ref_ctr_offsets
* }
*/
public static long ref_ctr_offsets(MemorySegment struct) {
return struct.get(ref_ctr_offsets$LAYOUT, ref_ctr_offsets$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 ref_ctr_offsets
* }
*/
public static void ref_ctr_offsets(MemorySegment struct, long fieldValue) {
struct.set(ref_ctr_offsets$LAYOUT, ref_ctr_offsets$OFFSET, fieldValue);
}
private static final OfLong cookies$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cookies"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static final OfLong cookies$layout() {
return cookies$LAYOUT;
}
private static final long cookies$OFFSET = 24;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static final long cookies$offset() {
return cookies$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static long cookies(MemorySegment struct) {
return struct.get(cookies$LAYOUT, cookies$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cookies
* }
*/
public static void cookies(MemorySegment struct, long fieldValue) {
struct.set(cookies$LAYOUT, cookies$OFFSET, fieldValue);
}
private static final OfInt path_size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("path_size"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 path_size
* }
*/
public static final OfInt path_size$layout() {
return path_size$LAYOUT;
}
private static final long path_size$OFFSET = 32;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 path_size
* }
*/
public static final long path_size$offset() {
return path_size$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 path_size
* }
*/
public static int path_size(MemorySegment struct) {
return struct.get(path_size$LAYOUT, path_size$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 path_size
* }
*/
public static void path_size(MemorySegment struct, int fieldValue) {
struct.set(path_size$LAYOUT, path_size$OFFSET, fieldValue);
}
private static final OfInt count$LAYOUT = (OfInt)$LAYOUT.select(groupElement("count"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static final OfInt count$layout() {
return count$LAYOUT;
}
private static final long count$OFFSET = 36;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static final long count$offset() {
return count$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static int count(MemorySegment struct) {
return struct.get(count$LAYOUT, count$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 count
* }
*/
public static void count(MemorySegment struct, int fieldValue) {
struct.set(count$LAYOUT, count$OFFSET, fieldValue);
}
private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static final OfInt flags$layout() {
return flags$LAYOUT;
}
private static final long flags$OFFSET = 40;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static final long flags$offset() {
return flags$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static int flags(MemorySegment struct) {
return struct.get(flags$LAYOUT, flags$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 flags
* }
*/
public static void flags(MemorySegment struct, int fieldValue) {
struct.set(flags$LAYOUT, flags$OFFSET, fieldValue);
}
private static final OfInt pid$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pid"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static final OfInt pid$layout() {
return pid$LAYOUT;
}
private static final long pid$OFFSET = 44;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static final long pid$offset() {
return pid$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static int pid(MemorySegment struct) {
return struct.get(pid$LAYOUT, pid$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 pid
* }
*/
public static void pid(MemorySegment struct, int fieldValue) {
struct.set(pid$LAYOUT, pid$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout uprobe_multi$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("uprobe_multi"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 path;
* __u64 offsets;
* __u64 ref_ctr_offsets;
* __u64 cookies;
* __u32 path_size;
* __u32 count;
* __u32 flags;
* __u32 pid;
* } uprobe_multi
* }
*/
public static final GroupLayout uprobe_multi$layout() {
return uprobe_multi$LAYOUT;
}
private static final long uprobe_multi$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 path;
* __u64 offsets;
* __u64 ref_ctr_offsets;
* __u64 cookies;
* __u32 path_size;
* __u32 count;
* __u32 flags;
* __u32 pid;
* } uprobe_multi
* }
*/
public static final long uprobe_multi$offset() {
return uprobe_multi$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 path;
* __u64 offsets;
* __u64 ref_ctr_offsets;
* __u64 cookies;
* __u32 path_size;
* __u32 count;
* __u32 flags;
* __u32 pid;
* } uprobe_multi
* }
*/
public static MemorySegment uprobe_multi(MemorySegment struct) {
return struct.asSlice(uprobe_multi$OFFSET, uprobe_multi$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 path;
* __u64 offsets;
* __u64 ref_ctr_offsets;
* __u64 cookies;
* __u32 path_size;
* __u32 count;
* __u32 flags;
* __u32 pid;
* } uprobe_multi
* }
*/
public static void uprobe_multi(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, uprobe_multi$OFFSET, uprobe_multi$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 type;
* __u32 : 32;
* union {
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe;
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe;
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint;
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event;
* };
* }
* }
*/
public static class perf_event {
perf_event() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("type"),
MemoryLayout.paddingLayout(4),
MemoryLayout.unionLayout(
bpf_link_info.perf_event.uprobe.layout().withName("uprobe"),
bpf_link_info.perf_event.kprobe.layout().withName("kprobe"),
bpf_link_info.perf_event.tracepoint.layout().withName("tracepoint"),
bpf_link_info.perf_event.event.layout().withName("event")
).withName("$anon$6692:4")
).withName("$anon$6689:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static final OfInt type$layout() {
return type$LAYOUT;
}
private static final long type$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static final long type$offset() {
return type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static int type(MemorySegment struct) {
return struct.get(type$LAYOUT, type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static void type(MemorySegment struct, int fieldValue) {
struct.set(type$LAYOUT, type$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* }
* }
*/
public static class uprobe {
uprobe() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("file_name"),
Lib.C_INT.withName("name_len"),
Lib.C_INT.withName("offset"),
Lib.C_LONG_LONG.withName("cookie")
).withName("$anon$6693:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong file_name$LAYOUT = (OfLong)$LAYOUT.select(groupElement("file_name"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 file_name
* }
*/
public static final OfLong file_name$layout() {
return file_name$LAYOUT;
}
private static final long file_name$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 file_name
* }
*/
public static final long file_name$offset() {
return file_name$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 file_name
* }
*/
public static long file_name(MemorySegment struct) {
return struct.get(file_name$LAYOUT, file_name$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 file_name
* }
*/
public static void file_name(MemorySegment struct, long fieldValue) {
struct.set(file_name$LAYOUT, file_name$OFFSET, fieldValue);
}
private static final OfInt name_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("name_len"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static final OfInt name_len$layout() {
return name_len$LAYOUT;
}
private static final long name_len$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static final long name_len$offset() {
return name_len$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static int name_len(MemorySegment struct) {
return struct.get(name_len$LAYOUT, name_len$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static void name_len(MemorySegment struct, int fieldValue) {
struct.set(name_len$LAYOUT, name_len$OFFSET, fieldValue);
}
private static final OfInt offset$LAYOUT = (OfInt)$LAYOUT.select(groupElement("offset"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static final OfInt offset$layout() {
return offset$LAYOUT;
}
private static final long offset$OFFSET = 12;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static final long offset$offset() {
return offset$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static int offset(MemorySegment struct) {
return struct.get(offset$LAYOUT, offset$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static void offset(MemorySegment struct, int fieldValue) {
struct.set(offset$LAYOUT, offset$OFFSET, fieldValue);
}
private static final OfLong cookie$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cookie"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final OfLong cookie$layout() {
return cookie$LAYOUT;
}
private static final long cookie$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final long cookie$offset() {
return cookie$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static long cookie(MemorySegment struct) {
return struct.get(cookie$LAYOUT, cookie$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static void cookie(MemorySegment struct, long fieldValue) {
struct.set(cookie$LAYOUT, cookie$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout uprobe$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6692:4"), groupElement("uprobe"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe
* }
*/
public static final GroupLayout uprobe$layout() {
return uprobe$LAYOUT;
}
private static final long uprobe$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe
* }
*/
public static final long uprobe$offset() {
return uprobe$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe
* }
*/
public static MemorySegment uprobe(MemorySegment struct) {
return struct.asSlice(uprobe$OFFSET, uprobe$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe
* }
*/
public static void uprobe(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, uprobe$OFFSET, uprobe$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* }
* }
*/
public static class kprobe {
kprobe() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("func_name"),
Lib.C_INT.withName("name_len"),
Lib.C_INT.withName("offset"),
Lib.C_LONG_LONG.withName("addr"),
Lib.C_LONG_LONG.withName("missed"),
Lib.C_LONG_LONG.withName("cookie")
).withName("$anon$6699:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong func_name$LAYOUT = (OfLong)$LAYOUT.select(groupElement("func_name"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 func_name
* }
*/
public static final OfLong func_name$layout() {
return func_name$LAYOUT;
}
private static final long func_name$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 func_name
* }
*/
public static final long func_name$offset() {
return func_name$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 func_name
* }
*/
public static long func_name(MemorySegment struct) {
return struct.get(func_name$LAYOUT, func_name$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 func_name
* }
*/
public static void func_name(MemorySegment struct, long fieldValue) {
struct.set(func_name$LAYOUT, func_name$OFFSET, fieldValue);
}
private static final OfInt name_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("name_len"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static final OfInt name_len$layout() {
return name_len$LAYOUT;
}
private static final long name_len$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static final long name_len$offset() {
return name_len$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static int name_len(MemorySegment struct) {
return struct.get(name_len$LAYOUT, name_len$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static void name_len(MemorySegment struct, int fieldValue) {
struct.set(name_len$LAYOUT, name_len$OFFSET, fieldValue);
}
private static final OfInt offset$LAYOUT = (OfInt)$LAYOUT.select(groupElement("offset"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static final OfInt offset$layout() {
return offset$LAYOUT;
}
private static final long offset$OFFSET = 12;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static final long offset$offset() {
return offset$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static int offset(MemorySegment struct) {
return struct.get(offset$LAYOUT, offset$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 offset
* }
*/
public static void offset(MemorySegment struct, int fieldValue) {
struct.set(offset$LAYOUT, offset$OFFSET, fieldValue);
}
private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 addr
* }
*/
public static final OfLong addr$layout() {
return addr$LAYOUT;
}
private static final long addr$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 addr
* }
*/
public static final long addr$offset() {
return addr$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 addr
* }
*/
public static long addr(MemorySegment struct) {
return struct.get(addr$LAYOUT, addr$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 addr
* }
*/
public static void addr(MemorySegment struct, long fieldValue) {
struct.set(addr$LAYOUT, addr$OFFSET, fieldValue);
}
private static final OfLong missed$LAYOUT = (OfLong)$LAYOUT.select(groupElement("missed"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static final OfLong missed$layout() {
return missed$LAYOUT;
}
private static final long missed$OFFSET = 24;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static final long missed$offset() {
return missed$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static long missed(MemorySegment struct) {
return struct.get(missed$LAYOUT, missed$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 missed
* }
*/
public static void missed(MemorySegment struct, long fieldValue) {
struct.set(missed$LAYOUT, missed$OFFSET, fieldValue);
}
private static final OfLong cookie$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cookie"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final OfLong cookie$layout() {
return cookie$LAYOUT;
}
private static final long cookie$OFFSET = 32;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final long cookie$offset() {
return cookie$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static long cookie(MemorySegment struct) {
return struct.get(cookie$LAYOUT, cookie$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static void cookie(MemorySegment struct, long fieldValue) {
struct.set(cookie$LAYOUT, cookie$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout kprobe$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6692:4"), groupElement("kprobe"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe
* }
*/
public static final GroupLayout kprobe$layout() {
return kprobe$LAYOUT;
}
private static final long kprobe$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe
* }
*/
public static final long kprobe$offset() {
return kprobe$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe
* }
*/
public static MemorySegment kprobe(MemorySegment struct) {
return struct.asSlice(kprobe$OFFSET, kprobe$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe
* }
*/
public static void kprobe(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, kprobe$OFFSET, kprobe$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* }
* }
*/
public static class tracepoint {
tracepoint() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("tp_name"),
Lib.C_INT.withName("name_len"),
MemoryLayout.paddingLayout(4),
Lib.C_LONG_LONG.withName("cookie")
).withName("$anon$6707:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong tp_name$LAYOUT = (OfLong)$LAYOUT.select(groupElement("tp_name"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static final OfLong tp_name$layout() {
return tp_name$LAYOUT;
}
private static final long tp_name$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static final long tp_name$offset() {
return tp_name$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static long tp_name(MemorySegment struct) {
return struct.get(tp_name$LAYOUT, tp_name$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 tp_name
* }
*/
public static void tp_name(MemorySegment struct, long fieldValue) {
struct.set(tp_name$LAYOUT, tp_name$OFFSET, fieldValue);
}
private static final OfInt name_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("name_len"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static final OfInt name_len$layout() {
return name_len$LAYOUT;
}
private static final long name_len$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static final long name_len$offset() {
return name_len$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static int name_len(MemorySegment struct) {
return struct.get(name_len$LAYOUT, name_len$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 name_len
* }
*/
public static void name_len(MemorySegment struct, int fieldValue) {
struct.set(name_len$LAYOUT, name_len$OFFSET, fieldValue);
}
private static final OfLong cookie$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cookie"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final OfLong cookie$layout() {
return cookie$LAYOUT;
}
private static final long cookie$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final long cookie$offset() {
return cookie$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static long cookie(MemorySegment struct) {
return struct.get(cookie$LAYOUT, cookie$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static void cookie(MemorySegment struct, long fieldValue) {
struct.set(cookie$LAYOUT, cookie$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout tracepoint$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6692:4"), groupElement("tracepoint"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint
* }
*/
public static final GroupLayout tracepoint$layout() {
return tracepoint$LAYOUT;
}
private static final long tracepoint$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint
* }
*/
public static final long tracepoint$offset() {
return tracepoint$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint
* }
*/
public static MemorySegment tracepoint(MemorySegment struct) {
return struct.asSlice(tracepoint$OFFSET, tracepoint$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint
* }
*/
public static void tracepoint(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, tracepoint$OFFSET, tracepoint$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* }
* }
*/
public static class event {
event() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_LONG_LONG.withName("config"),
Lib.C_INT.withName("type"),
MemoryLayout.paddingLayout(4),
Lib.C_LONG_LONG.withName("cookie")
).withName("$anon$6713:5");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfLong config$LAYOUT = (OfLong)$LAYOUT.select(groupElement("config"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 config
* }
*/
public static final OfLong config$layout() {
return config$LAYOUT;
}
private static final long config$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 config
* }
*/
public static final long config$offset() {
return config$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 config
* }
*/
public static long config(MemorySegment struct) {
return struct.get(config$LAYOUT, config$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 config
* }
*/
public static void config(MemorySegment struct, long fieldValue) {
struct.set(config$LAYOUT, config$OFFSET, fieldValue);
}
private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static final OfInt type$layout() {
return type$LAYOUT;
}
private static final long type$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static final long type$offset() {
return type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static int type(MemorySegment struct) {
return struct.get(type$LAYOUT, type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 type
* }
*/
public static void type(MemorySegment struct, int fieldValue) {
struct.set(type$LAYOUT, type$OFFSET, fieldValue);
}
private static final OfLong cookie$LAYOUT = (OfLong)$LAYOUT.select(groupElement("cookie"));
/**
* Layout for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final OfLong cookie$layout() {
return cookie$LAYOUT;
}
private static final long cookie$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static final long cookie$offset() {
return cookie$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static long cookie(MemorySegment struct) {
return struct.get(cookie$LAYOUT, cookie$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u64 cookie
* }
*/
public static void cookie(MemorySegment struct, long fieldValue) {
struct.set(cookie$LAYOUT, cookie$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout event$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6692:4"), groupElement("event"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event
* }
*/
public static final GroupLayout event$layout() {
return event$LAYOUT;
}
private static final long event$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event
* }
*/
public static final long event$offset() {
return event$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event
* }
*/
public static MemorySegment event(MemorySegment struct) {
return struct.asSlice(event$OFFSET, event$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event
* }
*/
public static void event(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, event$OFFSET, event$LAYOUT.byteSize());
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout perf_event$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("perf_event"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 type;
* __u32 : 32;
* union {
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe;
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe;
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint;
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event;
* };
* } perf_event
* }
*/
public static final GroupLayout perf_event$layout() {
return perf_event$LAYOUT;
}
private static final long perf_event$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 type;
* __u32 : 32;
* union {
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe;
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe;
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint;
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event;
* };
* } perf_event
* }
*/
public static final long perf_event$offset() {
return perf_event$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 type;
* __u32 : 32;
* union {
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe;
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe;
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint;
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event;
* };
* } perf_event
* }
*/
public static MemorySegment perf_event(MemorySegment struct) {
return struct.asSlice(perf_event$OFFSET, perf_event$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 type;
* __u32 : 32;
* union {
* struct {
* __u64 file_name;
* __u32 name_len;
* __u32 offset;
* __u64 cookie;
* } uprobe;
* struct {
* __u64 func_name;
* __u32 name_len;
* __u32 offset;
* __u64 addr;
* __u64 missed;
* __u64 cookie;
* } kprobe;
* struct {
* __u64 tp_name;
* __u32 name_len;
* __u32 : 32;
* __u64 cookie;
* } tracepoint;
* struct {
* __u64 config;
* __u32 type;
* __u32 : 32;
* __u64 cookie;
* } event;
* };
* } perf_event
* }
*/
public static void perf_event(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, perf_event$OFFSET, perf_event$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* }
* }
*/
public static class tcx {
tcx() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("ifindex"),
Lib.C_INT.withName("attach_type")
).withName("$anon$6721:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt ifindex$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ifindex"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static final OfInt ifindex$layout() {
return ifindex$LAYOUT;
}
private static final long ifindex$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static final long ifindex$offset() {
return ifindex$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static int ifindex(MemorySegment struct) {
return struct.get(ifindex$LAYOUT, ifindex$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static void ifindex(MemorySegment struct, int fieldValue) {
struct.set(ifindex$LAYOUT, ifindex$OFFSET, fieldValue);
}
private static final OfInt attach_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final OfInt attach_type$layout() {
return attach_type$LAYOUT;
}
private static final long attach_type$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final long attach_type$offset() {
return attach_type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static int attach_type(MemorySegment struct) {
return struct.get(attach_type$LAYOUT, attach_type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static void attach_type(MemorySegment struct, int fieldValue) {
struct.set(attach_type$LAYOUT, attach_type$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout tcx$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("tcx"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } tcx
* }
*/
public static final GroupLayout tcx$layout() {
return tcx$LAYOUT;
}
private static final long tcx$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } tcx
* }
*/
public static final long tcx$offset() {
return tcx$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } tcx
* }
*/
public static MemorySegment tcx(MemorySegment struct) {
return struct.asSlice(tcx$OFFSET, tcx$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } tcx
* }
*/
public static void tcx(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, tcx$OFFSET, tcx$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* }
* }
*/
public static class netkit {
netkit() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("ifindex"),
Lib.C_INT.withName("attach_type")
).withName("$anon$6725:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt ifindex$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ifindex"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static final OfInt ifindex$layout() {
return ifindex$LAYOUT;
}
private static final long ifindex$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static final long ifindex$offset() {
return ifindex$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static int ifindex(MemorySegment struct) {
return struct.get(ifindex$LAYOUT, ifindex$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 ifindex
* }
*/
public static void ifindex(MemorySegment struct, int fieldValue) {
struct.set(ifindex$LAYOUT, ifindex$OFFSET, fieldValue);
}
private static final OfInt attach_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final OfInt attach_type$layout() {
return attach_type$LAYOUT;
}
private static final long attach_type$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final long attach_type$offset() {
return attach_type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static int attach_type(MemorySegment struct) {
return struct.get(attach_type$LAYOUT, attach_type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static void attach_type(MemorySegment struct, int fieldValue) {
struct.set(attach_type$LAYOUT, attach_type$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout netkit$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("netkit"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } netkit
* }
*/
public static final GroupLayout netkit$layout() {
return netkit$LAYOUT;
}
private static final long netkit$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } netkit
* }
*/
public static final long netkit$offset() {
return netkit$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } netkit
* }
*/
public static MemorySegment netkit(MemorySegment struct) {
return struct.asSlice(netkit$OFFSET, netkit$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 ifindex;
* __u32 attach_type;
* } netkit
* }
*/
public static void netkit(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, netkit$OFFSET, netkit$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* struct {
* __u32 map_id;
* __u32 attach_type;
* }
* }
*/
public static class sockmap {
sockmap() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
Lib.C_INT.withName("map_id"),
Lib.C_INT.withName("attach_type")
).withName("$anon$6729:3");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt map_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("map_id"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static final OfInt map_id$layout() {
return map_id$LAYOUT;
}
private static final long map_id$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static final long map_id$offset() {
return map_id$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static int map_id(MemorySegment struct) {
return struct.get(map_id$LAYOUT, map_id$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 map_id
* }
*/
public static void map_id(MemorySegment struct, int fieldValue) {
struct.set(map_id$LAYOUT, map_id$OFFSET, fieldValue);
}
private static final OfInt attach_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("attach_type"));
/**
* Layout for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final OfInt attach_type$layout() {
return attach_type$LAYOUT;
}
private static final long attach_type$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static final long attach_type$offset() {
return attach_type$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static int attach_type(MemorySegment struct) {
return struct.get(attach_type$LAYOUT, attach_type$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* __u32 attach_type
* }
*/
public static void attach_type(MemorySegment struct, int fieldValue) {
struct.set(attach_type$LAYOUT, attach_type$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
private static final GroupLayout sockmap$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$6618:2"), groupElement("sockmap"));
/**
* Layout for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* __u32 attach_type;
* } sockmap
* }
*/
public static final GroupLayout sockmap$layout() {
return sockmap$LAYOUT;
}
private static final long sockmap$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* __u32 attach_type;
* } sockmap
* }
*/
public static final long sockmap$offset() {
return sockmap$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* __u32 attach_type;
* } sockmap
* }
*/
public static MemorySegment sockmap(MemorySegment struct) {
return struct.asSlice(sockmap$OFFSET, sockmap$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* struct {
* __u32 map_id;
* __u32 attach_type;
* } sockmap
* }
*/
public static void sockmap(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, sockmap$OFFSET, sockmap$LAYOUT.byteSize());
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}