UAPI Sorting


You can use additional parameters to sort UAPI output.

Sort output

UAPI sorting uses four basic parameters:


Whether to enable sorting.

  • 1 — Enable sorting.
  • 0 — Disable sorting.


The return to sort by. The name of one of the function's returns.


The type of sorting to use.

This parameter defaults to lexicographic.


You must set this parameter whenever you sort numeric values, or the function will fail.

  • ipv4 — Sort output by the numeric value of each octet in an IPv4 address.
  • numeric — Sort output in numeric order, with 0 as the lowest number.
  • numeric zero as_max — Sort output in numeric order, with 0 as the highest number.
  • lexicographic — Sort output in alphabetical order.


Whether to sort data in reverse order.

  • 1 — Sort in reverse order.
  • 0 — Do not sort in reverse order.