/* * net/sched/cls_flower.c Flower classifier * * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */#include<linux/kernel.h>#include<linux/init.h>#include<linux/module.h>#include<linux/rhashtable.h>#include<linux/workqueue.h>#include<linux/if_ether.h>#include<linux/in6.h>#include<linux/ip.h>#include<net/sch_generic.h>#include<net/pkt_cls.h>#include<net/ip.h>#include<net/flow_dissector.h>#include<net/dst.h>#include<net/dst_metadata.h>structfl_flow_key{intindev_ifindex;structflow_dissector_key_controlcontrol;structflow_dissector_key_controlenc_control;structflow_dissector_key_basicbasic;structflow_dissector_key_eth_addrseth;structflow_dissector_key_vlanvlan;union{structflow_dissector_key_ipv4_addrsipv4;structflow_dissector_key_ipv6_addrsipv6;};structflow_dissector_key_portstp;structflow_dissector_key_icmpicmp;structflow_dissector_key_arparp;structflow_dissector_key_keyidenc_key_id;union{structflow_dissector_key_ipv4_addrsenc_ipv4;structflow_dissector_key_ipv6_addrsenc_ipv6;};structflow_dissector_key_portsenc_tp;}__aligned(BITS_PER_LONG/8);/* Ensure that we can do comparisons as longs. */structfl_flow_mask_range{unsignedshortintstart;unsignedshortintend;};structfl_flow_mask{structfl_flow_keykey;structfl_flow_mask_rangerange;structrcu_headrcu;};structcls_fl_head{structrhashtableht;structfl_flow_maskmask;structflow_dissectordissector;u32hgen;boolmask_assigned;structlist_headfilters;structrhashtable_paramsht_params;union{structwork_structwork;structrcu_headrcu;};};structcls_fl_filter{structrhash_headht_node;structfl_flow_keymkey;structtcf_extsexts;structtcf_resultres;structfl_flow_keykey;structlist_headlist;u32handle;u32flags;structrcu_headrcu;structtc_to_netdevtc;structnet_device*hw_dev;};staticunsignedshortintfl_mask_range(conststructfl_flow_mask*mask){returnmask->range.end-mask->range.start;}staticvoidfl_mask_update_range(structfl_flow_mask*m