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

me.bechberger.ebpf.bpf.raw.bpf_tcp_sock 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_tcp_sock {
 *     __u32 snd_cwnd;
 *     __u32 srtt_us;
 *     __u32 rtt_min;
 *     __u32 snd_ssthresh;
 *     __u32 rcv_nxt;
 *     __u32 snd_nxt;
 *     __u32 snd_una;
 *     __u32 mss_cache;
 *     __u32 ecn_flags;
 *     __u32 rate_delivered;
 *     __u32 rate_interval_us;
 *     __u32 packets_out;
 *     __u32 retrans_out;
 *     __u32 total_retrans;
 *     __u32 segs_in;
 *     __u32 data_segs_in;
 *     __u32 segs_out;
 *     __u32 data_segs_out;
 *     __u32 lost_out;
 *     __u32 sacked_out;
 *     __u64 bytes_received;
 *     __u64 bytes_acked;
 *     __u32 dsack_dups;
 *     __u32 delivered;
 *     __u32 delivered_ce;
 *     __u32 icsk_retransmits;
 * }
 * }
 */
public class bpf_tcp_sock {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        Lib.C_INT.withName("snd_cwnd"),
        Lib.C_INT.withName("srtt_us"),
        Lib.C_INT.withName("rtt_min"),
        Lib.C_INT.withName("snd_ssthresh"),
        Lib.C_INT.withName("rcv_nxt"),
        Lib.C_INT.withName("snd_nxt"),
        Lib.C_INT.withName("snd_una"),
        Lib.C_INT.withName("mss_cache"),
        Lib.C_INT.withName("ecn_flags"),
        Lib.C_INT.withName("rate_delivered"),
        Lib.C_INT.withName("rate_interval_us"),
        Lib.C_INT.withName("packets_out"),
        Lib.C_INT.withName("retrans_out"),
        Lib.C_INT.withName("total_retrans"),
        Lib.C_INT.withName("segs_in"),
        Lib.C_INT.withName("data_segs_in"),
        Lib.C_INT.withName("segs_out"),
        Lib.C_INT.withName("data_segs_out"),
        Lib.C_INT.withName("lost_out"),
        Lib.C_INT.withName("sacked_out"),
        Lib.C_LONG_LONG.withName("bytes_received"),
        Lib.C_LONG_LONG.withName("bytes_acked"),
        Lib.C_INT.withName("dsack_dups"),
        Lib.C_INT.withName("delivered"),
        Lib.C_INT.withName("delivered_ce"),
        Lib.C_INT.withName("icsk_retransmits")
    ).withName("bpf_tcp_sock");

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

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

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

    private static final long snd_cwnd$OFFSET = 0;

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

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

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

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

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

    private static final long srtt_us$OFFSET = 4;

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

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

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

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

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

    private static final long rtt_min$OFFSET = 8;

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

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

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

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

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

    private static final long snd_ssthresh$OFFSET = 12;

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

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

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

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

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

    private static final long rcv_nxt$OFFSET = 16;

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

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

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

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

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

    private static final long snd_nxt$OFFSET = 20;

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

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

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

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

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

    private static final long snd_una$OFFSET = 24;

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

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

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

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

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

    private static final long mss_cache$OFFSET = 28;

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

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

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

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

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

    private static final long ecn_flags$OFFSET = 32;

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

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

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

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

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

    private static final long rate_delivered$OFFSET = 36;

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

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

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

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

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

    private static final long rate_interval_us$OFFSET = 40;

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

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

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

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

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

    private static final long packets_out$OFFSET = 44;

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

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

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

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

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

    private static final long retrans_out$OFFSET = 48;

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

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

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

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

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

    private static final long total_retrans$OFFSET = 52;

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

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

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

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

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

    private static final long segs_in$OFFSET = 56;

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

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

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

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

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

    private static final long data_segs_in$OFFSET = 60;

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

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

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

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

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

    private static final long segs_out$OFFSET = 64;

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

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

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

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

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

    private static final long data_segs_out$OFFSET = 68;

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

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

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

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

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

    private static final long lost_out$OFFSET = 72;

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

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

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

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

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

    private static final long sacked_out$OFFSET = 76;

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

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

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

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

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

    private static final long bytes_received$OFFSET = 80;

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

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

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

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

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

    private static final long bytes_acked$OFFSET = 88;

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

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

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

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

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

    private static final long dsack_dups$OFFSET = 96;

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

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

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

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

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

    private static final long delivered$OFFSET = 100;

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

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

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

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

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

    private static final long delivered_ce$OFFSET = 104;

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

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

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

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

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

    private static final long icsk_retransmits$OFFSET = 108;

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

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

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy