#[non_exhaustive]pub struct TcActionGeneric {
pub index: u32,
pub capab: u32,
pub action: TcActionType,
pub refcnt: i32,
pub bindcnt: i32,
}Expand description
Generic traffic control action parameters.
This structure is used to describe attributes common to all traffic control actions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.index: u32The index of the action is a unique identifier used to track
actions installed in the kernel.
Each action type (e.g. mirror or nat) has its own independent
index space.
If you assign the index field to 0 when creating an action, the
kernel will assign a unique index to the new action.
capab: u32NOTE: I cannot find any documentation on this field nor any place
where it is used in iproute2 or the Linux kernel.
The capab field is part of the #define tc_gen in the kernel,
and that #define is used in many places,
but I don’t see any place using the capab field in any way.
I may be looking in the wrong place or missing something.
action: TcActionTypeAction type.
refcnt: i32Reference count of this action.
This refers to the number of times this action is referenced within the
kernel.
Actions are cleaned up (deleted) when refcnt reaches 0.
If you create an action on its own (i.e., not associated with a
filter), the refcnt will be 1.
If that action is then associated with a filter, the refcnt will be
2.
If you then delete that filter, the refcnt will be 1 and the action
will remain until you explicitly delete it (which is only possible
when the refcnt is 1 and the bindcnt is 0).
If you were to create an action indirectly (e.g., as part of creating a
filter) then the refcnt will still be 1 (along with the
bindcnt).
If you then create another filter that references the same action, the
refcnt will be 2 (along with the bindcnt).
If you then deleted both of those actions,
the refcnt would be 0 and the action would be removed from the
kernel.
bindcnt: i32Bind count of this action.
The number of filters that reference (bind to) this action.
Trait Implementations§
Source§impl Clone for TcActionGeneric
impl Clone for TcActionGeneric
Source§fn clone(&self) -> TcActionGeneric
fn clone(&self) -> TcActionGeneric
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more