Class IPTosMessage

All Implemented Interfaces:
Proxy

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

Contains the type of service (ToS) byte of an IPv4 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_IPV4 family with G_SOCKET_TYPE_DATAGRAM type). The message is not meant for sending. To set ToS field to be used in datagrams sent on a Socket use:

g_socket_set_option (socket, IPPROTO_IP, IP_TOS, <ToS value>, &error);
Since:
2.88
  • Constructor Details

    • IPTosMessage

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

      public IPTosMessage(byte dscp, EcnCodePoint ecn)
      Creates a new type-of-service 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
    • IPTosMessage

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

    • getType

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

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

      protected IPTosMessage 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 IPTosMessage.Builder<? extends IPTosMessage.Builder> builder()
      A IPTosMessage.Builder object constructs a IPTosMessage with the specified properties. Use the various set...() methods to set properties, and finish construction with IPTosMessage.Builder.build().
      Returns:
      the builder object