Struct netlink_packet_route::tc::TcActionGeneric
source · #[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: u32
The 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: u32
NOTE: 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: TcActionType
Action type.
refcnt: i32
Reference 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: i32
Bind 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 moresource§impl Debug for TcActionGeneric
impl Debug for TcActionGeneric
source§impl Default for TcActionGeneric
impl Default for TcActionGeneric
source§fn default() -> TcActionGeneric
fn default() -> TcActionGeneric
source§impl Emitable for TcActionGeneric
impl Emitable for TcActionGeneric
source§impl<T: AsRef<[u8]>> Parseable<TcActionGenericBuffer<T>> for TcActionGeneric
impl<T: AsRef<[u8]>> Parseable<TcActionGenericBuffer<T>> for TcActionGeneric
source§fn parse(buf: &TcActionGenericBuffer<T>) -> Result<Self, DecodeError>
fn parse(buf: &TcActionGenericBuffer<T>) -> Result<Self, DecodeError>
source§impl PartialEq for TcActionGeneric
impl PartialEq for TcActionGeneric
impl Copy for TcActionGeneric
impl Eq for TcActionGeneric
impl StructuralPartialEq for TcActionGeneric
Auto Trait Implementations§
impl Freeze for TcActionGeneric
impl RefUnwindSafe for TcActionGeneric
impl Send for TcActionGeneric
impl Sync for TcActionGeneric
impl Unpin for TcActionGeneric
impl UnwindSafe for TcActionGeneric
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)