PRIO

The following classes provide access to the prio queueing discipline:


class PrioQDisc(qdisc_handle: Handle, parent_handle: Optional[Handle], bands: Optional[int] = None, priomap: Optional[Sequence[int]] = None)[source]

Bases: QDisc

This class provides access to the Priority queueing discipline of Linux (see tc-prio(8)).

Parameters:
  • qdisc_handle – handle of this PrioQDisc

  • parent_handle – handle of parent, None if this is a root queuing discipline

  • bands – as documented in tc-prio(8)

  • priomap – as documented in tc-prio(8)

The bands and priomap parameters must be consistent:
  • priomap must have 16 entries (number of Linux priorities)

  • value of each entry in priomap must be less than bands

get_description() str[source]

Returns a string describing the queuing discipline and its attributes

get_bands() int[source]

Returns the number of bands

get_priomap() Tuple[int][source]

Returns the priomap

qdisc_creation_args() List[str][source]

Returns the arguments expected by the tc(8) command to create a prio qdisc

dump(outfile: TextIO, level=0, qclass_map: Optional[Mapping[Handle, QClass]] = None)

Recursively dump this Qdisc to outfile.

The qclass_map, if present, is used to determine the destination QClass objects of traffic filters.

get_child(handle: Handle) Optional[QClass]

Returns the QClass with the specified handle

get_child_count() int

Return number of children of this QDisc/QClass

get_child_iter() Iterator[QClass]

Returns an iterator for the QClass children of this QDisc/QClass.

get_children() List[QClass]

Returns the children of this QDisc/QClass.

get_config() QDiscConfig

Returns the QDiscConfig where this QDisc/QClass has been instantiated, or None if not instantiated.

get_handle() Handle

Returns the QDisc/QClass handle

get_interface() Optional[str]

Returns the interface where this QDisc/QClass has been instantiated, or None if the QDisc/QClass is not instantiated.

get_parent_handle() Optional[Handle]

Returns the handle of the parent of this QDisc/QClass

get_stats() Optional[QStats]

Returns queuing stats.

is_default() bool

Returns True if this QDisc is the default qdisc used by the kernel.

static is_ingress() bool

Returns True if this QDisc is the ingress qdisc

is_root() bool

Returns True if this is a root QDisc


class PrioQClass(handle: Handle, parent_handle: Handle, class_name: Optional[str] = None)[source]

Bases: QClass

A class of the PrioQDisc (prio) queuing discipline.

Parameters:
  • handleHandle of this QClass

  • parent_handleHandle of the parent of this QClass

  • class_name – optional class name; defaults to the class handle

get_description() str[source]

Returns a string describing the class and its attributes

dump(outfile: TextIO, level: int, qclass_map: Optional[Mapping[Handle, QClass]] = None)

Recursively dump this QClass to outfile.

The qclass_map, if present, is used to determine the destination QClass objects of traffic filters.

get_class_name() str

Returns the class name

get_config() QDiscConfig

Returns the QDiscConfig where this QDisc/QClass has been instantiated, or None if not instantiated.

get_handle() Handle

Returns the QDisc/QClass handle

get_interface() Optional[str]

Returns the interface where this QDisc/QClass has been instantiated, or None if the QDisc/QClass is not instantiated.

get_parent_handle() Optional[Handle]

Returns the handle of the parent of this QDisc/QClass

get_qdisc() Optional[QDisc]

Returns the QDisc under this QClass; returns None if there is no QDisc, or if this is not a leaf queuing class

get_stats() Optional[QStats]

Returns queuing stats.

is_leaf() bool

Returns True if this is a leaf queuing class

set_class_name(class_name: str) None

Sets the class name

set_qdisc(qdisc: QDisc) None

Set the QDisc under this queuing class