github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/socket_netlink_route_sched.txt (about)

     1  # Copyright 2018 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  # AF_NETLINK/NETLINK_ROUTE SCHED support.
     5  
     6  include <linux/net.h>
     7  include <linux/mpls.h>
     8  include <uapi/linux/if.h>
     9  include <uapi/linux/netlink.h>
    10  include <uapi/linux/rtnetlink.h>
    11  include <uapi/linux/netfilter.h>
    12  include <uapi/linux/netfilter/x_tables.h>
    13  include <uapi/linux/if_packet.h>
    14  include <uapi/linux/can.h>
    15  include <uapi/linux/pkt_cls.h>
    16  include <uapi/linux/pkt_sched.h>
    17  include <uapi/linux/tc_act/tc_bpf.h>
    18  include <uapi/linux/tc_act/tc_ct.h>
    19  include <uapi/linux/tc_act/tc_connmark.h>
    20  include <uapi/linux/tc_act/tc_csum.h>
    21  include <uapi/linux/tc_act/tc_ctinfo.h>
    22  include <uapi/linux/tc_act/tc_defact.h>
    23  include <uapi/linux/tc_act/tc_gact.h>
    24  include <uapi/linux/tc_act/tc_ife.h>
    25  include <uapi/linux/tc_act/tc_mirred.h>
    26  include <uapi/linux/tc_act/tc_mpls.h>
    27  include <uapi/linux/tc_act/tc_nat.h>
    28  include <uapi/linux/tc_act/tc_pedit.h>
    29  include <uapi/linux/tc_act/tc_sample.h>
    30  include <uapi/linux/tc_act/tc_skbedit.h>
    31  include <uapi/linux/tc_act/tc_skbmod.h>
    32  include <uapi/linux/tc_act/tc_tunnel_key.h>
    33  include <uapi/linux/tc_act/tc_vlan.h>
    34  include <uapi/linux/tc_ematch/tc_em_cmp.h>
    35  include <uapi/linux/tc_ematch/tc_em_ipt.h>
    36  include <uapi/linux/tc_ematch/tc_em_meta.h>
    37  
    38  sendmsg$nl_route_sched(fd sock_nl_route, msg ptr[in, msghdr_netlink[netlink_msg_route_sched]], f flags[send_flags])
    39  
    40  netlink_msg_route_sched [
    41  	newqdisc	netlink_msg[RTM_NEWQDISC, tcmsg[AF_UNSPEC], rtm_tca_policy]
    42  	delqdisc	netlink_msg[RTM_DELQDISC, tcmsg[AF_UNSPEC], rtm_tca_policy]
    43  	getqdisc	netlink_msg[RTM_GETQDISC, tcmsg[AF_UNSPEC], nlattr[TCA_DUMP_INVISIBLE, void]]
    44  	newtclass	netlink_msg[RTM_NEWTCLASS, tcmsg[AF_UNSPEC], rtm_tca_policy$tclass]
    45  	deltclass	netlink_msg[RTM_DELTCLASS, tcmsg[AF_UNSPEC], rtm_tca_policy$tclass]
    46  	gettclass	netlink_msg[RTM_GETTCLASS, tcmsg[AF_UNSPEC], void]
    47  	newtfilter	netlink_msg[RTM_NEWTFILTER, tcmsg[AF_UNSPEC], filter_policy]
    48  	deltfilter	netlink_msg[RTM_DELTFILTER, tcmsg[AF_UNSPEC], filter_policy]
    49  	gettfilter	netlink_msg[RTM_GETTFILTER, tcmsg[AF_UNSPEC], nlattr[TCA_CHAIN, int32]]
    50  	newchain	netlink_msg[RTM_NEWCHAIN, tcmsg[AF_UNSPEC], filter_policy]
    51  	delchain	netlink_msg[RTM_DELCHAIN, tcmsg[AF_UNSPEC], filter_policy]
    52  	getchain	netlink_msg[RTM_GETCHAIN, tcmsg[AF_UNSPEC], nlattr[TCA_CHAIN, int32]]
    53  	newtaction	netlink_msg[RTM_NEWACTION, tcamsg[AF_UNSPEC], nlattr[TCA_ACT_TAB, array[tca_actions]]]
    54  	deltaction	netlink_msg[RTM_DELACTION, tcamsg[AF_UNSPEC], action_gd_policy]
    55  	gettaction	netlink_msg[RTM_GETACTION, tcamsg[AF_UNSPEC], action_dump_policy]
    56  ] [varlen]
    57  
    58  type tcmsg[FAMILY] {
    59  	family		const[FAMILY, int8]
    60  	tcm__pad1	const[0, int8]
    61  	tcm__pad2	const[0, int16]
    62  	ifindex		ifindex
    63  	tcm_handle	tcm_handle
    64  	tcm_parent	tcm_handle
    65  	tcm_info	tcm_handle
    66  }
    67  
    68  tcm_handle {
    69  	minor	flags[tcm_handle_offsets, int16]
    70  	major	flags[tcm_handle_offsets, int16]
    71  }
    72  
    73  type tcamsg[FAMILY] {
    74  	family		const[FAMILY, int8]
    75  	tca__pad1	const[0, int8]
    76  	tca__pad2	const[0, int16]
    77  }
    78  
    79  rtm_tca_policy [
    80  	qdisc_kind_options	qdisc_kind_options
    81  	TCA_RATE		nlattr[TCA_RATE, tc_estimator]
    82  	TCA_STAB		nlnest[TCA_STAB, array[stab_policy]]
    83  	TCA_INGRESS_BLOCK	nlattr[TCA_INGRESS_BLOCK, int32]
    84  	TCA_EGRESS_BLOCK	nlattr[TCA_EGRESS_BLOCK, int32]
    85  ] [varlen]
    86  
    87  rtm_tca_policy$tclass [
    88  	tclass_kind_options	tclass_kind_options
    89  	TCA_RATE		nlattr[TCA_RATE, tc_estimator]
    90  ] [varlen]
    91  
    92  filter_policy [
    93  	filter_kind_options	filter_kind_options
    94  	TCA_RATE		nlattr[TCA_RATE, tc_estimator]
    95  	TCA_CHAIN		nlattr[TCA_CHAIN, int32]
    96  ] [varlen]
    97  
    98  type tca_kind_options_t[NAME, VALUES] {
    99  	TCA_KIND	nlattr[TCA_KIND, string[NAME]]
   100  	TCA_OPTIONS	nlattr[TCA_OPTIONS, VALUES]
   101  }
   102  # ------------------------------ tc qdisc ------------------------------
   103  qdisc_kind_options [
   104  	q_cake			tca_kind_options_t["cake", array[cake_policy]]
   105  	q_cbq			tca_kind_options_t["cbq", array[cbs_policy]]
   106  	q_cbs			tca_kind_options_t["cbs", cbs_policy]
   107  	q_choke			tca_kind_options_t["choke", array[choke_policy]]
   108  	q_codel			tca_kind_options_t["codel", array[codel_policy]]
   109  	q_etf			tca_kind_options_t["etf", etf_policy]
   110  	q_bfifo			tca_kind_options_t["bfifo", int32]
   111  	q_pfifo			tca_kind_options_t["pfifo", int32]
   112  	q_pfifo_head_drop	tca_kind_options_t["pfifo_head_drop", int32]
   113  	q_fq			tca_kind_options_t["fq", array[fq_policy]]
   114  	q_fq_codel		tca_kind_options_t["fq_codel", array[fq_codel_policy]]
   115  	q_fq_pie		tca_kind_options_t["fq_pie", array[fq_pie_policy]]
   116  	q_gred			tca_kind_options_t["gred", array[gred_policy]]
   117  	q_hfsc			tca_kind_options_t["hfsc", hfsc_policy]
   118  	q_hhf			tca_kind_options_t["hhf", array[hhf_policy]]
   119  	q_htb			tca_kind_options_t["htb", array[htb_policy]]
   120  	q_mqprio		tca_kind_options_t["mqprio", tc_mqprio_message]
   121  	q_multiq		tca_kind_options_t["multiq", tc_multiq_qopt]
   122  	q_netem			tca_kind_options_t["netem", tc_netem_message]
   123  	q_pie			tca_kind_options_t["pie", array[pie_policy]]
   124  	q_prio			tca_kind_options_t["prio", tc_prio_qopt]
   125  	q_plug			tca_kind_options_t["plug", tc_plug_qopt]
   126  	q_red			tca_kind_options_t["red", array[red_policy]]
   127  	q_rr			tca_kind_options_t["rr", tc_prio_qopt]
   128  	q_sfb			tca_kind_options_t["sfb", sfb_policy]
   129  	q_sfq			tca_kind_options_t["sfq", tc_sfq_qopt_v1]
   130  	q_skbprio		tca_kind_options_t["skbprio", int32]
   131  	q_taprio		tca_kind_options_t["taprio", array[taprio_policy]]
   132  	q_tbf			tca_kind_options_t["tbf", array[tbf_policy]]
   133  	q_atm			nlattr[TCA_KIND, string["atm"]]
   134  	q_drr			nlattr[TCA_KIND, string["drr"]]
   135  	q_blackhole		nlattr[TCA_KIND, string["blackhole"]]
   136  	q_clsact		nlattr[TCA_KIND, string["clsact"]]
   137  	q_pfifo_fast		nlattr[TCA_KIND, string["pfifo_fast"]]
   138  	q_qfg			nlattr[TCA_KIND, string["qfq"]]
   139  	q_ingress		nlattr[TCA_KIND, string["ingress"]]
   140  	q_mq			nlattr[TCA_KIND, string["mq"]]
   141  ] [varlen]
   142  
   143  cake_policy [
   144  	TCA_CAKE_BASE_RATE64	nlattr[TCA_CAKE_BASE_RATE64, int64]
   145  	TCA_CAKE_DIFFSERV_MODE	nlattr[TCA_CAKE_DIFFSERV_MODE, flags[tc_cake_diffserv_mode, int32]]
   146  	TCA_CAKE_ATM		nlattr[TCA_CAKE_ATM, flags[tc_cake_atm, int32]]
   147  	TCA_CAKE_FLOW_MODE	nlattr[TCA_CAKE_FLOW_MODE, flags[tc_cake_flow_mode, int32]]
   148  	TCA_CAKE_OVERHEAD	nlattr[TCA_CAKE_OVERHEAD, int32[-64:256]]
   149  	TCA_CAKE_RTT		nlattr[TCA_CAKE_RTT, int32]
   150  	TCA_CAKE_TARGET		nlattr[TCA_CAKE_TARGET, int32]
   151  	TCA_CAKE_AUTORATE	nlattr[TCA_CAKE_AUTORATE, int32]
   152  	TCA_CAKE_MEMORY		nlattr[TCA_CAKE_MEMORY, int32]
   153  	TCA_CAKE_NAT		nlattr[TCA_CAKE_NAT, int32[0:1]]
   154  	TCA_CAKE_RAW		nlattr[TCA_CAKE_RAW, int32[0:1]]
   155  	TCA_CAKE_WASH		nlattr[TCA_CAKE_WASH, int32[0:1]]
   156  	TCA_CAKE_MPU		nlattr[TCA_CAKE_MPU, int32[0:256]]
   157  	TCA_CAKE_INGRESS	nlattr[TCA_CAKE_INGRESS, int32[0:1]]
   158  	TCA_CAKE_ACK_FILTER	nlattr[TCA_CAKE_ACK_FILTER, flags[tc_cake_ack_filter, int32]]
   159  	TCA_CAKE_SPLIT_GSO	nlattr[TCA_CAKE_SPLIT_GSO, int32[0:1]]
   160  	TCA_CAKE_FWMARK		nlattr[TCA_CAKE_FWMARK, int32]
   161  ] [varlen]
   162  
   163  cbs_policy [
   164  	TCA_CBS_PARMS	nlattr[TCA_CBS_PARMS, tc_cbs_qopt]
   165  ] [varlen]
   166  
   167  choke_policy [
   168  	TCA_CHOKE_PARMS	nlattr[TCA_CHOKE_PARMS, tc_red_qopt]
   169  	TCA_CHOKE_STAB	nlattr[TCA_CHOKE_STAB, array[int8, 256]]
   170  	TCA_CHOKE_MAX_P	nlattr[TCA_CHOKE_MAX_P, int32]
   171  ] [varlen]
   172  
   173  codel_policy [
   174  	TCA_CODEL_TARGET	nlattr[TCA_CODEL_TARGET, int32]
   175  	TCA_CODEL_LIMIT		nlattr[TCA_CODEL_LIMIT, int32]
   176  	TCA_CODEL_INTERVAL	nlattr[TCA_CODEL_INTERVAL, int32]
   177  	TCA_CODEL_ECN		nlattr[TCA_CODEL_ECN, int32[0:1]]
   178  	TCA_CODEL_CE_THRESHOLD	nlattr[TCA_CODEL_CE_THRESHOLD, int32]
   179  ] [varlen]
   180  
   181  etf_policy [
   182  	TCA_ETF_PARMS	nlattr[TCA_ETF_PARMS, tc_etf_qopt]
   183  ] [varlen]
   184  
   185  tc_etf_qopt {
   186  	delta	int32
   187  	clockid	flags[tc_etf_clock_id, int32]
   188  	flags	flags[tc_etf_flags, int32]
   189  }
   190  
   191  fq_policy [
   192  	TCA_FQ_PLIMIT			nlattr[TCA_FQ_PLIMIT, int32]
   193  	TCA_FQ_FLOW_PLIMIT		nlattr[TCA_FQ_FLOW_PLIMIT, int32]
   194  	TCA_FQ_QUANTUM			nlattr[TCA_FQ_QUANTUM, int32]
   195  	TCA_FQ_INITIAL_QUANTUM		nlattr[TCA_FQ_INITIAL_QUANTUM, int32]
   196  	TCA_FQ_RATE_ENABLE		nlattr[TCA_FQ_RATE_ENABLE, int32[0:1]]
   197  	TCA_FQ_FLOW_DEFAULT_RATE	nlattr[TCA_FQ_FLOW_DEFAULT_RATE, int32]
   198  	TCA_FQ_FLOW_MAX_RATE		nlattr[TCA_FQ_FLOW_MAX_RATE, int32]
   199  	TCA_FQ_BUCKETS_LOG		nlattr[TCA_FQ_BUCKETS_LOG, int32[0:32]]
   200  	TCA_FQ_FLOW_REFILL_DELAY	nlattr[TCA_FQ_FLOW_REFILL_DELAY, int32]
   201  	TCA_FQ_ORPHAN_MASK		nlattr[TCA_FQ_ORPHAN_MASK, int32]
   202  	TCA_FQ_LOW_RATE_THRESHOLD	nlattr[TCA_FQ_LOW_RATE_THRESHOLD, int32]
   203  	TCA_FQ_CE_THRESHOLD		nlattr[TCA_FQ_CE_THRESHOLD, int32]
   204  	TCA_FQ_TIMER_SLACK		nlattr[TCA_FQ_TIMER_SLACK, int32]
   205  ] [varlen]
   206  
   207  fq_codel_policy [
   208  	TCA_FQ_CODEL_TARGET			nlattr[TCA_FQ_CODEL_TARGET, int32]
   209  	TCA_FQ_CODEL_LIMIT			nlattr[TCA_FQ_CODEL_LIMIT, int32]
   210  	TCA_FQ_CODEL_INTERVAL			nlattr[TCA_FQ_CODEL_INTERVAL, int32]
   211  	TCA_FQ_CODEL_ECN			nlattr[TCA_FQ_CODEL_ECN, int32[0:1]]
   212  	TCA_FQ_CODEL_FLOWS			nlattr[TCA_FQ_CODEL_FLOWS, int32]
   213  	TCA_FQ_CODEL_QUANTUM			nlattr[TCA_FQ_CODEL_QUANTUM, int32]
   214  	TCA_FQ_CODEL_CE_THRESHOLD		nlattr[TCA_FQ_CODEL_CE_THRESHOLD, int32]
   215  	TCA_FQ_CODEL_DROP_BATCH_SIZE		nlattr[TCA_FQ_CODEL_DROP_BATCH_SIZE, int32]
   216  	TCA_FQ_CODEL_MEMORY_LIMIT		nlattr[TCA_FQ_CODEL_MEMORY_LIMIT, int32]
   217  	TCA_FQ_CODEL_CE_THRESHOLD_SELECTOR	nlattr[TCA_FQ_CODEL_CE_THRESHOLD_SELECTOR, int8]
   218  	TCA_FQ_CODEL_CE_THRESHOLD_MASK		nlattr[TCA_FQ_CODEL_CE_THRESHOLD_MASK, int8]
   219  ] [varlen]
   220  
   221  fq_pie_policy [
   222  	TCA_FQ_PIE_LIMIT		nlattr[TCA_FQ_PIE_LIMIT, int32]
   223  	TCA_FQ_PIE_FLOWS		nlattr[TCA_FQ_PIE_FLOWS, int32[1:65535]]
   224  	TCA_FQ_PIE_TARGET		nlattr[TCA_FQ_PIE_TARGET, int32]
   225  	TCA_FQ_PIE_TUPDATE		nlattr[TCA_FQ_PIE_TUPDATE, int32]
   226  	TCA_FQ_PIE_ALPHA		nlattr[TCA_FQ_PIE_ALPHA, int32[0:32]]
   227  	TCA_FQ_PIE_BETA			nlattr[TCA_FQ_PIE_BETA, int32[0:32]]
   228  	TCA_FQ_PIE_QUANTUM		nlattr[TCA_FQ_PIE_QUANTUM, int32]
   229  	TCA_FQ_PIE_MEMORY_LIMIT		nlattr[TCA_FQ_PIE_MEMORY_LIMIT, int32]
   230  	TCA_FQ_PIE_ECN_PROB		nlattr[TCA_FQ_PIE_ECN_PROB, int32[0:100]]
   231  	TCA_FQ_PIE_ECN			nlattr[TCA_FQ_PIE_ECN, bool32]
   232  	TCA_FQ_PIE_BYTEMODE		nlattr[TCA_FQ_PIE_BYTEMODE, bool32]
   233  	TCA_FQ_PIE_DQ_RATE_ESTIMATOR	nlattr[TCA_FQ_PIE_DQ_RATE_ESTIMATOR, bool32]
   234  ] [varlen]
   235  
   236  # TODO: we should not have TCA_GRED_PARMS and TCA_GRED_STAB when do init
   237  gred_policy [
   238  	TCA_GRED_PARMS	nlattr[TCA_GRED_PARMS, tc_gred_qopt]
   239  	TCA_GRED_STAB	nlattr[TCA_GRED_STAB, array[int8, 256]]
   240  	TCA_GRED_DPS	nlattr[TCA_GRED_DPS, tc_gred_sopt]
   241  	TCA_GRED_MAX_P	nlattr[TCA_GRED_MAX_P, int32]
   242  	TCA_GRED_LIMIT	nlattr[TCA_GRED_LIMIT, int32]
   243  ] [varlen]
   244  
   245  hfsc_policy [
   246  	TCA_HFSC_RSC	nlattr[TCA_HFSC_RSC, tc_service_curve]
   247  	TCA_HFSC_FSC	nlattr[TCA_HFSC_FSC, tc_service_curve]
   248  	TCA_HFSC_USC	nlattr[TCA_HFSC_USC, tc_service_curve]
   249  ] [varlen]
   250  
   251  tc_service_curve {
   252  	m1	int32
   253  	d	int32
   254  	m2	int32
   255  }
   256  
   257  hhf_policy [
   258  	TCA_HHF_BACKLOG_LIMIT	nlattr[TCA_HHF_BACKLOG_LIMIT, int32]
   259  	TCA_HHF_QUANTUM		nlattr[TCA_HHF_QUANTUM, int32]
   260  	TCA_HHF_HH_FLOWS_LIMIT	nlattr[TCA_HHF_HH_FLOWS_LIMIT, int32]
   261  	TCA_HHF_RESET_TIMEOUT	nlattr[TCA_HHF_RESET_TIMEOUT, int32]
   262  	TCA_HHF_ADMIT_BYTES	nlattr[TCA_HHF_ADMIT_BYTES, int32]
   263  	TCA_HHF_EVICT_TIMEOUT	nlattr[TCA_HHF_EVICT_TIMEOUT, int32]
   264  	TCA_HHF_NON_HH_WEIGHT	nlattr[TCA_HHF_NON_HH_WEIGHT, int32]
   265  ] [varlen]
   266  
   267  htb_policy [
   268  	TCA_HTB_INIT		nlattr[TCA_HTB_INIT, tc_htb_glob]
   269  	TCA_HTB_DIRECT_QLEN	nlattr[TCA_HTB_DIRECT_QLEN, int32]
   270  ] [varlen]
   271  
   272  tc_mqprio_message {
   273  	qopt	tc_mqprio_qopt
   274  	attrs	array[mqprio_policy]
   275  }
   276  
   277  mqprio_policy [
   278  	TCA_MQPRIO_MODE		nlattr[TCA_MQPRIO_MODE, flags[tc_mqprio_modes, int16]]
   279  	TCA_MQPRIO_SHAPER	nlattr[TCA_MQPRIO_SHAPER, flags[tc_mqprio_shapers, int16]]
   280  	TCA_MQPRIO_MIN_RATE64	nlnest[TCA_MQPRIO_MIN_RATE64, array[nlattr[TCA_MQPRIO_MIN_RATE64, int64], 0:16]]
   281  	TCA_MQPRIO_MAX_RATE64	nlnest[TCA_MQPRIO_MAX_RATE64, array[nlattr[TCA_MQPRIO_MAX_RATE64, int64], 0:16]]
   282  ] [varlen]
   283  
   284  tc_netem_message {
   285  	qopt	tc_netem_qopt
   286  	attrs	array[netem_policy]
   287  }
   288  
   289  netem_policy [
   290  	TCA_NETEM_CORR		nlattr[TCA_NETEM_CORR, tc_netem_corr]
   291  	TCA_NETEM_DELAY_DIST	nlattr[TCA_NETEM_DELAY_DIST, array[int8, 0:100]]
   292  	TCA_NETEM_REORDER	nlattr[TCA_NETEM_REORDER, tc_netem_reorder]
   293  	TCA_NETEM_CORRUPT	nlattr[TCA_NETEM_CORRUPT, tc_netem_corrupt]
   294  	TCA_NETEM_LOSS		nlnest[TCA_NETEM_LOSS, array[netem_loss_policy]]
   295  	TCA_NETEM_RATE		nlattr[TCA_NETEM_RATE, tc_netem_rate]
   296  	TCA_NETEM_ECN		nlattr[TCA_NETEM_ECN, int32[0:1]]
   297  	TCA_NETEM_RATE64	nlattr[TCA_NETEM_RATE64, int64[0x100000000:0xffffffffffffffff]]
   298  	TCA_NETEM_LATENCY64	nlattr[TCA_NETEM_LATENCY64, int64]
   299  	TCA_NETEM_JITTER64	nlattr[TCA_NETEM_JITTER64, int64]
   300  	TCA_NETEM_SLOT		nlattr[TCA_NETEM_SLOT, tc_netem_slot]
   301  ] [varlen]
   302  
   303  netem_loss_policy [
   304  	NETEM_LOSS_GI	nlattr[NETEM_LOSS_GI, tc_netem_gimodel]
   305  	NETEM_LOSS_GE	nlattr[NETEM_LOSS_GE, tc_netem_gemodel]
   306  ] [varlen]
   307  
   308  pie_policy [
   309  	TCA_PIE_TARGET		nlattr[TCA_PIE_TARGET, int32]
   310  	TCA_PIE_LIMIT		nlattr[TCA_PIE_LIMIT, int32]
   311  	TCA_PIE_TUPDATE		nlattr[TCA_PIE_TUPDATE, int32]
   312  	TCA_PIE_ALPHA		nlattr[TCA_PIE_ALPHA, int32[0:32]]
   313  	TCA_PIE_BETA		nlattr[TCA_PIE_BETA, int32[0:32]]
   314  	TCA_PIE_ECN		nlattr[TCA_PIE_ECN, int32[0:1]]
   315  	TCA_PIE_BYTEMODE	nlattr[TCA_PIE_BYTEMODE, int32[0:1]]
   316  ] [varlen]
   317  
   318  red_policy [
   319  	TCA_RED_PARMS			nlattr[TCA_RED_PARMS, tc_red_qopt]
   320  	TCA_RED_STAB			nlattr[TCA_RED_STAB, array[int8, 256]]
   321  	TCA_RED_MAX_P			nlattr[TCA_RED_MAX_P, int32]
   322  	TCA_RED_FLAGS			nlattr[TCA_RED_FLAGS, nla_bitfield32[red_supported_flags]]
   323  	TCA_RED_EARLY_DROP_BLOCK	nlattr[TCA_RED_EARLY_DROP_BLOCK, int32]
   324  	TCA_RED_MARK_BLOCK		nlattr[TCA_RED_MARK_BLOCK, int32]
   325  ] [varlen]
   326  
   327  red_supported_flags = TC_RED_HISTORIC_FLAGS, TC_RED_NODROP
   328  
   329  sfb_policy [
   330  	TCA_SFB_PARMS	nlattr[TCA_SFB_PARMS, tc_sfb_qopt]
   331  ] [varlen]
   332  
   333  entry_policy$taprio [
   334  	TCA_TAPRIO_SCHED_ENTRY_CMD		nlattr[TCA_TAPRIO_SCHED_ENTRY_CMD, int8]
   335  	TCA_TAPRIO_SCHED_ENTRY_GATE_MASK	nlattr[TCA_TAPRIO_SCHED_ENTRY_GATE_MASK, int32]
   336  	TCA_TAPRIO_SCHED_ENTRY_INTERVAL		nlattr[TCA_TAPRIO_SCHED_ENTRY_INTERVAL, int32]
   337  ] [varlen]
   338  
   339  taprio_policy [
   340  	TCA_TAPRIO_ATTR_PRIOMAP				nlattr[TCA_TAPRIO_ATTR_PRIOMAP, tc_mqprio_qopt]
   341  	TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST		nlnest[TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST, array[nlnest[TCA_TAPRIO_SCHED_ENTRY, array[entry_policy$taprio]]]]
   342  	TCA_TAPRIO_ATTR_SCHED_BASE_TIME			nlattr[TCA_TAPRIO_ATTR_SCHED_BASE_TIME, int64]
   343  	TCA_TAPRIO_ATTR_SCHED_CLOCKID			nlattr[TCA_TAPRIO_ATTR_SCHED_CLOCKID, int32]
   344  	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME		nlattr[TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, int64]
   345  	TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION	nlattr[TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, int64]
   346  	TCA_TAPRIO_ATTR_FLAGS				nlattr[TCA_TAPRIO_ATTR_FLAGS, int32]
   347  	TCA_TAPRIO_ATTR_TXTIME_DELAY			nlattr[TCA_TAPRIO_ATTR_TXTIME_DELAY, int32]
   348  ] [varlen]
   349  
   350  tbf_policy [
   351  	TCA_TBF_PARMS	nlattr[TCA_TBF_PARMS, tc_tbf_qopt]
   352  	TCA_TBF_RTAB	nlattr[TCA_TBF_RTAB, array[int32, 256]]
   353  	TCA_TBF_PTAB	nlattr[TCA_TBF_PTAB, array[int32, 256]]
   354  	TCA_TBF_RATE64	nlattr[TCA_TBF_RATE64, int64[0x100000000:0xffffffffffffffff]]
   355  	TCA_TBF_PRATE64	nlattr[TCA_TBF_PRATE64, int64[0x100000000:0xffffffffffffffff]]
   356  	TCA_TBF_BURST	nlattr[TCA_TBF_BURST, int32]
   357  	TCA_TBF_PBURST	nlattr[TCA_TBF_PBURST, int32[0:9000]]
   358  ] [varlen]
   359  
   360  tc_cbs_qopt {
   361  	offload		int8
   362  	_pad		array[const[0, int8], 3]
   363  	hicredit	int32
   364  	locredit	int32
   365  	idleslope	int32
   366  	sendslope	int32
   367  }
   368  
   369  # NEED: limit >= qth_max >= qth_min
   370  tc_red_qopt {
   371  	limit		int32
   372  	qth_min		int32
   373  	qth_max		int32
   374  	Wlog		int8[0:32]
   375  	Plog		int8[0:32]
   376  	Scell_log	int8[0:32]
   377  	flag		int8[0:8]
   378  }
   379  
   380  tc_gred_sopt {
   381  	DPs	int32[0:16]
   382  	def_DP	int32[0:16]
   383  	grio	int8[0:1]
   384  	flags	int8[0:8]
   385  	pad1	const[0, int16]
   386  }
   387  
   388  tc_gred_qopt {
   389  	limit		int32
   390  	qth_min		int32
   391  	qth_max		int32
   392  	DP		int32[0:16]
   393  	backlog		int32
   394  	qave		int32
   395  	forced		int32
   396  	early		int32
   397  	other		int32
   398  	pdrop		int32
   399  	Wlog		int8[0:32]
   400  	Plog		int8[0:32]
   401  	Scell_log	int8[0:32]
   402  	prio		int8
   403  	packets		int32
   404  	bytesin		int32
   405  }
   406  
   407  tc_htb_glob {
   408  	version		const[3, int32]
   409  	rate2quantum	int32
   410  	defcls		int32
   411  	debug		const[0, int32]
   412  	direct_pkts	const[0, int32]
   413  }
   414  
   415  tc_mqprio_qopt {
   416  	num_tc		int8[0:TC_MAX_QUEUE]
   417  	prio_tc_map	array[int8[0:TC_MAX_QUEUE], 16]
   418  	hw		int8[0:TC_MQPRIO_HW_OFFLOAD_MAX]
   419  	count		array[int16, TC_QOPT_MAX_QUEUE]
   420  	offset		array[int16, TC_QOPT_MAX_QUEUE]
   421  }
   422  
   423  define TC_MAX_QUEUE	16
   424  
   425  tc_multiq_qopt {
   426  	bands		int16
   427  	max_bands	int16
   428  }
   429  
   430  tc_netem_qopt {
   431  	latency		int32
   432  	limit		int32
   433  	loss		int32
   434  	gap		int32
   435  	duplicate	int32
   436  	jitter		int32
   437  }
   438  
   439  tc_netem_corr {
   440  	delay_corr	int32
   441  	loss_corr	int32
   442  	dup_corr	int32
   443  }
   444  
   445  tc_netem_reorder {
   446  	probability	int32
   447  	correlation	int32
   448  }
   449  
   450  tc_netem_corrupt {
   451  	probability	int32
   452  	correlation	int32
   453  }
   454  
   455  tc_netem_rate {
   456  	rate		int32
   457  	packet_overhead	int32
   458  	cell_size	int32
   459  	cell_overhead	int32
   460  }
   461  
   462  tc_netem_slot {
   463  	min_delay	int64
   464  	max_delay	int64
   465  	max_packets	int32
   466  	max_bytes	int32
   467  	dist_delay	int64
   468  	dist_jitter	int64
   469  }
   470  
   471  tc_netem_gimodel {
   472  	p13	int32
   473  	p31	int32
   474  	p32	int32
   475  	p14	int32
   476  	p23	int32
   477  }
   478  
   479  tc_netem_gemodel {
   480  	p	int32
   481  	r	int32
   482  	h	int32
   483  	k1	int32
   484  }
   485  
   486  tc_prio_qopt {
   487  	bands	int32
   488  	priomap	array[int8, TC_PRIO_MAX1]
   489  }
   490  
   491  define TC_PRIO_MAX1	TC_PRIO_MAX + 1
   492  
   493  tc_plug_qopt {
   494  	action	flags[tc_plug_actions, int32]
   495  	limit	int32
   496  }
   497  
   498  tc_sfb_qopt {
   499  	rehash_interval	int32
   500  	warmup_time	int32
   501  	max		int32
   502  	bin_size	int32
   503  	increment	int32
   504  	decrement	int32
   505  	limit		int32
   506  	penalty_rate	int32
   507  	penalty_burst	int32
   508  }
   509  
   510  tc_sfq_qopt_v1 {
   511  	v0		tc_sfq_qopt
   512  	depth		int32
   513  	headdrop	int32[0:1]
   514  	limit		int32
   515  	qth_min		int32
   516  	qth_max		int32
   517  	Wlog		int8[0:32]
   518  	Plog		int8[0:32]
   519  	Scell_log	int8[0:32]
   520  	flag		int8[0:8]
   521  	max_P		int32
   522  	stats		tc_sfqred_stats
   523  }
   524  
   525  tc_sfq_qopt {
   526  	quantum		int32
   527  	perturb_period	int32
   528  	limit		int32
   529  	divisor		int32
   530  	flows		int32
   531  }
   532  
   533  tc_sfqred_stats {
   534  	prob_drop		int32
   535  	forced_drop		int32
   536  	prob_mark		int32
   537  	forced_mark		int32
   538  	prob_mark_head		int32
   539  	forced_mark_head	int32
   540  }
   541  
   542  tc_tbf_qopt {
   543  	rate		tc_ratespec
   544  	peakrate	tc_ratespec
   545  	limit		int32
   546  	buffer		int32
   547  	mtu		int32[0:9000]
   548  }
   549  
   550  # ------------------------------ tc class ------------------------------
   551  tclass_kind_options [
   552  	c_drr		tca_kind_options_t["drr", drr_policy]
   553  	c_hfsc		tca_kind_options_t["hfsc", array[hfsc_policy]]
   554  	c_htb		tca_kind_options_t["htb", array[htb_policy$class]]
   555  	c_qfq		tca_kind_options_t["qfq", array[qfq_policy]]
   556  	c_cake		nlattr[TCA_KIND, string["cake"]]
   557  	c_cbs		nlattr[TCA_KIND, string["cbs"]]
   558  	c_fq_codel	nlattr[TCA_KIND, string["fq_codel"]]
   559  	c_mq		nlattr[TCA_KIND, string["mq"]]
   560  	c_mqprio	nlattr[TCA_KIND, string["mqprio"]]
   561  	c_multiq	nlattr[TCA_KIND, string["multiq"]]
   562  	c_netem		nlattr[TCA_KIND, string["netem"]]
   563  	c_prio		nlattr[TCA_KIND, string["prio"]]
   564  	c_red		nlattr[TCA_KIND, string["red"]]
   565  	c_sfb		nlattr[TCA_KIND, string["sfb"]]
   566  	c_sfq		nlattr[TCA_KIND, string["sfq"]]
   567  	c_skbprio	nlattr[TCA_KIND, string["skbprio"]]
   568  	c_taprio	nlattr[TCA_KIND, string["taprio"]]
   569  	c_tbf		nlattr[TCA_KIND, string["tbf"]]
   570  	c_ingress	nlattr[TCA_KIND, string["ingress"]]
   571  	c_clsact	nlattr[TCA_KIND, string["clsact"]]
   572  ] [varlen]
   573  
   574  drr_policy [
   575  	TCA_DRR_QUANTUM	nlattr[TCA_DRR_QUANTUM, int32]
   576  ] [varlen]
   577  
   578  htb_policy$class [
   579  	TCA_HTB_PARMS	nlattr[TCA_HTB_PARMS, tc_htb_opt]
   580  	TCA_HTB_CTAB	nlattr[TCA_HTB_CTAB, array[int32, 256]]
   581  	TCA_HTB_RTAB	nlattr[TCA_HTB_RTAB, array[int32, 256]]
   582  	TCA_HTB_RATE64	nlattr[TCA_HTB_RATE64, int64]
   583  	TCA_HTB_CEIL64	nlattr[TCA_HTB_CEIL64, int64]
   584  	TCA_HTB_OFFLOAD	nlattr[TCA_HTB_OFFLOAD, void]
   585  ] [varlen]
   586  
   587  qfq_policy [
   588  	TCA_QFQ_WEIGHT	nlattr[TCA_QFQ_WEIGHT, int32]
   589  	TCA_QFQ_LMAX	nlattr[TCA_QFQ_LMAX, int32]
   590  ] [varlen]
   591  
   592  tc_htb_opt {
   593  	rate	tc_ratespec
   594  	ceil	tc_ratespec
   595  	buffer	int32
   596  	cbuffer	int32
   597  	quantum	int32
   598  	level	int32
   599  	prio	int32
   600  }
   601  
   602  # ------------------------------ tc filter ------------------------------
   603  
   604  filter_kind_options [
   605  	f_basic		tca_kind_options_t["basic", array[basic_policy]]
   606  	f_bpf		tca_kind_options_t["bpf", array[bpf_policy]]
   607  	f_cgroup	tca_kind_options_t["cgroup", array[cgroup_policy]]
   608  	f_flow		tca_kind_options_t["flow", array[flow_policy]]
   609  	f_flower	tca_kind_options_t["flower", array[fl_policy]]
   610  	f_fw		tca_kind_options_t["fw", array[fw_policy]]
   611  	f_matchall	tca_kind_options_t["matchall", array[mall_policy]]
   612  	f_route		tca_kind_options_t["route", array[route4_policy]]
   613  	f_u32		tca_kind_options_t["u32", array[u32_policy]]
   614  ] [varlen]
   615  
   616  basic_policy [
   617  	TCA_BASIC_CLASSID	nlattr[TCA_BASIC_CLASSID, tcm_handle]
   618  	TCA_BASIC_EMATCHES	nlnest[TCA_BASIC_EMATCHES, array[em_policy]]
   619  	TCA_BASIC_ACT		nlattr[TCA_BASIC_ACT, array[tca_actions]]
   620  	TCA_BASIC_POLICE	nlattr[TCA_BASIC_POLICE, array[police_policy]]
   621  ] [varlen]
   622  
   623  bpf_policy [
   624  	TCA_BPF_ACT		nlattr[TCA_BPF_ACT, array[tca_actions]]
   625  	TCA_BPF_POLICE		nlattr[TCA_BPF_POLICE, array[police_policy]]
   626  	TCA_BPF_CLASSID		nlattr[TCA_BPF_CLASSID, tcm_handle]
   627  	TCA_BPF_OPS		bpf_policy$ops
   628  	TCA_BPF_FD		nlattr[TCA_BPF_FD, fd_bpf_prog]
   629  	TCA_BPF_NAME		nlattr[TCA_BPF_NAME, string[filename]]
   630  	TCA_BPF_FLAGS		nlattr[TCA_BPF_FLAGS, int32[0:1]]
   631  	TCA_BPF_FLAGS_GEN	nlattr[TCA_BPF_FLAGS_GEN, int32[0:8]]
   632  ] [varlen]
   633  
   634  bpf_policy$ops {
   635  	TCA_BPF_OPS_LEN	nlattr[TCA_BPF_OPS_LEN, len[bpf_policy$ops:TCA_BPF_OPS:payload, int16]]
   636  	TCA_BPF_OPS	nlattr[TCA_BPF_OPS, array[sock_filter]]
   637  } [packed]
   638  
   639  cgroup_policy [
   640  	TCA_CGROUP_ACT		nlattr[TCA_CGROUP_ACT, array[tca_actions]]
   641  	TCA_CGROUP_POLICE	nlattr[TCA_CGROUP_POLICE, array[police_policy]]
   642  	TCA_CGROUP_EMATCHES	nlnest[TCA_CGROUP_EMATCHES, array[em_policy]]
   643  ] [varlen]
   644  
   645  flow_policy [
   646  	TCA_FLOW_KEYS		nlattr[TCA_FLOW_KEYS, int32[0:0x1ffff]]
   647  	TCA_FLOW_MODE		nlattr[TCA_FLOW_MODE, flags[tc_flow_modes, int32]]
   648  	TCA_FLOW_BASECLASS	nlattr[TCA_FLOW_BASECLASS, tcm_handle]
   649  	TCA_FLOW_RSHIFT		nlattr[TCA_FLOW_RSHIFT, int32]
   650  	TCA_FLOW_ADDEND		nlattr[TCA_FLOW_ADDEND, int32]
   651  	TCA_FLOW_MASK		nlattr[TCA_FLOW_MASK, int32]
   652  	TCA_FLOW_XOR		nlattr[TCA_FLOW_XOR, int32]
   653  	TCA_FLOW_DIVISOR	nlattr[TCA_FLOW_DIVISOR, int32]
   654  	TCA_FLOW_ACT		nlnest[TCA_FLOW_ACT, array[tca_actions]]
   655  	TCA_FLOW_POLICE		nlnest[TCA_FLOW_POLICE, array[police_policy]]
   656  	TCA_FLOW_EMATCHES	nlnest[TCA_FLOW_EMATCHES, array[em_policy]]
   657  	TCA_FLOW_PERTURB	nlattr[TCA_FLOW_PERTURB, int32]
   658  ] [varlen]
   659  
   660  fl_policy [
   661  	TCA_FLOWER_CLASSID			nlattr[TCA_FLOWER_CLASSID, tcm_handle]
   662  	TCA_FLOWER_INDEV			nlattr[TCA_FLOWER_INDEV, devname]
   663  	TCA_FLOWER_ACT				nlattr[TCA_FLOWER_ACT, array[tca_actions]]
   664  	TCA_FLOWER_KEY_ETH_DST			nlattr[TCA_FLOWER_KEY_ETH_DST, mac_addr]
   665  	TCA_FLOWER_KEY_ETH_DST_MASK		nlattr[TCA_FLOWER_KEY_ETH_DST_MASK, mac_addr_mask]
   666  	TCA_FLOWER_KEY_ETH_SRC			nlattr[TCA_FLOWER_KEY_ETH_SRC, mac_addr]
   667  	TCA_FLOWER_KEY_ETH_SRC_MASK		nlattr[TCA_FLOWER_KEY_ETH_SRC_MASK, mac_addr_mask]
   668  	TCA_FLOWER_KEY_ETH_TYPE			nlattr[TCA_FLOWER_KEY_ETH_TYPE, flags[ether_types, int16be]]
   669  	TCA_FLOWER_KEY_IP_PROTO			nlattr[TCA_FLOWER_KEY_IP_PROTO, flags[ipv6_types, int8]]
   670  	TCA_FLOWER_KEY_IPV4_SRC			nlattr[TCA_FLOWER_KEY_IPV4_SRC, ipv4_addr]
   671  	TCA_FLOWER_KEY_IPV4_SRC_MASK		nlattr[TCA_FLOWER_KEY_IPV4_SRC_MASK, ipv4_addr_mask]
   672  	TCA_FLOWER_KEY_IPV4_DST			nlattr[TCA_FLOWER_KEY_IPV4_DST, ipv4_addr]
   673  	TCA_FLOWER_KEY_IPV4_DST_MASK		nlattr[TCA_FLOWER_KEY_IPV4_DST_MASK, ipv4_addr_mask]
   674  	TCA_FLOWER_KEY_IPV6_SRC			nlattr[TCA_FLOWER_KEY_IPV6_SRC, ipv6_addr]
   675  	TCA_FLOWER_KEY_IPV6_SRC_MASK		nlattr[TCA_FLOWER_KEY_IPV6_SRC_MASK, ipv6_addr_mask]
   676  	TCA_FLOWER_KEY_IPV6_DST			nlattr[TCA_FLOWER_KEY_IPV6_DST, ipv6_addr]
   677  	TCA_FLOWER_KEY_IPV6_DST_MASK		nlattr[TCA_FLOWER_KEY_IPV6_DST_MASK, ipv6_addr_mask]
   678  	TCA_FLOWER_KEY_TCP_SRC			nlattr[TCA_FLOWER_KEY_TCP_SRC, int16[0:0]]
   679  	TCA_FLOWER_KEY_TCP_DST			nlattr[TCA_FLOWER_KEY_TCP_DST, int16[0:0]]
   680  	TCA_FLOWER_KEY_UDP_SRC			nlattr[TCA_FLOWER_KEY_UDP_SRC, int16[0:0]]
   681  	TCA_FLOWER_KEY_UDP_DST			nlattr[TCA_FLOWER_KEY_UDP_DST, int16[0:0]]
   682  	TCA_FLOWER_FLAGS			nlattr[TCA_FLOWER_FLAGS, flags[tc_flower_flags, int32]]
   683  	TCA_FLOWER_KEY_VLAN_ID			nlattr[TCA_FLOWER_KEY_VLAN_ID, int16[0:4095]]
   684  	TCA_FLOWER_KEY_VLAN_PRIO		nlattr[TCA_FLOWER_KEY_VLAN_PRIO, int8[0:7]]
   685  	TCA_FLOWER_KEY_VLAN_ETH_TYPE		nlattr[TCA_FLOWER_KEY_VLAN_ETH_TYPE, flags[vlan_proto, int16be]]
   686  	TCA_FLOWER_KEY_ENC_KEY_ID		nlattr[TCA_FLOWER_KEY_ENC_KEY_ID, int32]
   687  	TCA_FLOWER_KEY_ENC_IPV4_SRC		nlattr[TCA_FLOWER_KEY_ENC_IPV4_SRC, ipv4_addr]
   688  	TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK	nlattr[TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK, ipv4_addr_mask]
   689  	TCA_FLOWER_KEY_ENC_IPV4_DST		nlattr[TCA_FLOWER_KEY_ENC_IPV4_DST, ipv4_addr]
   690  	TCA_FLOWER_KEY_ENC_IPV4_DST_MASK	nlattr[TCA_FLOWER_KEY_ENC_IPV4_DST_MASK, ipv4_addr_mask]
   691  	TCA_FLOWER_KEY_ENC_IPV6_SRC		nlattr[TCA_FLOWER_KEY_ENC_IPV6_SRC, ipv6_addr]
   692  	TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK	nlattr[TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK, ipv6_addr_mask]
   693  	TCA_FLOWER_KEY_ENC_IPV6_DST		nlattr[TCA_FLOWER_KEY_ENC_IPV6_DST, ipv6_addr]
   694  	TCA_FLOWER_KEY_ENC_IPV6_DST_MASK	nlattr[TCA_FLOWER_KEY_ENC_IPV6_DST_MASK, ipv6_addr_mask]
   695  	TCA_FLOWER_KEY_TCP_SRC_MASK		nlattr[TCA_FLOWER_KEY_TCP_SRC_MASK, int16[0:0]]
   696  	TCA_FLOWER_KEY_TCP_DST_MASK		nlattr[TCA_FLOWER_KEY_TCP_DST_MASK, int16[0:0]]
   697  	TCA_FLOWER_KEY_UDP_SRC_MASK		nlattr[TCA_FLOWER_KEY_UDP_SRC_MASK, int16[0:0]]
   698  	TCA_FLOWER_KEY_UDP_DST_MASK		nlattr[TCA_FLOWER_KEY_UDP_DST_MASK, int16[0:0]]
   699  	TCA_FLOWER_KEY_SCTP_SRC_MASK		nlattr[TCA_FLOWER_KEY_SCTP_SRC_MASK, int16[0:0]]
   700  	TCA_FLOWER_KEY_SCTP_DST_MASK		nlattr[TCA_FLOWER_KEY_SCTP_DST_MASK, int16[0:0]]
   701  	TCA_FLOWER_KEY_SCTP_SRC			nlattr[TCA_FLOWER_KEY_SCTP_SRC, int16[0:0]]
   702  	TCA_FLOWER_KEY_SCTP_DST			nlattr[TCA_FLOWER_KEY_SCTP_DST, int16[0:0]]
   703  	TCA_FLOWER_KEY_ENC_UDP_SRC_PORT		nlattr[TCA_FLOWER_KEY_ENC_UDP_SRC_PORT, int16[0:0]]
   704  	TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK	nlattr[TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK, int16[0:0]]
   705  	TCA_FLOWER_KEY_ENC_UDP_DST_PORT		nlattr[TCA_FLOWER_KEY_ENC_UDP_DST_PORT, int16[0:0]]
   706  	TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK	nlattr[TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK, int16[0:0]]
   707  	TCA_FLOWER_KEY_FLAGS			nlattr[TCA_FLOWER_KEY_FLAGS, int32]
   708  	TCA_FLOWER_KEY_FLAGS_MASK		nlattr[TCA_FLOWER_KEY_FLAGS_MASK, int32]
   709  	TCA_FLOWER_KEY_ICMPV4_CODE		nlattr[TCA_FLOWER_KEY_ICMPV4_CODE, int8[0:0]]
   710  	TCA_FLOWER_KEY_ICMPV4_CODE_MASK		nlattr[TCA_FLOWER_KEY_ICMPV4_CODE_MASK, int8[0:0]]
   711  	TCA_FLOWER_KEY_ICMPV4_TYPE		nlattr[TCA_FLOWER_KEY_ICMPV4_TYPE, int8[0:0]]
   712  	TCA_FLOWER_KEY_ICMPV4_TYPE_MASK		nlattr[TCA_FLOWER_KEY_ICMPV4_TYPE_MASK, int8[0:0]]
   713  	TCA_FLOWER_KEY_ICMPV6_CODE		nlattr[TCA_FLOWER_KEY_ICMPV6_CODE, int8[0:0]]
   714  	TCA_FLOWER_KEY_ICMPV6_CODE_MASK		nlattr[TCA_FLOWER_KEY_ICMPV6_CODE_MASK, int8[0:0]]
   715  	TCA_FLOWER_KEY_ICMPV6_TYPE		nlattr[TCA_FLOWER_KEY_ICMPV6_TYPE, int8[0:0]]
   716  	TCA_FLOWER_KEY_ICMPV6_TYPE_MASK		nlattr[TCA_FLOWER_KEY_ICMPV6_TYPE_MASK, int8[0:0]]
   717  	TCA_FLOWER_KEY_ARP_SIP			nlattr[TCA_FLOWER_KEY_ARP_SIP, ipv4_addr]
   718  	TCA_FLOWER_KEY_ARP_SIP_MASK		nlattr[TCA_FLOWER_KEY_ARP_SIP_MASK, ipv4_addr_mask]
   719  	TCA_FLOWER_KEY_ARP_TIP			nlattr[TCA_FLOWER_KEY_ARP_TIP, ipv4_addr]
   720  	TCA_FLOWER_KEY_ARP_TIP_MASK		nlattr[TCA_FLOWER_KEY_ARP_TIP_MASK, ipv4_addr_mask]
   721  	TCA_FLOWER_KEY_ARP_OP			nlattr[TCA_FLOWER_KEY_ARP_OP, int8]
   722  	TCA_FLOWER_KEY_ARP_OP_MASK		nlattr[TCA_FLOWER_KEY_ARP_OP_MASK, int8]
   723  	TCA_FLOWER_KEY_ARP_SHA			nlattr[TCA_FLOWER_KEY_ARP_SHA, mac_addr]
   724  	TCA_FLOWER_KEY_ARP_SHA_MASK		nlattr[TCA_FLOWER_KEY_ARP_SHA_MASK, mac_addr_mask]
   725  	TCA_FLOWER_KEY_ARP_THA			nlattr[TCA_FLOWER_KEY_ARP_THA, mac_addr]
   726  	TCA_FLOWER_KEY_ARP_THA_MASK		nlattr[TCA_FLOWER_KEY_ARP_THA_MASK, mac_addr_mask]
   727  	TCA_FLOWER_KEY_MPLS_TTL			nlattr[TCA_FLOWER_KEY_MPLS_TTL, int8]
   728  	TCA_FLOWER_KEY_MPLS_BOS			nlattr[TCA_FLOWER_KEY_MPLS_BOS, int8]
   729  	TCA_FLOWER_KEY_MPLS_TC			nlattr[TCA_FLOWER_KEY_MPLS_TC, int8]
   730  	TCA_FLOWER_KEY_MPLS_LABEL		nlattr[TCA_FLOWER_KEY_MPLS_LABEL, int32]
   731  	TCA_FLOWER_KEY_MPLS_OPTS		nlnest[TCA_FLOWER_KEY_MPLS_OPTS, mpls_opts]
   732  	TCA_FLOWER_KEY_TCP_FLAGS		nlattr[TCA_FLOWER_KEY_TCP_FLAGS, int16]
   733  	TCA_FLOWER_KEY_TCP_FLAGS_MASK		nlattr[TCA_FLOWER_KEY_TCP_FLAGS_MASK, int16]
   734  	TCA_FLOWER_KEY_IP_TOS			nlattr[TCA_FLOWER_KEY_IP_TOS, int8]
   735  	TCA_FLOWER_KEY_IP_TOS_MASK		nlattr[TCA_FLOWER_KEY_IP_TOS_MASK, int8]
   736  	TCA_FLOWER_KEY_IP_TTL			nlattr[TCA_FLOWER_KEY_IP_TTL, int8]
   737  	TCA_FLOWER_KEY_IP_TTL_MASK		nlattr[TCA_FLOWER_KEY_IP_TTL_MASK, int8]
   738  	TCA_FLOWER_KEY_CVLAN_ID			nlattr[TCA_FLOWER_KEY_CVLAN_ID, int16[0:4095]]
   739  	TCA_FLOWER_KEY_CVLAN_PRIO		nlattr[TCA_FLOWER_KEY_CVLAN_PRIO, int8[0:8]]
   740  	TCA_FLOWER_KEY_CVLAN_ETH_TYPE		nlattr[TCA_FLOWER_KEY_CVLAN_ETH_TYPE, flags[vlan_proto, int16be]]
   741  	TCA_FLOWER_KEY_ENC_IP_TOS		nlattr[TCA_FLOWER_KEY_ENC_IP_TOS, int8]
   742  	TCA_FLOWER_KEY_ENC_IP_TOS_MASK		nlattr[TCA_FLOWER_KEY_ENC_IP_TOS_MASK, int8]
   743  	TCA_FLOWER_KEY_ENC_IP_TTL		nlattr[TCA_FLOWER_KEY_ENC_IP_TTL, int8]
   744  	TCA_FLOWER_KEY_ENC_IP_TTL_MASK		nlattr[TCA_FLOWER_KEY_ENC_IP_TTL_MASK, int8]
   745  	TCA_FLOWER_KEY_ENC_OPTS			nlnest[TCA_FLOWER_KEY_ENC_OPTS, array[enc_opts_policy]]
   746  	TCA_FLOWER_KEY_ENC_OPTS_MASK		nlnest[TCA_FLOWER_KEY_ENC_OPTS_MASK, array[enc_opts_policy]]
   747  	TCA_FLOWER_KEY_PORT_SRC_MIN		nlattr[TCA_FLOWER_KEY_PORT_SRC_MIN, sock_port]
   748  	TCA_FLOWER_KEY_PORT_SRC_MAX		nlattr[TCA_FLOWER_KEY_PORT_SRC_MAX, sock_port]
   749  	TCA_FLOWER_KEY_PORT_DST_MIN		nlattr[TCA_FLOWER_KEY_PORT_DST_MIN, sock_port]
   750  	TCA_FLOWER_KEY_PORT_DST_MAX		nlattr[TCA_FLOWER_KEY_PORT_DST_MAX, sock_port]
   751  	TCA_FLOWER_KEY_CT_STATE			nlattr[TCA_FLOWER_KEY_CT_STATE, int16]
   752  	TCA_FLOWER_KEY_CT_STATE_MASK		nlattr[TCA_FLOWER_KEY_CT_STATE_MASK, int16]
   753  	TCA_FLOWER_KEY_CT_ZONE			nlattr[TCA_FLOWER_KEY_CT_ZONE, int16]
   754  	TCA_FLOWER_KEY_CT_ZONE_MASK		nlattr[TCA_FLOWER_KEY_CT_ZONE_MASK, int16]
   755  	TCA_FLOWER_KEY_CT_MARK			nlattr[TCA_FLOWER_KEY_CT_MARK, int32]
   756  	TCA_FLOWER_KEY_CT_MARK_MASK		nlattr[TCA_FLOWER_KEY_CT_MARK_MASK, int32]
   757  	TCA_FLOWER_KEY_CT_LABELS		nlattr[TCA_FLOWER_KEY_CT_LABELS, array[int8, 16]]
   758  	TCA_FLOWER_KEY_CT_LABELS_MASK		nlattr[TCA_FLOWER_KEY_CT_LABELS_MASK, array[int8, 16]]
   759  ] [varlen]
   760  
   761  enc_opts_policy [
   762  	TCA_FLOWER_KEY_ENC_OPTS_GENEVE	nlnest[TCA_FLOWER_KEY_ENC_OPTS_GENEVE, array[geneve_opt_policy]]
   763  	TCA_FLOWER_KEY_ENC_OPTS_VXLAN	nlnest[TCA_FLOWER_KEY_ENC_OPTS_VXLAN, array[vxlan_opt_policy]]
   764  	TCA_FLOWER_KEY_ENC_OPTS_ERSPAN	nlnest[TCA_FLOWER_KEY_ENC_OPTS_ERSPAN, array[erspan_opt_policy]]
   765  ] [varlen]
   766  
   767  geneve_opt_policy [
   768  	TCA_FLOWER_KEY_ENC_OPT_GENEVE_CLASS	nlattr[TCA_FLOWER_KEY_ENC_OPT_GENEVE_CLASS, int16]
   769  	TCA_FLOWER_KEY_ENC_OPT_GENEVE_TYPE	nlattr[TCA_FLOWER_KEY_ENC_OPT_GENEVE_TYPE, int8]
   770  	TCA_FLOWER_KEY_ENC_OPT_GENEVE_DATA	nlattr[TCA_FLOWER_KEY_ENC_OPT_GENEVE_DATA, int8]
   771  ] [varlen]
   772  
   773  vxlan_opt_policy [
   774  	TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP	nlattr[TCA_FLOWER_KEY_ENC_OPT_VXLAN_GBP, int32]
   775  ] [varlen]
   776  
   777  erspan_opt_policy [
   778  	TCA_FLOWER_KEY_ENC_OPT_ERSPAN_VER	nlattr[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_VER, int8[0:1]]
   779  	TCA_FLOWER_KEY_ENC_OPT_ERSPAN_INDEX	nlattr[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_INDEX, int32]
   780  	TCA_FLOWER_KEY_ENC_OPT_ERSPAN_DIR	nlattr[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_DIR, int8]
   781  	TCA_FLOWER_KEY_ENC_OPT_ERSPAN_HWID	nlattr[TCA_FLOWER_KEY_ENC_OPT_ERSPAN_HWID, int8]
   782  ] [varlen]
   783  
   784  mpls_opts [
   785  	TCA_FLOWER_KEY_MPLS_OPTS_LSE	nlnest[TCA_FLOWER_KEY_MPLS_OPTS_LSE, array[mpls_stack_entry_policy]]
   786  ] [varlen]
   787  
   788  mpls_stack_entry_policy [
   789  	TCA_FLOWER_KEY_MPLS_OPT_LSE_DEPTH	nlattr[TCA_FLOWER_KEY_MPLS_OPT_LSE_DEPTH, int8[1:FLOW_DIS_MPLS_MAX]]
   790  	TCA_FLOWER_KEY_MPLS_OPT_LSE_TTL		nlattr[TCA_FLOWER_KEY_MPLS_OPT_LSE_TTL, int8]
   791  	TCA_FLOWER_KEY_MPLS_OPT_LSE_BOS		nlattr[TCA_FLOWER_KEY_MPLS_OPT_LSE_BOS, int8[0:MPLS_BOS_MASK]]
   792  	TCA_FLOWER_KEY_MPLS_OPT_LSE_TC		nlattr[TCA_FLOWER_KEY_MPLS_OPT_LSE_TC, int8[0:MPLS_TC_MASK]]
   793  	TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL	nlattr[TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL, mpls_label]
   794  ] [varlen]
   795  
   796  fw_policy [
   797  	TCA_FW_CLASSID	nlattr[TCA_FW_CLASSID, tcm_handle]
   798  	TCA_FW_POLICE	nlattr[TCA_FW_POLICE, array[police_policy]]
   799  	TCA_FW_INDEV	nlattr[TCA_FW_INDEV, devname]
   800  	TCA_FW_ACT	nlattr[TCA_FW_ACT, array[tca_actions]]
   801  	TCA_FW_MASK	nlattr[TCA_FW_MASK, int32]
   802  ] [varlen]
   803  
   804  mall_policy [
   805  	TCA_MATCHALL_CLASSID	nlattr[TCA_MATCHALL_CLASSID, tcm_handle]
   806  	TCA_MATCHALL_ACT	nlattr[TCA_MATCHALL_ACT, array[tca_actions]]
   807  	TCA_MATCHALL_FLAGS	nlattr[TCA_MATCHALL_FLAGS, int32[0:8]]
   808  ] [varlen]
   809  
   810  route4_policy [
   811  	TCA_ROUTE4_CLASSID	nlattr[TCA_ROUTE4_CLASSID, tcm_handle]
   812  	TCA_ROUTE4_TO		nlattr[TCA_ROUTE4_TO, int32[0:256]]
   813  	TCA_ROUTE4_FROM		nlattr[TCA_ROUTE4_FROM, int32[0:256]]
   814  	TCA_ROUTE4_IIF		nlattr[TCA_ROUTE4_IIF, ifindex]
   815  	TCA_ROUTE4_POLICE	nlattr[TCA_ROUTE4_POLICE, array[police_policy]]
   816  	TCA_ROUTE4_ACT		nlattr[TCA_ROUTE4_ACT, array[tca_actions]]
   817  ] [varlen]
   818  
   819  u32_policy [
   820  	TCA_U32_CLASSID	nlattr[TCA_U32_CLASSID, tcm_handle]
   821  	TCA_U32_HASH	nlattr[TCA_U32_HASH, int32]
   822  	TCA_U32_LINK	nlattr[TCA_U32_LINK, int32]
   823  	TCA_U32_DIVISOR	nlattr[TCA_U32_DIVISOR, int32[0:0x100]]
   824  	TCA_U32_SEL	nlattr[TCA_U32_SEL, tc_u32_sel]
   825  	TCA_U32_POLICE	nlattr[TCA_U32_POLICE, array[police_policy]]
   826  	TCA_U32_ACT	nlattr[TCA_U32_ACT, array[tca_actions]]
   827  	TCA_U32_INDEV	nlattr[TCA_U32_INDEV, devname]
   828  	TCA_U32_MARK	nlattr[TCA_U32_MARK, tc_u32_mark]
   829  	TCA_U32_FLAGS	nlattr[TCA_U32_FLAGS, int32[0:8]]
   830  ] [varlen]
   831  
   832  tc_rsvp_gpi {
   833  	key	int32
   834  	mask	int32
   835  	offset	int32
   836  }
   837  
   838  tc_rsvp_pinfo {
   839  	dpi		tc_rsvp_gpi
   840  	spi		tc_rsvp_gpi
   841  	protocol	flags[ipv4_types, int8]
   842  	tunnelid	int8
   843  	tunnelhdr	int8
   844  	pad		const[0, int8]
   845  }
   846  
   847  tc_u32_sel {
   848  	flags		int8[0:16]
   849  	offshift	int8
   850  	nkeys		int8
   851  	offmast		int16be
   852  	off		int16
   853  	offoff		int16
   854  	hoff		int16
   855  	hmask		int32be
   856  	keys		array[tc_u32_key, 0:128]
   857  }
   858  
   859  # NEED: (mark.val & mark.mask) should equal to mark.val
   860  tc_u32_mark {
   861  	val	int32
   862  	mask	int32
   863  	success	const[0, int32]
   864  }
   865  
   866  # ------------------------------ tc action ------------------------------
   867  type nlattr_tca_actions[PAYLOAD] nlattr_tt[int16:14[0:TCA_ACT_MAX_PRIO], 0, 0, PAYLOAD]
   868  
   869  tca_actions [
   870  	m_bpf		nlattr_tca_actions[tcf_action_policy["bpf", act_bpf_policy]]
   871  	m_connmark	nlattr_tca_actions[tcf_action_policy["connmark", connmark_policy]]
   872  	m_csum		nlattr_tca_actions[tcf_action_policy["csum", csum_policy]]
   873  	m_ct		nlattr_tca_actions[tcf_action_policy["ct", ct_policy]]
   874  	m_ctinfo	nlattr_tca_actions[tcf_action_policy["ctinfo", ctinfo_policy]]
   875  	m_gact		nlattr_tca_actions[tcf_action_policy["gact", gact_policy]]
   876  	m_ife		nlattr_tca_actions[tcf_action_policy["ife", ife_policy]]
   877  	m_xt		nlattr_tca_actions[tcf_action_policy["xt", ipt_policy]]
   878  	m_mirred	nlattr_tca_actions[tcf_action_policy["mirred", mirred_policy]]
   879  	m_mpls		nlattr_tca_actions[tcf_action_policy["mpls", mpls_policy]]
   880  	m_nat		nlattr_tca_actions[tcf_action_policy["nat", nat_policy]]
   881  	m_pedit		nlattr_tca_actions[tcf_action_policy["pedit", pedit_policy]]
   882  	m_police	nlattr_tca_actions[tcf_action_policy["police", array[police_policy]]]
   883  	m_sample	nlattr_tca_actions[tcf_action_policy["sample", sample_policy]]
   884  	m_simple	nlattr_tca_actions[tcf_action_policy["simple", simple_policy]]
   885  	m_skbedit	nlattr_tca_actions[tcf_action_policy["skbedit", skbedit_policy]]
   886  	m_skbmod	nlattr_tca_actions[tcf_action_policy["skbmod", skbmod_policy]]
   887  	m_tunnel_key	nlattr_tca_actions[tcf_action_policy["tunnel_key", tunnel_key_policy]]
   888  	m_vlan		nlattr_tca_actions[tcf_action_policy["vlan", vlan_policy$act]]
   889  ] [varlen]
   890  
   891  type tcf_action_policy[NAME, VALUES] {
   892  	TCA_ACT_KIND		nlattr[TCA_ACT_KIND, string[NAME]]
   893  	TCA_ACT_OPTIONS		nlnest[TCA_ACT_OPTIONS, array[VALUES]]
   894  	TCA_ACT_COOKIE		nlattr[TCA_ACT_COOKIE, array[int8]]
   895  	TCA_ACT_FLAGS		nlattr[TCA_ACT_FLAGS, nla_bitfield32[tcf_action_policy_flags]]
   896  	TCA_ACT_HW_STATS	nlattr[TCA_ACT_HW_STATS, nla_bitfield32[tcf_action_policy_hw_stats]]
   897  } [packed, align[4]]
   898  
   899  tcf_action_policy_flags = TCA_ACT_FLAGS_NO_PERCPU_STATS
   900  tcf_action_policy_hw_stats = TCA_ACT_HW_STATS_IMMEDIATE, TCA_ACT_HW_STATS_DELAYED
   901  
   902  act_bpf_policy [
   903  	TCA_ACT_BPF_PARMS	nlattr[TCA_ACT_BPF_PARMS, tc_act_bpf]
   904  	TCA_ACT_BPF_OPS_LEN	nlattr[TCA_ACT_BPF_OPS_LEN, int16[0:10]]
   905  	TCA_ACT_BPF_OPS		nlattr[TCA_ACT_BPF_OPS, array[sock_filter]]
   906  	TCA_ACT_BPF_FD		nlattr[TCA_ACT_BPF_FD, fd]
   907  	TCA_ACT_BPF_NAME	nlattr[TCA_ACT_BPF_NAME, string[filename]]
   908  ] [varlen]
   909  
   910  connmark_policy [
   911  	TCA_CONNMARK_PARMS	nlattr[TCA_CONNMARK_PARMS, tc_connmark]
   912  ] [varlen]
   913  
   914  csum_policy [
   915  	TCA_CSUM_PARMS	nlattr[TCA_CSUM_PARMS, tc_csum]
   916  ] [varlen]
   917  
   918  ct_policy [
   919  	TCA_CT_PARMS		nlattr[TCA_CT_PARMS, tc_gen]
   920  	TCA_CT_ACTION		nlattr[TCA_CT_ACTION, flags[tca_ct_actions, int16]]
   921  	TCA_CT_ZONE		nlattr[TCA_CT_ZONE, int16]
   922  	TCA_CT_MARK		nlattr[TCA_CT_MARK, int32]
   923  	TCA_CT_MARK_MASK	nlattr[TCA_CT_MARK_MASK, int32]
   924  	TCA_CT_LABELS		nlattr[TCA_CT_LABELS, array[int8, 16]]
   925  	TCA_CT_LABELS_MASK	nlattr[TCA_CT_LABELS_MASK, array[int8, 16]]
   926  	TCA_CT_NAT_IPV4_MIN	nlattr[TCA_CT_NAT_IPV4_MIN, ipv4_addr]
   927  	TCA_CT_NAT_IPV4_MAX	nlattr[TCA_CT_NAT_IPV4_MAX, ipv4_addr]
   928  	TCA_CT_NAT_IPV6_MIN	nlattr[TCA_CT_NAT_IPV6_MIN, ipv6_addr]
   929  	TCA_CT_NAT_IPV6_MAX	nlattr[TCA_CT_NAT_IPV6_MAX, ipv6_addr]
   930  	TCA_CT_NAT_PORT_MIN	nlattr[TCA_CT_NAT_PORT_MIN, sock_port]
   931  	TCA_CT_NAT_PORT_MAX	nlattr[TCA_CT_NAT_PORT_MAX, sock_port]
   932  ] [varlen]
   933  
   934  ctinfo_policy [
   935  	TCA_CTINFO_ACT			nlattr[TCA_CTINFO_ACT, tc_gen]
   936  	TCA_CTINFO_ZONE			nlattr[TCA_CTINFO_ZONE, int16]
   937  	TCA_CTINFO_PARMS_DSCP_MASK	nlattr[TCA_CTINFO_PARMS_DSCP_MASK, int32]
   938  	TCA_CTINFO_PARMS_DSCP_STATEMASK	nlattr[TCA_CTINFO_PARMS_DSCP_STATEMASK, int32]
   939  	TCA_CTINFO_PARMS_CPMARK_MASK	nlattr[TCA_CTINFO_PARMS_CPMARK_MASK, int32]
   940  ] [varlen]
   941  
   942  gact_policy [
   943  	TCA_GACT_PARMS	nlattr[TCA_GACT_PARMS, tc_gen]
   944  	TCA_GACT_PROB	nlattr[TCA_GACT_PROB, tc_gact_p]
   945  ] [varlen]
   946  
   947  ife_policy [
   948  	TCA_IFE_PARMS	nlattr[TCA_IFE_PARMS, tc_ife]
   949  	TCA_IFE_DMAC	nlattr[TCA_IFE_DMAC, mac_addr]
   950  	TCA_IFE_SMAC	nlattr[TCA_IFE_SMAC, mac_addr]
   951  	TCA_IFE_TYPE	nlattr[TCA_IFE_TYPE, int16]
   952  	TCA_IFE_METALST	nlattr[TCA_IFE_METALST, array[tca_ife_meta_policy]]
   953  ] [varlen]
   954  
   955  tca_ife_meta_policy [
   956  	IFE_META_SKBMARK	nlattr[IFE_META_SKBMARK, optional[int32]]
   957  	IFE_META_PRIO		nlattr[IFE_META_PRIO, optional[int32]]
   958  	IFE_META_TCINDEX	nlattr[IFE_META_TCINDEX, optional[int16]]
   959  ] [varlen]
   960  
   961  # NEED: u_target_size = XT_ALIGN(sizeof(struct xt_entry_target)) + target->size
   962  xt_entry_target {
   963  	u_target_size	int16
   964  	name		string[ipt_tables, XT_TABLE_MAXNAMELEN]
   965  	revision	int8
   966  	target_size	int16
   967  	data		array[int8]
   968  }
   969  
   970  mirred_policy [
   971  	TCA_MIRRED_PARMS	nlattr[TCA_MIRRED_PARMS, tc_mirred]
   972  ] [varlen]
   973  
   974  mpls_policy [
   975  	TCA_MPLS_PARMS	nlattr[TCA_MPLS_PARMS, tc_mpls]
   976  	TCA_MPLS_PROTO	nlattr[TCA_MPLS_PROTO, flags[ether_types, int16be]]
   977  	TCA_MPLS_LABEL	nlattr[TCA_MPLS_LABEL, int32[0:0xfffff]]
   978  	TCA_MPLS_TC	nlattr[TCA_MPLS_TC, int8[0:7]]
   979  	TCA_MPLS_TTL	nlattr[TCA_MPLS_TTL, int8]
   980  	TCA_MPLS_BOS	nlattr[TCA_MPLS_BOS, int8[0:1]]
   981  ] [varlen]
   982  
   983  nat_policy [
   984  	TCA_NAT_PARMS	nlattr[TCA_NAT_PARMS, tc_nat]
   985  ] [varlen]
   986  
   987  pedit_policy [
   988  	TCA_PEDIT_PARMS		nlattr[TCA_PEDIT_PARMS, m_pedit_sel]
   989  	TCA_PEDIT_PARMS_EX	nlattr[TCA_PEDIT_PARMS_EX, m_pedit_sel]
   990  	TCA_PEDIT_KEYS_EX	nlnest[TCA_PEDIT_KEYS_EX, array[nlnest[TCA_PEDIT_KEY_EX, array[pedit_key_ex_policy]]]]
   991  ] [varlen]
   992  
   993  pedit_key_ex_policy [
   994  	TCA_PEDIT_KEY_EX_HTYPE	nlattr[TCA_PEDIT_KEY_EX_HTYPE, flags[pedit_header_type, int16]]
   995  	TCA_PEDIT_KEY_EX_CMD	nlattr[TCA_PEDIT_KEY_EX_CMD, flags[pedit_cmd, int16]]
   996  ] [varlen]
   997  
   998  sample_policy [
   999  	TCA_SAMPLE_PARMS		nlattr[TCA_SAMPLE_PARMS, tc_gen]
  1000  	TCA_SAMPLE_RATE			nlattr[TCA_SAMPLE_RATE, int32]
  1001  	TCA_SAMPLE_TRUNC_SIZE		nlattr[TCA_SAMPLE_TRUNC_SIZE, int32]
  1002  	TCA_SAMPLE_PSAMPLE_GROUP	nlattr[TCA_SAMPLE_PSAMPLE_GROUP, int32]
  1003  ] [varlen]
  1004  
  1005  simple_policy [
  1006  	TCA_DEF_PARMS	nlattr[TCA_DEF_PARMS, tc_gen]
  1007  	TCA_DEF_DATA	nlattr[TCA_DEF_DATA, string]
  1008  ] [varlen]
  1009  
  1010  skbedit_policy [
  1011  	TCA_SKBEDIT_PARMS		nlattr[TCA_SKBEDIT_PARMS, tc_gen]
  1012  	TCA_SKBEDIT_QUEUE_MAPPING	nlattr[TCA_SKBEDIT_QUEUE_MAPPING, int16]
  1013  	TCA_SKBEDIT_PRIORITY		nlattr[TCA_SKBEDIT_PRIORITY, tcm_handle]
  1014  	TCA_SKBEDIT_MARK		nlattr[TCA_SKBEDIT_MARK, int32]
  1015  	TCA_SKBEDIT_PTYPE		nlattr[TCA_SKBEDIT_PTYPE, flags[packet_types, int16]]
  1016  ] [varlen]
  1017  
  1018  skbmod_policy [
  1019  	TCA_SKBMOD_PARMS	nlattr[TCA_SKBMOD_PARMS, tc_skbmod]
  1020  	TCA_SKBMOD_DMAC		nlattr[TCA_SKBMOD_DMAC, mac_addr]
  1021  	TCA_SKBMOD_SMAC		nlattr[TCA_SKBMOD_SMAC, mac_addr]
  1022  	TCA_SKBMOD_ETYPE	nlattr[TCA_SKBMOD_ETYPE, int16]
  1023  ] [varlen]
  1024  
  1025  tunnel_key_policy [
  1026  	TCA_TUNNEL_KEY_PARMS		nlattr[TCA_TUNNEL_KEY_PARMS, tc_tunnel_key]
  1027  	TCA_TUNNEL_KEY_ENC_IPV4_SRC	nlattr[TCA_TUNNEL_KEY_ENC_IPV4_SRC, ipv4_addr]
  1028  	TCA_TUNNEL_KEY_ENC_IPV4_DST	nlattr[TCA_TUNNEL_KEY_ENC_IPV4_DST, ipv4_addr]
  1029  	TCA_TUNNEL_KEY_ENC_IPV6_SRC	nlattr[TCA_TUNNEL_KEY_ENC_IPV6_SRC, ipv6_addr]
  1030  	TCA_TUNNEL_KEY_ENC_IPV6_DST	nlattr[TCA_TUNNEL_KEY_ENC_IPV6_DST, ipv6_addr]
  1031  	TCA_TUNNEL_KEY_ENC_KEY_ID	nlattr[TCA_TUNNEL_KEY_ENC_KEY_ID, int32]
  1032  	TCA_TUNNEL_KEY_ENC_DST_PORT	nlattr[TCA_TUNNEL_KEY_ENC_DST_PORT, sock_port]
  1033  	TCA_TUNNEL_KEY_NO_CSUM		nlattr[TCA_TUNNEL_KEY_NO_CSUM, int8[0:1]]
  1034  ] [varlen]
  1035  
  1036  vlan_policy$act [
  1037  	TCA_VLAN_PARMS			nlattr[TCA_VLAN_PARMS, tc_vlan]
  1038  	TCA_VLAN_PUSH_VLAN_ID		nlattr[TCA_VLAN_PUSH_VLAN_ID, int16[0:0xfff]]
  1039  	TCA_VLAN_PUSH_VLAN_PROTOCOL	nlattr[TCA_VLAN_PUSH_VLAN_PROTOCOL, flags[vlan_proto, int16be]]
  1040  	TCA_VLAN_PUSH_VLAN_PRIORITY	nlattr[TCA_VLAN_PUSH_VLAN_PRIORITY, int8[0:7]]
  1041  ] [varlen]
  1042  
  1043  action_gd_policy [
  1044  	TCA_ACT_TAB	nlattr[TCA_ACT_TAB, array[nlattr_tca_actions[tcf_action_policy$kind_index]]]
  1045  ] [varlen]
  1046  
  1047  tcf_action_policy$kind_index [
  1048  	TCA_ACT_KIND	nlattr[TCA_ACT_KIND, string[tca_actions_kinds]]
  1049  	TCA_ACT_INDEX	nlattr[TCA_ACT_INDEX, int32]
  1050  ] [varlen]
  1051  
  1052  tcaa_policy [
  1053  	TCA_ROOT_FLAGS		nlattr[TCA_ROOT_FLAGS, nla_bitfield32[tcaa_policy_root_flags]]
  1054  	TCA_ROOT_TIME_DELTA	nlattr[TCA_ROOT_TIME_DELTA, int32]
  1055  ] [varlen]
  1056  
  1057  tcaa_policy_root_flags = TCA_FLAG_LARGE_DUMP_ON
  1058  
  1059  action_dump_policy [
  1060  	action_gd		action_gd_policy
  1061  	action_dump_flags	tcaa_policy
  1062  ] [varlen]
  1063  
  1064  tc_gen {
  1065  	index	int32
  1066  	capab	int32
  1067  	action	flags[tc_actions, int32]
  1068  	refcnt	int32
  1069  	bindcnt	int32
  1070  }
  1071  
  1072  type tc_act_bpf tc_gen
  1073  
  1074  tc_connmark {
  1075  	tc_gen	tc_gen
  1076  	zone	int16
  1077  }
  1078  
  1079  tc_csum {
  1080  	tc_gen		tc_gen
  1081  	update_flags	int32[0:128]
  1082  }
  1083  
  1084  tc_gact_p {
  1085  	ptype	flags[tc_pgact_flags, int16]
  1086  	pval	int16[0:10000]
  1087  	paction	flags[tc_actions, int32]
  1088  }
  1089  
  1090  tc_ife {
  1091  	tc_gen	tc_gen
  1092  	flags	int16[0:1]
  1093  }
  1094  
  1095  tc_mirred {
  1096  	tc_gen	tc_gen
  1097  	eaction	flags[tc_mirred_eactions, int32]
  1098  	ifindex	ifindex
  1099  }
  1100  
  1101  tc_mpls {
  1102  	tc_gen		tc_gen
  1103  	m_action	flags[tca_mpls_actions, int32]
  1104  }
  1105  
  1106  tc_nat {
  1107  	tc_gen		tc_gen
  1108  	old_addr	ipv4_addr
  1109  	new_addr	ipv4_addr
  1110  	mask		ipv4_addr_mask
  1111  	flags		int32[0:1]
  1112  }
  1113  
  1114  m_pedit_sel {
  1115  	sel		tc_pedit_sel
  1116  	keys		array[tc_pedit_key, 128]
  1117  	keys_ex		array[m_pedit_key_ex, 128]
  1118  	extended	bool8
  1119  } [packed, align[4]]
  1120  
  1121  tc_pedit_sel {
  1122  	tc_gen	tc_gen
  1123  	nkeys	int8
  1124  	flags	int8
  1125  	keys	array[tc_pedit_key]
  1126  }
  1127  
  1128  tc_pedit_key {
  1129  	mask	int32
  1130  	val	int32
  1131  	off	int32
  1132  	at	int32
  1133  	offmask	int32
  1134  	shift	int32
  1135  }
  1136  
  1137  m_pedit_key_ex {
  1138  	htype	flags[pedit_header_type, int16]
  1139  	cmd	flags[pedit_cmd, int16]
  1140  }
  1141  
  1142  tc_skbmod {
  1143  	tc_gen	tc_gen
  1144  	flags	int64[0:16]
  1145  }
  1146  
  1147  tc_tunnel_key {
  1148  	tc_gen		tc_gen
  1149  	t_action	int32[1:2]
  1150  }
  1151  
  1152  tc_vlan {
  1153  	tc_gen		tc_gen
  1154  	v_action	int32[1:3]
  1155  }
  1156  
  1157  # ------------------------------ tc police ------------------------------
  1158  police_policy [
  1159  	TCA_POLICE_TBF		nlattr[TCA_POLICE_TBF, tc_police]
  1160  	TCA_POLICE_RATE		nlattr[TCA_POLICE_RATE, array[int32, 256]]
  1161  	TCA_POLICE_PEAKRATE	nlattr[TCA_POLICE_PEAKRATE, array[int32, 256]]
  1162  	TCA_POLICE_AVRATE	nlattr[TCA_POLICE_AVRATE, int32]
  1163  	TCA_POLICE_RESULT	nlattr[TCA_POLICE_RESULT, int32]
  1164  	TCA_POLICE_RATE64	nlattr[TCA_POLICE_RATE64, int64]
  1165  	TCA_POLICE_PEAKRATE64	nlattr[TCA_POLICE_PEAKRATE64, int64]
  1166  ] [varlen]
  1167  
  1168  tc_police {
  1169  	index		int32
  1170  	action		flags[tc_actions, int32]
  1171  	limit		int32
  1172  	burst		int32
  1173  	mtu		int32
  1174  	rate		tc_ratespec
  1175  	peakrate	tc_ratespec
  1176  	refcnt		int32
  1177  	bindcnt		int32
  1178  	capab		int32
  1179  }
  1180  
  1181  tc_ratespec {
  1182  	cell_log	int8
  1183  	linklayer	flags[linklayer, int8]
  1184  	overhead	int16
  1185  	cell_align	int16
  1186  	mpu		int16
  1187  	rate		int32
  1188  }
  1189  
  1190  # ------------------------------ tc ematch ------------------------------
  1191  em_policy [
  1192  	TCA_EMATCH_TREE_HDR	nlattr[TCA_EMATCH_TREE_HDR, tcf_ematch_tree_hdr]
  1193  	TCA_EMATCH_TREE_LIST	nlnest[TCA_EMATCH_TREE_LIST, array[tca_ematch_tree_list]]
  1194  ] [varlen]
  1195  
  1196  tcf_ematch_tree_hdr {
  1197  	nmatches	int16
  1198  	progid		const[TCF_EM_PROG_TC, int16]
  1199  }
  1200  
  1201  type nlattr_tca_ematch_tree_list[PAYLOAD] nlattr_tt[int16:14[1:3], 0, 0, PAYLOAD]
  1202  
  1203  tca_ematch_tree_list [
  1204  	TCF_EM_CONTAINER	nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_CONTAINER, array[int8]]]
  1205  	TCF_EM_CMP		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_CMP, tcf_em_cmp]]
  1206  	TCF_EM_NBYTE		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_NBYTE, tcf_em_nbyte]]
  1207  	TCF_EM_U32		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_U32, tc_u32_key]]
  1208  	TCF_EM_META		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_META, array[meta_policy]]]
  1209  	TCF_EM_CANID		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_CANID, can_filter]]
  1210  	TCF_EM_IPSET		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_IPSET, xt_set_info]]
  1211  	TCF_EM_IPT		nlattr_tca_ematch_tree_list[tcf_ematch_hdr_t[TCF_EM_IPT, array[em_ipt_policy]]]
  1212  ] [varlen]
  1213  
  1214  type tcf_ematch_hdr[KIND] {
  1215  	matchid	int16
  1216  	kind	const[KIND, int16]
  1217  	flags	int16
  1218  	pad	const[0, int16]
  1219  } [align[4]]
  1220  
  1221  type tcf_ematch_hdr_t[KIND, PAYLOAD] {
  1222  	header	tcf_ematch_hdr[KIND]
  1223  	payload	PAYLOAD
  1224  } [align[4]]
  1225  
  1226  tcf_em_cmp {
  1227  	val	int32
  1228  	mask	int32
  1229  	off	int16
  1230  	align	flags[tcf_em_aligns, int8:4]
  1231  	flags	int8:4
  1232  	layer	flags[tcf_layers, int8:4]
  1233  	opnd	flags[tcf_em_opnds, int8:4]
  1234  }
  1235  
  1236  tcf_em_nbyte {
  1237  	off	int16
  1238  	len	bytesize[payload, int16:12]
  1239  	layer	flags[tcf_layers, int8:4]
  1240  	payload	array[int8, 0:10]
  1241  } [align[4]]
  1242  
  1243  tc_u32_key {
  1244  	mask	int32be
  1245  	val	int32be
  1246  	off	int32
  1247  	offmask	int32
  1248  }
  1249  
  1250  meta_policy [
  1251  	TCA_EM_META_HDR		nlattr[TCA_EM_META_HDR, tcf_meta_hdr]
  1252  	TCA_EM_META_LVALUE	nlattr[TCA_EM_META_LVALUE, array[tcf_em_meta_int_var]]
  1253  	TCA_EM_META_RVALUE	nlattr[TCA_EM_META_RVALUE, array[tcf_em_meta_int_var]]
  1254  ] [varlen]
  1255  
  1256  tcf_meta_hdr {
  1257  	left	tcf_meta_val
  1258  	right	tcf_meta_val
  1259  }
  1260  
  1261  tcf_meta_val {
  1262  # TODO: kind value should be TCF_META_TYPE_VAR << 12 or TCF_META_TYPE_INT << 12
  1263  	kind	int16
  1264  	shift	int8
  1265  	op	flags[tcf_em_opnds, int8]
  1266  }
  1267  
  1268  tcf_em_meta_int_var [
  1269  	TCF_META_TYPE_INT	int32[0:10]
  1270  	TCF_META_TYPE_VAR	array[int8, 0:10]
  1271  ] [varlen]
  1272  
  1273  em_ipt_policy [
  1274  	TCA_EM_IPT_HOOK			nlattr[TCA_EM_IPT_HOOK, flags[nf_inet_hooks, int32]]
  1275  	TCA_EM_IPT_MATCH_NAME		nlattr[TCA_EM_IPT_MATCH_NAME, string["policy"]]
  1276  	TCA_EM_IPT_MATCH_REVISION	nlattr[TCA_EM_IPT_MATCH_REVISION, int8]
  1277  	TCA_EM_IPT_NFPROTO		nlattr[TCA_EM_IPT_NFPROTO, flags[nfproto, int8]]
  1278  	TCA_EM_IPT_MATCH_DATA		nlattr[TCA_EM_IPT_MATCH_DATA, array[int8]]
  1279  ] [varlen]
  1280  
  1281  # ------------------------------ tc others ------------------------------
  1282  tc_estimator {
  1283  	interval	int8
  1284  	ewma_log	int8
  1285  }
  1286  
  1287  stab_policy {
  1288  	TCA_STAB_BASE	nlattr[TCA_STAB_BASE, tc_sizespec]
  1289  	TCA_STAB_DATA	nlattr[TCA_STAB_DATA, array[int16]]
  1290  } [packed]
  1291  
  1292  tc_sizespec {
  1293  	cell_log	int8
  1294  	size_log	int8
  1295  	cell_align	int16
  1296  	overhead	int32
  1297  	linklayer	flags[linklayer, int32]
  1298  	mpu		int32
  1299  	mtu		int32
  1300  	tsize		len[stab_policy:TCA_STAB_DATA:payload, int32]
  1301  }
  1302  
  1303  tcm_handle_offsets = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0xffe0, 0xfff1, 0xfff2, 0xfff3, 0xffff
  1304  tcf_em_aligns = TCF_EM_ALIGN_U8, TCF_EM_ALIGN_U16, TCF_EM_ALIGN_U32
  1305  tcf_layers = TCF_LAYER_LINK, TCF_LAYER_NETWORK, TCF_LAYER_TRANSPORT
  1306  tcf_em_opnds = TCF_EM_OPND_EQ, TCF_EM_OPND_GT, TCF_EM_OPND_LT
  1307  nf_inet_hooks = NF_INET_PRE_ROUTING, NF_INET_LOCAL_IN, NF_INET_FORWARD, NF_INET_LOCAL_OUT, NF_INET_POST_ROUTING
  1308  linklayer = TC_LINKLAYER_UNAWARE, TC_LINKLAYER_ETHERNET, TC_LINKLAYER_ATM
  1309  tc_actions = TC_ACT_UNSPEC, TC_ACT_OK, TC_ACT_RECLASSIFY, TC_ACT_SHOT, TC_ACT_PIPE, TC_ACT_STOLEN, TC_ACT_QUEUED, TC_ACT_REPEAT, TC_ACT_REDIRECT, TC_ACT_TRAP, TC_ACT_JUMP, TC_ACT_GOTO_CHAIN
  1310  tca_actions_kinds = "bpf", "connmark", "csum", "gact", "ife", "ipt", "mirred", "nat", "pedit", "police", "sample", "skbedit", "skbmod", "tunnel_key", "vlan", "xt"
  1311  tc_flow_modes = FLOW_MODE_MAP, FLOW_MODE_HASH
  1312  tca_dsmark_ind = 1, 2, 4, 8, 16, 32
  1313  tc_mqprio_modes = TC_MQPRIO_MODE_DCB, TC_MQPRIO_MODE_CHANNEL
  1314  tc_mqprio_shapers = TC_MQPRIO_SHAPER_DCB, TC_MQPRIO_SHAPER_BW_RATE
  1315  tc_pgact_flags = PGACT_NONE, PGACT_NETRAND, PGACT_DETERM
  1316  tc_mirred_eactions = TCA_EGRESS_REDIR, TCA_EGRESS_MIRROR, TCA_INGRESS_REDIR, TCA_INGRESS_MIRROR
  1317  pedit_header_type = TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK, TCA_PEDIT_KEY_EX_HDR_TYPE_ETH, TCA_PEDIT_KEY_EX_HDR_TYPE_IP4, TCA_PEDIT_KEY_EX_HDR_TYPE_IP6, TCA_PEDIT_KEY_EX_HDR_TYPE_TCP, TCA_PEDIT_KEY_EX_HDR_TYPE_UDP
  1318  pedit_cmd = TCA_PEDIT_KEY_EX_CMD_SET, TCA_PEDIT_KEY_EX_CMD_ADD
  1319  packet_types = PACKET_HOST, PACKET_BROADCAST, PACKET_MULTICAST, PACKET_OTHERHOST, PACKET_OUTGOING, PACKET_LOOPBACK, PACKET_USER, PACKET_KERNEL
  1320  vlan_proto = ETH_P_8021Q, ETH_P_8021AD
  1321  tc_cake_ack_filter = CAKE_ACK_NONE, CAKE_ACK_FILTER, CAKE_ACK_AGGRESSIVE
  1322  tc_cake_atm = CAKE_ATM_NONE, CAKE_ATM_ATM, CAKE_ATM_PTM
  1323  tc_cake_diffserv_mode = CAKE_DIFFSERV_DIFFSERV3, CAKE_DIFFSERV_DIFFSERV4, CAKE_DIFFSERV_DIFFSERV8, CAKE_DIFFSERV_BESTEFFORT, CAKE_DIFFSERV_PRECEDENCE
  1324  tc_cake_flow_mode = CAKE_FLOW_NONE, CAKE_FLOW_SRC_IP, CAKE_FLOW_DST_IP, CAKE_FLOW_HOSTS, CAKE_FLOW_FLOWS, CAKE_FLOW_DUAL_SRC, CAKE_FLOW_DUAL_DST, CAKE_FLOW_TRIPLE
  1325  tc_etf_clock_id = CLOCK_REALTIME, CLOCK_TAI, CLOCK_BOOTTIME, CLOCK_MONOTONIC
  1326  tc_etf_flags = TC_ETF_DEADLINE_MODE_ON, TC_ETF_OFFLOAD_ON, TC_ETF_SKIP_SOCK_CHECK
  1327  tc_plug_actions = TCQ_PLUG_BUFFER, TCQ_PLUG_RELEASE_ONE, TCQ_PLUG_RELEASE_INDEFINITE, TCQ_PLUG_LIMIT
  1328  tc_flower_flags = TCA_CLS_FLAGS_SKIP_HW, TCA_CLS_FLAGS_SKIP_SW, TCA_CLS_FLAGS_IN_HW, TCA_CLS_FLAGS_NOT_IN_HW, TCA_CLS_FLAGS_VERBOSE
  1329  tca_ct_actions = TCA_CT_ACT_COMMIT, TCA_CT_ACT_FORCE, TCA_CT_ACT_CLEAR, TCA_CT_ACT_NAT, TCA_CT_ACT_NAT_SRC, TCA_CT_ACT_NAT_DST
  1330  tca_mpls_actions = TCA_MPLS_ACT_POP, TCA_MPLS_ACT_PUSH, TCA_MPLS_ACT_MODIFY, TCA_MPLS_ACT_DEC_TTL