# Family rt-rule netlink specification

_Peios Kernel / Internals / Netlink / specs_

> Protocol reference for the rt-rule Netlink family, generated from the Peios kernel specification.

<!-- SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) -->


<a id="rst-family-rt-rule-netlink-specification"></a>
<a id="rst-netlink-rt-rule"></a>

<!-- SPDX-License-Identifier: GPL-2.0 -->

<a id="rst-summary"></a>



## Summary



FIB rule management over rtnetlink.

<a id="rst-operations"></a>



## Operations

<a id="rst-newrule"></a>
<a id="rst-rt-rule-operation-newrule"></a>



### newrule



Add new FIB rule

- **attribute-set**:

  [fib-rule-attrs](#rst-rt-rule-attribute-set-fib-rule-attrs)

- **do**:

  **request**

  - **attributes**:

    \[`iifname`, `oifname`, `priority`, `fwmark`, `flow`, `tun-id`, `fwmask`, `table`, `suppress-prefixlen`, `suppress-ifgroup`, `goto`, `l3mdev`, `uid-range`, `protocol`, `ip-proto`, `sport-range`, `dport-range`, `dscp`, `flowlabel`, `flowlabel-mask`, `sport-mask`, `dport-mask`, `dscp-mask`\]

<a id="rst-newrule-ntf"></a>
<a id="rst-rt-rule-operation-newrule-ntf"></a>



### newrule-ntf



Notify a rule creation

- **value**:

  32

- **notify**:

  getrule

<a id="rst-delrule"></a>
<a id="rst-rt-rule-operation-delrule"></a>



### delrule



Remove an existing FIB rule

- **attribute-set**:

  [fib-rule-attrs](#rst-rt-rule-attribute-set-fib-rule-attrs)

- **do**:

  **request**

  - **attributes**:

    \[`iifname`, `oifname`, `priority`, `fwmark`, `flow`, `tun-id`, `fwmask`, `table`, `suppress-prefixlen`, `suppress-ifgroup`, `goto`, `l3mdev`, `uid-range`, `protocol`, `ip-proto`, `sport-range`, `dport-range`, `dscp`, `flowlabel`, `flowlabel-mask`, `sport-mask`, `dport-mask`, `dscp-mask`\]

<a id="rst-delrule-ntf"></a>
<a id="rst-rt-rule-operation-delrule-ntf"></a>



### delrule-ntf



Notify a rule deletion

- **value**:

  33

- **notify**:

  getrule

<a id="rst-getrule"></a>
<a id="rst-rt-rule-operation-getrule"></a>



### getrule



Dump all FIB rules

- **attribute-set**:

  [fib-rule-attrs](#rst-rt-rule-attribute-set-fib-rule-attrs)

- **dump**:

  **request**

  **reply**

  - **attributes**:

    \[`iifname`, `oifname`, `priority`, `fwmark`, `flow`, `tun-id`, `fwmask`, `table`, `suppress-prefixlen`, `suppress-ifgroup`, `goto`, `l3mdev`, `uid-range`, `protocol`, `ip-proto`, `sport-range`, `dport-range`, `dscp`, `flowlabel`, `flowlabel-mask`, `sport-mask`, `dport-mask`, `dscp-mask`\]

<a id="rst-multicast-groups"></a>



## Multicast groups

- rtnlgrp-ipv4-rule


- rtnlgrp-ipv6-rule


<a id="rst-definitions"></a>



## Definitions

<a id="rst-rtgenmsg"></a>
<a id="rst-rt-rule-definition-rtgenmsg"></a>



### rtgenmsg

- **type**:

  struct

- **members**:

  - **family (`u8`)**

<a id="rst-fib-rule-hdr"></a>
<a id="rst-rt-rule-definition-fib-rule-hdr"></a>



### fib-rule-hdr

- **type**:

  struct

- **members**:

  - **family (`u8`)**

  - **dst-len (`u8`)**

  - **src-len (`u8`)**

  - **tos (`u8`)**

  - **table (`u8`)**

  - **res1 (`pad`)**

  - **res2 (`pad`)**

  - **action (`u8`)**

  - **flags (`u32`)**

<a id="rst-fr-act"></a>
<a id="rst-rt-rule-definition-fr-act"></a>



### fr-act

- **type**:

  enum

- **enum-name**:

  None

- **entries**:

  - `unspec`


  - `to-tbl`


  - `goto`


  - `nop`


  - `res3`


  - `res4`


  - `blackhole`


  - `unreachable`


  - `prohibit`

<a id="rst-fib-rule-port-range"></a>
<a id="rst-rt-rule-definition-fib-rule-port-range"></a>



### fib-rule-port-range

- **type**:

  struct

- **members**:

  - **start (`u16`)**

  - **end (`u16`)**

<a id="rst-fib-rule-uid-range"></a>
<a id="rst-rt-rule-definition-fib-rule-uid-range"></a>



### fib-rule-uid-range

- **type**:

  struct

- **members**:

  - **start (`u32`)**

  - **end (`u32`)**

<a id="rst-attribute-sets"></a>



## Attribute sets

<a id="rst-fib-rule-attrs"></a>
<a id="rst-rt-rule-attribute-set-fib-rule-attrs"></a>



### fib-rule-attrs

<a id="rst-dst-binary"></a>



#### dst (`binary`)

- **display-hint**:

  ipv4-or-v6

<a id="rst-src-binary"></a>



#### src (`binary`)

- **display-hint**:

  ipv4-or-v6

<a id="rst-iifname-string"></a>



#### iifname (`string`)

<a id="rst-goto-u32"></a>



#### goto (`u32`)

<a id="rst-unused2-pad"></a>



#### unused2 (`pad`)

<a id="rst-priority-u32"></a>



#### priority (`u32`)

<a id="rst-unused3-pad"></a>



#### unused3 (`pad`)

<a id="rst-unused4-pad"></a>



#### unused4 (`pad`)

<a id="rst-unused5-pad"></a>



#### unused5 (`pad`)

<a id="rst-fwmark-u32"></a>



#### fwmark (`u32`)

- **display-hint**:

  hex

<a id="rst-flow-u32"></a>



#### flow (`u32`)

<a id="rst-tun-id-u64"></a>



#### tun-id (`u64`)

<a id="rst-suppress-ifgroup-u32"></a>



#### suppress-ifgroup (`u32`)

<a id="rst-suppress-prefixlen-u32"></a>



#### suppress-prefixlen (`u32`)

- **display-hint**:

  hex

<a id="rst-table-u32"></a>



#### table (`u32`)

<a id="rst-fwmask-u32"></a>



#### fwmask (`u32`)

- **display-hint**:

  hex

<a id="rst-oifname-string"></a>



#### oifname (`string`)

<a id="rst-pad-pad"></a>



#### pad (`pad`)

<a id="rst-l3mdev-u8"></a>



#### l3mdev (`u8`)

<a id="rst-uid-range-binary"></a>



#### uid-range (`binary`)

- **struct**:

  [fib-rule-uid-range](#rst-rt-rule-definition-fib-rule-uid-range)

<a id="rst-protocol-u8"></a>



#### protocol (`u8`)

<a id="rst-ip-proto-u8"></a>



#### ip-proto (`u8`)

<a id="rst-sport-range-binary"></a>



#### sport-range (`binary`)

- **struct**:

  [fib-rule-port-range](#rst-rt-rule-definition-fib-rule-port-range)

<a id="rst-dport-range-binary"></a>



#### dport-range (`binary`)

- **struct**:

  [fib-rule-port-range](#rst-rt-rule-definition-fib-rule-port-range)

<a id="rst-dscp-u8"></a>



#### dscp (`u8`)

<a id="rst-flowlabel-u32"></a>



#### flowlabel (`u32`)

- **byte-order**:

  big-endian

- **display-hint**:

  hex

<a id="rst-flowlabel-mask-u32"></a>



#### flowlabel-mask (`u32`)

- **byte-order**:

  big-endian

- **display-hint**:

  hex

<a id="rst-sport-mask-u16"></a>



#### sport-mask (`u16`)

- **display-hint**:

  hex

<a id="rst-dport-mask-u16"></a>



#### dport-mask (`u16`)

- **display-hint**:

  hex

<a id="rst-dscp-mask-u8"></a>



#### dscp-mask (`u8`)

- **display-hint**:

  hex
