Skip to content

Gio.IPTosMessage

class — 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.receive_message 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);

Constructors

new

@classmethod
def new(cls, dscp: int, ecn: EcnCodePoint | int) -> SocketControlMessage

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

Methods

get_dscp

def get_dscp(self) -> int

Gets the differentiated services code point stored in message.

get_ecn

def get_ecn(self) -> EcnCodePoint

Gets the Explicit Congestion Notification code point stored in message.