All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.bechberger.ebpf.bpf.raw.bpf_link_create_opts Maven / Gradle / Ivy

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_create_opts {
 *     size_t sz;
 *     __u32 flags;
 *     union bpf_iter_link_info *iter_info;
 *     __u32 iter_info_len;
 *     __u32 target_btf_id;
 *     union {
 *         struct {
 *             __u64 bpf_cookie;
 *         } perf_event;
 *         struct {
 *             __u32 flags;
 *             __u32 cnt;
 *             const char **syms;
 *             const unsigned long *addrs;
 *             const __u64 *cookies;
 *         } kprobe_multi;
 *         struct {
 *             __u32 flags;
 *             __u32 cnt;
 *             const char *path;
 *             const unsigned long *offsets;
 *             const unsigned long *ref_ctr_offsets;
 *             const __u64 *cookies;
 *             __u32 pid;
 *         } uprobe_multi;
 *         struct {
 *             __u64 cookie;
 *         } tracing;
 *         struct {
 *             __u32 pf;
 *             __u32 hooknum;
 *             __s32 priority;
 *             __u32 flags;
 *         } netfilter;
 *         struct {
 *             __u32 relative_fd;
 *             __u32 relative_id;
 *             __u64 expected_revision;
 *         } tcx;
 *         struct {
 *             __u32 relative_fd;
 *             __u32 relative_id;
 *             __u64 expected_revision;
 *         } netkit;
 *     };
 *     size_t : 0;
 * }
 * }
 */
public class bpf_link_create_opts {

    bpf_link_create_opts() {
        // Should not be called directly
    }

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        Lib.C_LONG.withName("sz"),
        Lib.C_INT.withName("flags"),
        MemoryLayout.paddingLayout(4),
        Lib.C_POINTER.withName("iter_info"),
        Lib.C_INT.withName("iter_info_len"),
        Lib.C_INT.withName("target_btf_id"),
        MemoryLayout.unionLayout(
            bpf_link_create_opts.perf_event.layout().withName("perf_event"),
            bpf_link_create_opts.kprobe_multi.layout().withName("kprobe_multi"),
            bpf_link_create_opts.uprobe_multi.layout().withName("uprobe_multi"),
            bpf_link_create_opts.tracing.layout().withName("tracing"),
            bpf_link_create_opts.netfilter.layout().withName("netfilter"),
            bpf_link_create_opts.tcx.layout().withName("tcx"),
            bpf_link_create_opts.netkit.layout().withName("netkit")
        ).withName("$anon$399:2")
    ).withName("bpf_link_create_opts");

    /**
     * The layout of this struct
     */
    public static final GroupLayout layout() {
        return $LAYOUT;
    }

    private static final OfLong sz$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sz"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * size_t sz
     * }
     */
    public static final OfLong sz$layout() {
        return sz$LAYOUT;
    }

    private static final long sz$OFFSET = 0;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * size_t sz
     * }
     */
    public static final long sz$offset() {
        return sz$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * size_t sz
     * }
     */
    public static long sz(MemorySegment struct) {
        return struct.get(sz$LAYOUT, sz$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * size_t sz
     * }
     */
    public static void sz(MemorySegment struct, long fieldValue) {
        struct.set(sz$LAYOUT, sz$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 = 8;

    /**
     * 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 AddressLayout iter_info$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("iter_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * union bpf_iter_link_info *iter_info
     * }
     */
    public static final AddressLayout iter_info$layout() {
        return iter_info$LAYOUT;
    }

    private static final long iter_info$OFFSET = 16;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * union bpf_iter_link_info *iter_info
     * }
     */
    public static final long iter_info$offset() {
        return iter_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * union bpf_iter_link_info *iter_info
     * }
     */
    public static MemorySegment iter_info(MemorySegment struct) {
        return struct.get(iter_info$LAYOUT, iter_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * union bpf_iter_link_info *iter_info
     * }
     */
    public static void iter_info(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(iter_info$LAYOUT, iter_info$OFFSET, fieldValue);
    }

    private static final OfInt iter_info_len$LAYOUT = (OfInt)$LAYOUT.select(groupElement("iter_info_len"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * __u32 iter_info_len
     * }
     */
    public static final OfInt iter_info_len$layout() {
        return iter_info_len$LAYOUT;
    }

    private static final long iter_info_len$OFFSET = 24;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * __u32 iter_info_len
     * }
     */
    public static final long iter_info_len$offset() {
        return iter_info_len$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * __u32 iter_info_len
     * }
     */
    public static int iter_info_len(MemorySegment struct) {
        return struct.get(iter_info_len$LAYOUT, iter_info_len$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * __u32 iter_info_len
     * }
     */
    public static void iter_info_len(MemorySegment struct, int fieldValue) {
        struct.set(iter_info_len$LAYOUT, iter_info_len$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 = 28;

    /**
     * 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);
    }

    /**
     * {@snippet lang=c :
     * struct {
     *     __u64 bpf_cookie;
     * }
     * }
     */
    public static class perf_event {

        perf_event() {
            // Should not be called directly
        }

        private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
            Lib.C_LONG_LONG.withName("bpf_cookie")
        ).withName("$anon$400:3");

        /**
         * The layout of this struct
         */
        public static final GroupLayout layout() {
            return $LAYOUT;
        }

        private static final OfLong bpf_cookie$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bpf_cookie"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u64 bpf_cookie
         * }
         */
        public static final OfLong bpf_cookie$layout() {
            return bpf_cookie$LAYOUT;
        }

        private static final long bpf_cookie$OFFSET = 0;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u64 bpf_cookie
         * }
         */
        public static final long bpf_cookie$offset() {
            return bpf_cookie$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u64 bpf_cookie
         * }
         */
        public static long bpf_cookie(MemorySegment struct) {
            return struct.get(bpf_cookie$LAYOUT, bpf_cookie$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u64 bpf_cookie
         * }
         */
        public static void bpf_cookie(MemorySegment struct, long fieldValue) {
            struct.set(bpf_cookie$LAYOUT, bpf_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 perf_event$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$399:2"), groupElement("perf_event"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 bpf_cookie;
     * } perf_event
     * }
     */
    public static final GroupLayout perf_event$layout() {
        return perf_event$LAYOUT;
    }

    private static final long perf_event$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 bpf_cookie;
     * } perf_event
     * }
     */
    public static final long perf_event$offset() {
        return perf_event$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 bpf_cookie;
     * } 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 {
     *     __u64 bpf_cookie;
     * } 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 flags;
     *     __u32 cnt;
     *     const char **syms;
     *     const unsigned long *addrs;
     *     const __u64 *cookies;
     * }
     * }
     */
    public static class kprobe_multi {

        kprobe_multi() {
            // Should not be called directly
        }

        private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
            Lib.C_INT.withName("flags"),
            Lib.C_INT.withName("cnt"),
            Lib.C_POINTER.withName("syms"),
            Lib.C_POINTER.withName("addrs"),
            Lib.C_POINTER.withName("cookies")
        ).withName("$anon$403:3");

        /**
         * The layout of this struct
         */
        public static final GroupLayout layout() {
            return $LAYOUT;
        }

        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 = 0;

        /**
         * 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 cnt$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cnt"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static final OfInt cnt$layout() {
            return cnt$LAYOUT;
        }

        private static final long cnt$OFFSET = 4;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static final long cnt$offset() {
            return cnt$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static int cnt(MemorySegment struct) {
            return struct.get(cnt$LAYOUT, cnt$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static void cnt(MemorySegment struct, int fieldValue) {
            struct.set(cnt$LAYOUT, cnt$OFFSET, fieldValue);
        }

        private static final AddressLayout syms$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("syms"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const char **syms
         * }
         */
        public static final AddressLayout syms$layout() {
            return syms$LAYOUT;
        }

        private static final long syms$OFFSET = 8;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const char **syms
         * }
         */
        public static final long syms$offset() {
            return syms$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const char **syms
         * }
         */
        public static MemorySegment syms(MemorySegment struct) {
            return struct.get(syms$LAYOUT, syms$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const char **syms
         * }
         */
        public static void syms(MemorySegment struct, MemorySegment fieldValue) {
            struct.set(syms$LAYOUT, syms$OFFSET, fieldValue);
        }

        private static final AddressLayout addrs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("addrs"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const unsigned long *addrs
         * }
         */
        public static final AddressLayout addrs$layout() {
            return addrs$LAYOUT;
        }

        private static final long addrs$OFFSET = 16;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const unsigned long *addrs
         * }
         */
        public static final long addrs$offset() {
            return addrs$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const unsigned long *addrs
         * }
         */
        public static MemorySegment addrs(MemorySegment struct) {
            return struct.get(addrs$LAYOUT, addrs$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const unsigned long *addrs
         * }
         */
        public static void addrs(MemorySegment struct, MemorySegment fieldValue) {
            struct.set(addrs$LAYOUT, addrs$OFFSET, fieldValue);
        }

        private static final AddressLayout cookies$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("cookies"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static final AddressLayout cookies$layout() {
            return cookies$LAYOUT;
        }

        private static final long cookies$OFFSET = 24;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static final long cookies$offset() {
            return cookies$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static MemorySegment cookies(MemorySegment struct) {
            return struct.get(cookies$LAYOUT, cookies$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static void cookies(MemorySegment struct, MemorySegment 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$399:2"), groupElement("kprobe_multi"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char **syms;
     *     const unsigned long *addrs;
     *     const __u64 *cookies;
     * } kprobe_multi
     * }
     */
    public static final GroupLayout kprobe_multi$layout() {
        return kprobe_multi$LAYOUT;
    }

    private static final long kprobe_multi$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char **syms;
     *     const unsigned long *addrs;
     *     const __u64 *cookies;
     * } kprobe_multi
     * }
     */
    public static final long kprobe_multi$offset() {
        return kprobe_multi$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char **syms;
     *     const unsigned long *addrs;
     *     const __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 {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char **syms;
     *     const unsigned long *addrs;
     *     const __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 {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char *path;
     *     const unsigned long *offsets;
     *     const unsigned long *ref_ctr_offsets;
     *     const __u64 *cookies;
     *     __u32 pid;
     * }
     * }
     */
    public static class uprobe_multi {

        uprobe_multi() {
            // Should not be called directly
        }

        private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
            Lib.C_INT.withName("flags"),
            Lib.C_INT.withName("cnt"),
            Lib.C_POINTER.withName("path"),
            Lib.C_POINTER.withName("offsets"),
            Lib.C_POINTER.withName("ref_ctr_offsets"),
            Lib.C_POINTER.withName("cookies"),
            Lib.C_INT.withName("pid"),
            MemoryLayout.paddingLayout(4)
        ).withName("$anon$410:3");

        /**
         * The layout of this struct
         */
        public static final GroupLayout layout() {
            return $LAYOUT;
        }

        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 = 0;

        /**
         * 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 cnt$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cnt"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static final OfInt cnt$layout() {
            return cnt$LAYOUT;
        }

        private static final long cnt$OFFSET = 4;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static final long cnt$offset() {
            return cnt$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static int cnt(MemorySegment struct) {
            return struct.get(cnt$LAYOUT, cnt$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u32 cnt
         * }
         */
        public static void cnt(MemorySegment struct, int fieldValue) {
            struct.set(cnt$LAYOUT, cnt$OFFSET, fieldValue);
        }

        private static final AddressLayout path$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("path"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const char *path
         * }
         */
        public static final AddressLayout path$layout() {
            return path$LAYOUT;
        }

        private static final long path$OFFSET = 8;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const char *path
         * }
         */
        public static final long path$offset() {
            return path$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const char *path
         * }
         */
        public static MemorySegment path(MemorySegment struct) {
            return struct.get(path$LAYOUT, path$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const char *path
         * }
         */
        public static void path(MemorySegment struct, MemorySegment fieldValue) {
            struct.set(path$LAYOUT, path$OFFSET, fieldValue);
        }

        private static final AddressLayout offsets$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("offsets"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const unsigned long *offsets
         * }
         */
        public static final AddressLayout offsets$layout() {
            return offsets$LAYOUT;
        }

        private static final long offsets$OFFSET = 16;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const unsigned long *offsets
         * }
         */
        public static final long offsets$offset() {
            return offsets$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const unsigned long *offsets
         * }
         */
        public static MemorySegment offsets(MemorySegment struct) {
            return struct.get(offsets$LAYOUT, offsets$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const unsigned long *offsets
         * }
         */
        public static void offsets(MemorySegment struct, MemorySegment fieldValue) {
            struct.set(offsets$LAYOUT, offsets$OFFSET, fieldValue);
        }

        private static final AddressLayout ref_ctr_offsets$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ref_ctr_offsets"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const unsigned long *ref_ctr_offsets
         * }
         */
        public static final AddressLayout ref_ctr_offsets$layout() {
            return ref_ctr_offsets$LAYOUT;
        }

        private static final long ref_ctr_offsets$OFFSET = 24;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const unsigned long *ref_ctr_offsets
         * }
         */
        public static final long ref_ctr_offsets$offset() {
            return ref_ctr_offsets$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const unsigned long *ref_ctr_offsets
         * }
         */
        public static MemorySegment ref_ctr_offsets(MemorySegment struct) {
            return struct.get(ref_ctr_offsets$LAYOUT, ref_ctr_offsets$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const unsigned long *ref_ctr_offsets
         * }
         */
        public static void ref_ctr_offsets(MemorySegment struct, MemorySegment fieldValue) {
            struct.set(ref_ctr_offsets$LAYOUT, ref_ctr_offsets$OFFSET, fieldValue);
        }

        private static final AddressLayout cookies$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("cookies"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static final AddressLayout cookies$layout() {
            return cookies$LAYOUT;
        }

        private static final long cookies$OFFSET = 32;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static final long cookies$offset() {
            return cookies$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static MemorySegment cookies(MemorySegment struct) {
            return struct.get(cookies$LAYOUT, cookies$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * const __u64 *cookies
         * }
         */
        public static void cookies(MemorySegment struct, MemorySegment fieldValue) {
            struct.set(cookies$LAYOUT, cookies$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 = 40;

        /**
         * 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$399:2"), groupElement("uprobe_multi"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char *path;
     *     const unsigned long *offsets;
     *     const unsigned long *ref_ctr_offsets;
     *     const __u64 *cookies;
     *     __u32 pid;
     * } uprobe_multi
     * }
     */
    public static final GroupLayout uprobe_multi$layout() {
        return uprobe_multi$LAYOUT;
    }

    private static final long uprobe_multi$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char *path;
     *     const unsigned long *offsets;
     *     const unsigned long *ref_ctr_offsets;
     *     const __u64 *cookies;
     *     __u32 pid;
     * } uprobe_multi
     * }
     */
    public static final long uprobe_multi$offset() {
        return uprobe_multi$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char *path;
     *     const unsigned long *offsets;
     *     const unsigned long *ref_ctr_offsets;
     *     const __u64 *cookies;
     *     __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 {
     *     __u32 flags;
     *     __u32 cnt;
     *     const char *path;
     *     const unsigned long *offsets;
     *     const unsigned long *ref_ctr_offsets;
     *     const __u64 *cookies;
     *     __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 {
     *     __u64 cookie;
     * }
     * }
     */
    public static class tracing {

        tracing() {
            // Should not be called directly
        }

        private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
            Lib.C_LONG_LONG.withName("cookie")
        ).withName("$anon$419:3");

        /**
         * The layout of this struct
         */
        public static final GroupLayout layout() {
            return $LAYOUT;
        }

        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 = 0;

        /**
         * 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 tracing$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$399:2"), groupElement("tracing"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 cookie;
     * } tracing
     * }
     */
    public static final GroupLayout tracing$layout() {
        return tracing$LAYOUT;
    }

    private static final long tracing$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 cookie;
     * } tracing
     * }
     */
    public static final long tracing$offset() {
        return tracing$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 cookie;
     * } tracing
     * }
     */
    public static MemorySegment tracing(MemorySegment struct) {
        return struct.asSlice(tracing$OFFSET, tracing$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * struct {
     *     __u64 cookie;
     * } tracing
     * }
     */
    public static void tracing(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, tracing$OFFSET, tracing$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$422: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$399: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 = 32;

    /**
     * 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 {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * }
     * }
     */
    public static class tcx {

        tcx() {
            // Should not be called directly
        }

        private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
            Lib.C_INT.withName("relative_fd"),
            Lib.C_INT.withName("relative_id"),
            Lib.C_LONG_LONG.withName("expected_revision")
        ).withName("$anon$428:3");

        /**
         * The layout of this struct
         */
        public static final GroupLayout layout() {
            return $LAYOUT;
        }

        private static final OfInt relative_fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("relative_fd"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static final OfInt relative_fd$layout() {
            return relative_fd$LAYOUT;
        }

        private static final long relative_fd$OFFSET = 0;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static final long relative_fd$offset() {
            return relative_fd$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static int relative_fd(MemorySegment struct) {
            return struct.get(relative_fd$LAYOUT, relative_fd$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static void relative_fd(MemorySegment struct, int fieldValue) {
            struct.set(relative_fd$LAYOUT, relative_fd$OFFSET, fieldValue);
        }

        private static final OfInt relative_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("relative_id"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static final OfInt relative_id$layout() {
            return relative_id$LAYOUT;
        }

        private static final long relative_id$OFFSET = 4;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static final long relative_id$offset() {
            return relative_id$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static int relative_id(MemorySegment struct) {
            return struct.get(relative_id$LAYOUT, relative_id$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static void relative_id(MemorySegment struct, int fieldValue) {
            struct.set(relative_id$LAYOUT, relative_id$OFFSET, fieldValue);
        }

        private static final OfLong expected_revision$LAYOUT = (OfLong)$LAYOUT.select(groupElement("expected_revision"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static final OfLong expected_revision$layout() {
            return expected_revision$LAYOUT;
        }

        private static final long expected_revision$OFFSET = 8;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static final long expected_revision$offset() {
            return expected_revision$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static long expected_revision(MemorySegment struct) {
            return struct.get(expected_revision$LAYOUT, expected_revision$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static void expected_revision(MemorySegment struct, long fieldValue) {
            struct.set(expected_revision$LAYOUT, expected_revision$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$399:2"), groupElement("tcx"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } tcx
     * }
     */
    public static final GroupLayout tcx$layout() {
        return tcx$LAYOUT;
    }

    private static final long tcx$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } tcx
     * }
     */
    public static final long tcx$offset() {
        return tcx$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } tcx
     * }
     */
    public static MemorySegment tcx(MemorySegment struct) {
        return struct.asSlice(tcx$OFFSET, tcx$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } tcx
     * }
     */
    public static void tcx(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, tcx$OFFSET, tcx$LAYOUT.byteSize());
    }

    /**
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * }
     * }
     */
    public static class netkit {

        netkit() {
            // Should not be called directly
        }

        private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
            Lib.C_INT.withName("relative_fd"),
            Lib.C_INT.withName("relative_id"),
            Lib.C_LONG_LONG.withName("expected_revision")
        ).withName("$anon$433:3");

        /**
         * The layout of this struct
         */
        public static final GroupLayout layout() {
            return $LAYOUT;
        }

        private static final OfInt relative_fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("relative_fd"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static final OfInt relative_fd$layout() {
            return relative_fd$LAYOUT;
        }

        private static final long relative_fd$OFFSET = 0;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static final long relative_fd$offset() {
            return relative_fd$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static int relative_fd(MemorySegment struct) {
            return struct.get(relative_fd$LAYOUT, relative_fd$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u32 relative_fd
         * }
         */
        public static void relative_fd(MemorySegment struct, int fieldValue) {
            struct.set(relative_fd$LAYOUT, relative_fd$OFFSET, fieldValue);
        }

        private static final OfInt relative_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("relative_id"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static final OfInt relative_id$layout() {
            return relative_id$LAYOUT;
        }

        private static final long relative_id$OFFSET = 4;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static final long relative_id$offset() {
            return relative_id$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static int relative_id(MemorySegment struct) {
            return struct.get(relative_id$LAYOUT, relative_id$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u32 relative_id
         * }
         */
        public static void relative_id(MemorySegment struct, int fieldValue) {
            struct.set(relative_id$LAYOUT, relative_id$OFFSET, fieldValue);
        }

        private static final OfLong expected_revision$LAYOUT = (OfLong)$LAYOUT.select(groupElement("expected_revision"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static final OfLong expected_revision$layout() {
            return expected_revision$LAYOUT;
        }

        private static final long expected_revision$OFFSET = 8;

        /**
         * Offset for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static final long expected_revision$offset() {
            return expected_revision$OFFSET;
        }

        /**
         * Getter for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static long expected_revision(MemorySegment struct) {
            return struct.get(expected_revision$LAYOUT, expected_revision$OFFSET);
        }

        /**
         * Setter for field:
         * {@snippet lang=c :
         * __u64 expected_revision
         * }
         */
        public static void expected_revision(MemorySegment struct, long fieldValue) {
            struct.set(expected_revision$LAYOUT, expected_revision$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$399:2"), groupElement("netkit"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } netkit
     * }
     */
    public static final GroupLayout netkit$layout() {
        return netkit$LAYOUT;
    }

    private static final long netkit$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } netkit
     * }
     */
    public static final long netkit$offset() {
        return netkit$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } netkit
     * }
     */
    public static MemorySegment netkit(MemorySegment struct) {
        return struct.asSlice(netkit$OFFSET, netkit$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * struct {
     *     __u32 relative_fd;
     *     __u32 relative_id;
     *     __u64 expected_revision;
     * } netkit
     * }
     */
    public static void netkit(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, netkit$OFFSET, netkit$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);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy