Class CMsghdr

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct
org.lwjgl.system.linux.CMsghdr
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class CMsghdr extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource

Layout


 struct cmsghdr {
     socklen_t cmsg_len();
     int cmsg_level();
     int cmsg_type();
     char cmsg_data[0];
 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An array of CMsghdr structs.

    Nested classes/interfaces inherited from class org.lwjgl.system.Struct

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct size in bytes.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    CMsghdr(ByteBuffer container)
    Creates a CMsghdr instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    static CMsghdr
    Returns a new CMsghdr instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new CMsghdr.Buffer instance allocated with memCalloc.
    calloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new CMsghdr.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static CMsghdr
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new CMsghdr instance allocated on the specified MemoryStack and initializes all its bits to zero.
     
    byte
    cmsg_data(int index)
     
    cmsg_data(int index, byte value)
    Sets the specified value at the specified index of the cmsg_data field.
    Copies the specified ByteBuffer to the cmsg_data field.
    int
    data byte count, including header
    cmsg_len(int value)
    Sets the specified value to the cmsg_len() field.
    int
    originating protocol
    cmsg_level(int value)
    Sets the specified value to the cmsg_level() field.
    int
    protocol-specific type
    cmsg_type(int value)
    Sets the specified value to the cmsg_type() field.
    static CMsghdr
    Returns a new CMsghdr instance allocated with BufferUtils.
    create(int capacity)
    Returns a new CMsghdr.Buffer instance allocated with BufferUtils.
    static CMsghdr
    create(long address)
    Returns a new CMsghdr instance for the specified memory address.
    create(long address, int capacity)
    Create a CMsghdr.Buffer instance at the specified memory.
    static CMsghdr
    createSafe(long address)
    Like create, but returns null if address is NULL.
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    static CMsghdr
    Returns a new CMsghdr instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new CMsghdr.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new CMsghdr.Buffer instance allocated on the specified MemoryStack.
    static CMsghdr
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new CMsghdr instance allocated on the specified MemoryStack.
    static ByteBuffer
    ncmsg_data(long struct)
    Unsafe version of cmsg_data().
    static byte
    ncmsg_data(long struct, int index)
    Unsafe version of cmsg_data.
    static void
    ncmsg_data(long struct, int index, byte value)
    Unsafe version of cmsg_data.
    static void
    ncmsg_data(long struct, ByteBuffer value)
    Unsafe version of cmsg_data.
    static int
    ncmsg_len(long struct)
    Unsafe version of cmsg_len().
    static void
    ncmsg_len(long struct, int value)
    Unsafe version of cmsg_len.
    static int
    ncmsg_level(long struct)
    Unsafe version of cmsg_level().
    static void
    ncmsg_level(long struct, int value)
    Unsafe version of cmsg_level.
    static int
    ncmsg_type(long struct)
    Unsafe version of cmsg_type().
    static void
    ncmsg_type(long struct, int value)
    Unsafe version of cmsg_type.
    set(int cmsg_len, int cmsg_level, int cmsg_type, ByteBuffer cmsg_data)
    Initializes this struct with the specified values.
    set(CMsghdr src)
    Copies the specified struct data to this struct.
    int
     

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • CMSG_LEN

      public static final int CMSG_LEN
      The struct member offsets.
    • CMSG_LEVEL

      public static final int CMSG_LEVEL
      The struct member offsets.
    • CMSG_TYPE

      public static final int CMSG_TYPE
      The struct member offsets.
    • CMSG_DATA

      public static final int CMSG_DATA
      The struct member offsets.
  • Constructor Details

    • CMsghdr

      public CMsghdr(ByteBuffer container)
      Creates a CMsghdr instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct
    • cmsg_len

      public int cmsg_len()
      data byte count, including header
    • cmsg_level

      public int cmsg_level()
      originating protocol
    • cmsg_type

      public int cmsg_type()
      protocol-specific type
    • cmsg_data

      public ByteBuffer cmsg_data()
      Returns:
      a ByteBuffer view of the cmsg_data field.
    • cmsg_data

      public byte cmsg_data(int index)
      Returns:
      the value at the specified index of the cmsg_data field.
    • cmsg_len

      public CMsghdr cmsg_len(int value)
      Sets the specified value to the cmsg_len() field.
    • cmsg_level

      public CMsghdr cmsg_level(int value)
      Sets the specified value to the cmsg_level() field.
    • cmsg_type

      public CMsghdr cmsg_type(int value)
      Sets the specified value to the cmsg_type() field.
    • cmsg_data

      public CMsghdr cmsg_data(ByteBuffer value)
      Copies the specified ByteBuffer to the cmsg_data field.
    • cmsg_data

      public CMsghdr cmsg_data(int index, byte value)
      Sets the specified value at the specified index of the cmsg_data field.
    • set

      public CMsghdr set(int cmsg_len, int cmsg_level, int cmsg_type, ByteBuffer cmsg_data)
      Initializes this struct with the specified values.
    • set

      public CMsghdr set(CMsghdr src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static CMsghdr malloc()
      Returns a new CMsghdr instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static CMsghdr calloc()
      Returns a new CMsghdr instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static CMsghdr create()
      Returns a new CMsghdr instance allocated with BufferUtils.
    • create

      public static CMsghdr create(long address)
      Returns a new CMsghdr instance for the specified memory address.
    • createSafe

      @Nullable public static CMsghdr createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static CMsghdr.Buffer malloc(int capacity)
      Returns a new CMsghdr.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static CMsghdr.Buffer calloc(int capacity)
      Returns a new CMsghdr.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static CMsghdr.Buffer create(int capacity)
      Returns a new CMsghdr.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static CMsghdr.Buffer create(long address, int capacity)
      Create a CMsghdr.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      @Nullable public static CMsghdr.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static CMsghdr malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new CMsghdr instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static CMsghdr calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new CMsghdr instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static CMsghdr.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new CMsghdr.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static CMsghdr.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new CMsghdr.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ncmsg_len

      public static int ncmsg_len(long struct)
      Unsafe version of cmsg_len().
    • ncmsg_level

      public static int ncmsg_level(long struct)
      Unsafe version of cmsg_level().
    • ncmsg_type

      public static int ncmsg_type(long struct)
      Unsafe version of cmsg_type().
    • ncmsg_data

      public static ByteBuffer ncmsg_data(long struct)
      Unsafe version of cmsg_data().
    • ncmsg_data

      public static byte ncmsg_data(long struct, int index)
      Unsafe version of cmsg_data.
    • ncmsg_len

      public static void ncmsg_len(long struct, int value)
      Unsafe version of cmsg_len.
    • ncmsg_level

      public static void ncmsg_level(long struct, int value)
      Unsafe version of cmsg_level.
    • ncmsg_type

      public static void ncmsg_type(long struct, int value)
      Unsafe version of cmsg_type.
    • ncmsg_data

      public static void ncmsg_data(long struct, ByteBuffer value)
      Unsafe version of cmsg_data.
    • ncmsg_data

      public static void ncmsg_data(long struct, int index, byte value)
      Unsafe version of cmsg_data.