]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - include/net/tc_act/tc_skbedit.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2008, Intel Corporation.
5 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
8 #ifndef __NET_TC_SKBEDIT_H
9 #define __NET_TC_SKBEDIT_H
11 #include <net/act_api.h>
12 #include <linux/tc_act/tc_skbedit.h>
14 struct tcf_skbedit_params
{
25 struct tc_action common
;
26 struct tcf_skbedit_params __rcu
*params
;
28 #define to_skbedit(a) ((struct tcf_skbedit *)a)
30 /* Return true iff action is the one identified by FLAG. */
31 static inline bool is_tcf_skbedit_with_flag(const struct tc_action
*a
, u32 flag
)
33 #ifdef CONFIG_NET_CLS_ACT
36 if (a
->ops
&& a
->ops
->id
== TCA_ID_SKBEDIT
) {
38 flags
= rcu_dereference(to_skbedit(a
)->params
)->flags
;
46 /* Return true iff action is mark */
47 static inline bool is_tcf_skbedit_mark(const struct tc_action
*a
)
49 return is_tcf_skbedit_with_flag(a
, SKBEDIT_F_MARK
);
52 static inline u32
tcf_skbedit_mark(const struct tc_action
*a
)
57 mark
= rcu_dereference(to_skbedit(a
)->params
)->mark
;
63 /* Return true iff action is ptype */
64 static inline bool is_tcf_skbedit_ptype(const struct tc_action
*a
)
66 return is_tcf_skbedit_with_flag(a
, SKBEDIT_F_PTYPE
);
69 static inline u32
tcf_skbedit_ptype(const struct tc_action
*a
)
74 ptype
= rcu_dereference(to_skbedit(a
)->params
)->ptype
;
80 /* Return true iff action is priority */
81 static inline bool is_tcf_skbedit_priority(const struct tc_action
*a
)
83 return is_tcf_skbedit_with_flag(a
, SKBEDIT_F_PRIORITY
);
86 static inline u32
tcf_skbedit_priority(const struct tc_action
*a
)
91 priority
= rcu_dereference(to_skbedit(a
)->params
)->priority
;
97 #endif /* __NET_TC_SKBEDIT_H */