Class IPv6TclassMessage

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class IPv6TclassMessage extends SocketControlMessage

Contains the Traffic Class byte of an IPv6 header.

This consists of the DSCP field as per RFC 2474, and the ECN field as per RFC 3168.

It may be received using Socket.receiveMessage(Out, InputVector[], Out, Out, Cancellable) over UDP sockets (i.e. sockets in the G_SOCKET_FAMILY_IPV6 family with G_SOCKET_TYPE_DATAGRAM type). The message is not meant for sending. To set Traffic Class field to be used in datagrams sent on a Socket use:

g_socket_set_option (socket, IPPROTO_IPV6, IPV6_TCLASS, <TC value>, &error);
Since:
2.88
  • Constructor Details

    • IPv6TclassMessage

      public IPv6TclassMessage(MemorySegment address)
      Create a IPv6TclassMessage instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • IPv6TclassMessage

      public IPv6TclassMessage(byte dscp, EcnCodePoint ecn)
      Creates a new traffic class message with given DSCP and ECN values.
      Parameters:
      dscp - the DSCP value of the message
      ecn - the ECN value of the message
      Since:
      2.88
    • IPv6TclassMessage

      public IPv6TclassMessage()
      Create a new IPv6TclassMessage.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the IPv6TclassMessage class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected IPv6TclassMessage asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class SocketControlMessage
      Returns:
      the instance as if it were its parent type
    • getDscp

      public byte getDscp()
      Gets the differentiated services code point stored in message.
      Returns:
      A DSCP value as described in RFC 2474.
      Since:
      2.88
    • getEcn

      public EcnCodePoint getEcn()
      Gets the Explicit Congestion Notification code point stored in message.
      Returns:
      An ECN value as described in RFC 3168.
      Since:
      2.88
    • builder

      public static IPv6TclassMessage.Builder<? extends IPv6TclassMessage.Builder> builder()
      A IPv6TclassMessage.Builder object constructs a IPv6TclassMessage with the specified properties. Use the various set...() methods to set properties, and finish construction with IPv6TclassMessage.Builder.build().
      Returns:
      the builder object