~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/tc_act/tc_gact.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __NET_TC_GACT_H
  3 #define __NET_TC_GACT_H
  4 
  5 #include <net/act_api.h>
  6 #include <linux/tc_act/tc_gact.h>
  7 
  8 struct tcf_gact {
  9         struct tc_action        common;
 10 #ifdef CONFIG_GACT_PROB
 11         u16                     tcfg_ptype;
 12         u16                     tcfg_pval;
 13         int                     tcfg_paction;
 14         atomic_t                packets;
 15 #endif
 16 };
 17 #define to_gact(a) ((struct tcf_gact *)a)
 18 
 19 static inline bool __is_tcf_gact_act(const struct tc_action *a, int act,
 20                                      bool is_ext)
 21 {
 22 #ifdef CONFIG_NET_CLS_ACT
 23         struct tcf_gact *gact;
 24 
 25         if (a->ops && a->ops->id != TCA_ID_GACT)
 26                 return false;
 27 
 28         gact = to_gact(a);
 29         if ((!is_ext && gact->tcf_action == act) ||
 30             (is_ext && TC_ACT_EXT_CMP(gact->tcf_action, act)))
 31                 return true;
 32 
 33 #endif
 34         return false;
 35 }
 36 
 37 static inline bool is_tcf_gact_ok(const struct tc_action *a)
 38 {
 39         return __is_tcf_gact_act(a, TC_ACT_OK, false);
 40 }
 41 
 42 static inline bool is_tcf_gact_shot(const struct tc_action *a)
 43 {
 44         return __is_tcf_gact_act(a, TC_ACT_SHOT, false);
 45 }
 46 
 47 static inline bool is_tcf_gact_trap(const struct tc_action *a)
 48 {
 49         return __is_tcf_gact_act(a, TC_ACT_TRAP, false);
 50 }
 51 
 52 static inline bool is_tcf_gact_goto_chain(const struct tc_action *a)
 53 {
 54         return __is_tcf_gact_act(a, TC_ACT_GOTO_CHAIN, true);
 55 }
 56 
 57 static inline u32 tcf_gact_goto_chain_index(const struct tc_action *a)
 58 {
 59         return READ_ONCE(a->tcfa_action) & TC_ACT_EXT_VAL_MASK;
 60 }
 61 
 62 static inline bool is_tcf_gact_continue(const struct tc_action *a)
 63 {
 64         return __is_tcf_gact_act(a, TC_ACT_UNSPEC, false);
 65 }
 66 
 67 static inline bool is_tcf_gact_reclassify(const struct tc_action *a)
 68 {
 69         return __is_tcf_gact_act(a, TC_ACT_RECLASSIFY, false);
 70 }
 71 
 72 static inline bool is_tcf_gact_pipe(const struct tc_action *a)
 73 {
 74         return __is_tcf_gact_act(a, TC_ACT_PIPE, false);
 75 }
 76 
 77 #endif /* __NET_TC_GACT_H */
 78 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php