linux/net/sched/cls_flow.c
<<
e="v 2//spa2 2//form 2/a e="v 2 href="../linux+v3" 7/net/sched/cls_flow.c">e="v 2/img src="../.static/gfx/right.png" alt=">>">e=//spa2 e=/spa2 class="lxr_search">e="ve="v 2/input typ 2hidden" nam 2navtarget" 2 2">e="v 2/input typ 2text" nam 2search" id 2search">e="v 2/button>typ 2submit">Searche="v 2Prefs 2//a>e=//spa2 "v 2 2//div "v 2 2/form ac.142="ajax+*" method="post" onsubmit="return false;">e=/input typ 2hidden" nam 2ajax_lookup" id 2ajax_lookup" 2 2">e"v 2 2//form e"v 2 2/div class="headingbottom">
/div id 2file_contents"
2 21//a>/spa2 class="comment">/*//spa2
 2 22//a>/spa2 class="comment"> * net/sched/cls_flow.c         Generic flow classifier//spa2
 2 23//a>/spa2 class="comment"> *//spa2
 2 24//a>/spa2 class="comment"> * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net>//spa2
 2 25//a>/spa2 class="comment"> *//spa2
 2 26//a>/spa2 class="comment"> * This program is free software; you ca2 redistribute it and/or//spa2
 2 27//a>/spa2 class="comment"> * modify it under the terms of the GNU General Public License//spa2
 2 28//a>/spa2 class="comment"> * as published by the Free Software Founda.142; either version>2//spa2
 2 29//a>/spa2 class="comment"> * of the License, or (at your v3.142) any later version.//spa2
 2  >
 a>/spa2 class="comment"> *///spa2
 2 11//a> 2 12//a>#include <linux/kernel.h//a>> 2 13//a>#include <linux/init.h//a>> 2 14//a>#include <linux/list.h//a>> 2 15//a>#include <linux/jhash.h//a>> 2 16//a>#include <linux/random.h//a>> 2 17//a>#include <linux/pkt_cls.h//a>> 2 18//a>#include <linux/skbuff.h//a>> 2 19//a>#include <linux/in.h//a>> 2 20//a>#include <linux/ip.h//a>> 2 21//a>#include <linux/ipv6.h//a>> 2 22//a>#include <linux/if_vlan.h//a>> 2 23//a>#include <linux/slab.h//a>> 2 24//a>#include <linux/module.h//a>> 2 25//a> 2 26//a>#include <net/pkt_cls.h//a>> 2 27//a>#include <net/ip.h//a>> 2 28//a>#include <net/route.h//a>> 2 29//a>#include <net/flow_keys.h//a>> 2 30//a> 2 31//a>#if2/a href="+code=defined" class="sref">defined//a>(/a href="+code=CONFIG_NF_CONNTRACK" class="sref">CONFIG_NF_CONNTRACK//a>) ||2/a href="+code=defined" class="sref">defined//a>(/a href="+code=CONFIG_NF_CONNTRACK_MODULE" class="sref">CONFIG_NF_CONNTRACK_MODULE//a>) 2 32//a>#include <net/netfilter/nf_conntrack.h//a>> 2 33//a>#endif 2 34//a> 2 35//a>struct2/a href="+code=flow_head" class="sref">flow_head//a> { 2 36//a>        struct2/a href="+code=list_head" class="sref">list_head//a>        /a href="+code=filters" class="sref">filters//a>; 2 37//a>}; 2 38//a> 2 39//a>struct2/a href="+code=flow_filter" class="sref">flow_filter//a> { 2 40//a>        struct2/a href="+code=list_head" class="sref">list_head//a>        /a href="+code=list" class="sref">list//a>; 2 41//a>        struct2/a href="+code=tcf_exts" class="sref">tcf_exts//a>        2/a href="+code=exts" class="sref">exts//a>; 2 42//a>        struct2/a href="+code=tcf_ematch_tree" class="sref">tcf_ematch_tree//a>  /a href="+code=ematches" class="sref">ematches//a>; 2 43//a>        struct2/a href="+code=timer_list" class="sref">timer_list//a>       /a href="+code=perturb_timer" class="sref">perturb_timer//a>; 2 44//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=perturb_period" class="sref">perturb_period//a>; 2 45//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=handle" class="sref">handle//a>; 2 46//a> 2 47//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=nkeys" class="sref">nkeys//a>; 2 48//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=keymask" class="sref">keymask//a>; 2 49//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=mode" class="sref">mode//a>; 2 50//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=mask" class="sref">mask//a>; 2 51//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=xor" class="sref">xor//a>; 2 52//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=rshift" class="sref">rshift//a>; 2 53//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=addend" class="sref">addend//a>; 2 54//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=divisor" class="sref">divisor//a>; 2 55//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=baseclass" class="sref">baseclass//a>; 2 56//a>        /a href="+code=u32" class="sref">u32//a>                     /a href="+code=hashrnd" class="sref">hashrnd//a>; 2 57//a>}; 2 58//a> 2 59//a>static const struct2/a href="+code=tcf_ext_map" class="sref">tcf_ext_map//a> /a href="+code=flow_ext_map" class="sref">flow_ext_map//a> = { 2 60//a>        ./a href="+code=ac.142" class="sref">ac.142//a> = /a href="+code=TCA_FLOW_ACT" class="sref">TCA_FLOW_ACT//a>, 2 61//a>        ./a href="+code=police" class="sref">police//a> = /a href="+code=TCA_FLOW_POLICE" class="sref">TCA_FLOW_POLICE//a>, 2 62//a>}; 2 63//a> 2 64//a>static /a href="+code=inline" class="sref">inline//a> /a href="+code=u32" class="sref">u32//a> /a href="+code=addr_fold" class="sref">addr_fold//a>(void */a href="+code=addr" class="sref">addr//a>) 2 65//a>{ 2 66//a>        unsigned long /a href="+code=a" class="sref">a//a> = (unsigned long)/a href="+code=addr" class="sref">addr//a>; 2 67//a> 2 68//a>        return (/a href="+code=a" class="sref">a//a> & 0xFFFFFFFF) ^ (/a href="+code=BITS_PER_LONG" class="sref">BITS_PER_LONG//a> > 32 ? /a href="+code=a" class="sref">a//a> >> 32 : 0); 2 69//a>} 2 70//a> 2 71//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_src" class="sref">flow_get_src//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2 72//a>{ 2 73//a>        if (/a href="+code=flow" class="sref">flow//a>->/a href="+code=src" class="sref">src//a>) 2 74//a>                return /a href="+code=ntohl" class="sref">ntohl//a>(/a href="+code=flow" class="sref">flow//a>->/a href="+code=src" class="sref">src//a>); 2 75//a>        return /a href="+code=addr_fold" class="sref">addr_fold//a>(/a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>); 2 76//a>} 2 77//a> 2 78//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_dst" class="sref">flow_get_dst//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2 79//a>{ 2 80//a>        if (/a href="+code=flow" class="sref">flow//a>->/a href="+code=dst" class="sref">dst//a>) 2 81//a>                return /a href="+code=ntohl" class="sref">ntohl//a>(/a href="+code=flow" class="sref">flow//a>->/a href="+code=dst" class="sref">dst//a>); 2 82//a>        return /a href="+code=addr_fold" class="sref">addr_fold//a>(/a href="+code=skb_dst" class="sref">skb_dst//a>(/a href="+code=skb" class="sref">skb//a>)) ^ (/a href="+code=__force" class="sref">__force//a> /a href="+code=u16" class="sref">u16//a>)/a href="+code=skb" class="sref">skb//a>->/a href="+code=protocol" class="sref">protocol//a>; 2 83//a>} 2 84//a> 2 85//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_proto" class="sref">flow_get_proto//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2 86//a>{ 2 87//a>        return /a href="+code=flow" class="sref">flow//a>->/a href="+code=ip_proto" class="sref">ip_proto//a>; 2 88//a>} 2 89//a> 2 90//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_proto_src" class="sref">flow_get_proto_src//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2 91//a>{ 2 92//a>        if (/a href="+code=flow" class="sref">flow//a>->/a href="+code=ports" class="sref">ports//a>) 2 93//a>                return /a href="+code=ntohs" class="sref">ntohs//a>(/a href="+code=flow" class="sref">flow//a>->/a href="+code=port16" class="sref">port16//a>[0]); 2 94//a> 2 95//a>        return /a href="+code=addr_fold" class="sref">addr_fold//a>(/a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>); 2 96//a>} 2 97//a> 2 98//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_proto_dst" class="sref">flow_get_proto_dst//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2 99//a>{ 2100//a>        if (/a href="+code=flow" class="sref">flow//a>->/a href="+code=ports" class="sref">ports//a>) 2101//a>                return /a href="+code=ntohs" class="sref">ntohs//a>(/a href="+code=flow" class="sref">flow//a>->/a href="+code=port16" class="sref">port16//a>[1]); 2102//a> 2103//a>        return /a href="+code=addr_fold" class="sref">addr_fold//a>(/a href="+code=skb_dst" class="sref">skb_dst//a>(/a href="+code=skb" class="sref">skb//a>)) ^ (/a href="+code=__force" class="sref">__force//a> /a href="+code=u16" class="sref">u16//a>)/a href="+code=skb" class="sref">skb//a>->/a href="+code=protocol" class="sref">protocol//a>; 2104//a>} 2105//a> 2106//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_iif" class="sref">flow_get_iif//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2107//a>{ 2108//a>        return /a href="+code=skb" class="sref">skb//a>->/a href="+code=skb_iif" class="sref">skb_iif//a>; 2109//a>} 2110//a> 2111//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_priority" class="sref">flow_get_priority//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2112//a>{ 2113//a>        return /a href="+code=skb" class="sref">skb//a>->/a href="+code=priority" class="sref">priority//a>; 2114//a>} 2115//a> 2116//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_mark" class="sref">flow_get_mark//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2117//a>{ 2118//a>        return /a href="+code=skb" class="sref">skb//a>->/a href="+code=mark" class="sref">mark//a>; 2119//a>} 2120//a> 2121//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_nfct" class="sref">flow_get_nfct//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2122//a>{ 2123//a>#if2/a href="+code=defined" class="sref">defined//a>(/a href="+code=CONFIG_NF_CONNTRACK" class="sref">CONFIG_NF_CONNTRACK//a>) ||2/a href="+code=defined" class="sref">defined//a>(/a href="+code=CONFIG_NF_CONNTRACK_MODULE" class="sref">CONFIG_NF_CONNTRACK_MODULE//a>) 2124//a>        return /a href="+code=addr_fold" class="sref">addr_fold//a>(/a href="+code=skb" class="sref">skb//a>->/a href="+code=nfct" class="sref">nfct//a>); 2125//a>#else 2126//a>        return 0; 2127//a>#endif 2128//a>} 2129//a> 2130//a>#if2/a href="+code=defined" class="sref">defined//a>(/a href="+code=CONFIG_NF_CONNTRACK" class="sref">CONFIG_NF_CONNTRACK//a>) ||2/a href="+code=defined" class="sref">defined//a>(/a href="+code=CONFIG_NF_CONNTRACK_MODULE" class="sref">CONFIG_NF_CONNTRACK_MODULE//a>) 2131//a>#define2/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=member" class="sref">member//a>)                                            \ 2132//a>({                                                                      \ 2133//a>        enum /a href="+code=ip_conntrack_info" class="sref">ip_conntrack_info//a> /a href="+code=ctinfo" class="sref">ctinfo//a>;                                  \ 2134//a>        const struct2/a href="+code=nf_conn" class="sref">nf_conn//a> */a href="+code=ct" class="sref">ct//a> = /a href="+code=nf_ct_get" class="sref">nf_ct_get//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=ctinfo" class="sref">ctinfo//a>);             \ 2135//a>        if (/a href="+code=ct" class="sref">ct//a> == /a href="+code=NULL" class="sref">NULL//a>)                                                 \ 2136//a>                goto /a href="+code=fallback" class="sref">fallback//a>;                                          \ 2137//a>        /a href="+code=ct" class="sref">ct//a>->/a href="+code=tuplehash" class="sref">tuplehash//a>[/a href="+code=CTINFO2DIR" class="sref">CTINFO2DIR//a>(/a href="+code=ctinfo" class="sref">ctinfo//a>)]./a href="+code=tuple" class="sref">tuple//a>./a href="+code=member" class="sref">member//a>;                 \ 2138//a>}) 2139//a>#else 2140//a>#define2/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=member" class="sref">member//a>)                                            \ 2141//a>({                                                                      \ 2142//a>        goto /a href="+code=fallback" class="sref">fallback//a>;                                                  \ 2143//a>        0;                                                              \ 2144//a>}) 2145//a>#endif 2146//a> 2147//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_nfct_src" class="sref">flow_get_nfct_src//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2148//a>{ 2149//a>        switch (/a href="+code=skb" class="sref">skb//a>->/a href="+code=protocol" class="sref">protocol//a>) { 2150//a>        case2/a href="+code=htons" class="sref">htons//a>(/a href="+code=ETH_P_IP" class="sref">ETH_P_IP//a>): 2151//a>                return /a href="+code=ntohl" class="sref">ntohl//a>(/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=src" class="sref">src//a>./a href="+code=u3" class="sref">u3//a>./a href="+code=ip" class="sref">ip//a>)); 2152//a>        case2/a href="+code=htons" class="sref">htons//a>(/a href="+code=ETH_P_IPV6" class="sref">ETH_P_IPV6//a>): 2153//a>                return /a href="+code=ntohl" class="sref">ntohl//a>(/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=src" class="sref">src//a>./a href="+code=u3" class="sref">u3//a>./a href="+code=ip6" class="sref">ip6//a>[3])); 2154//a>        } 2155//a>/a href="+code=fallback" class="sref">fallback//a>: 2156//a>        return /a href="+code=flow_get_src" class="sref">flow_get_src//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2157//a>} 2158//a> 2159//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_nfct_dst" class="sref">flow_get_nfct_dst//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2160//a>{ 2161//a>        switch (/a href="+code=skb" class="sref">skb//a>->/a href="+code=protocol" class="sref">protocol//a>) { 2162//a>        case2/a href="+code=htons" class="sref">htons//a>(/a href="+code=ETH_P_IP" class="sref">ETH_P_IP//a>): 2163//a>                return /a href="+code=ntohl" class="sref">ntohl//a>(/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=dst" class="sref">dst//a>./a href="+code=u3" class="sref">u3//a>./a href="+code=ip" class="sref">ip//a>)); 2164//a>        case2/a href="+code=htons" class="sref">htons//a>(/a href="+code=ETH_P_IPV6" class="sref">ETH_P_IPV6//a>): 2165//a>                return /a href="+code=ntohl" class="sref">ntohl//a>(/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=dst" class="sref">dst//a>./a href="+code=u3" class="sref">u3//a>./a href="+code=ip6" class="sref">ip6//a>[3])); 2166//a>        } 2167//a>/a href="+code=fallback" class="sref">fallback//a>: 2168//a>        return /a href="+code=flow_get_dst" class="sref">flow_get_dst//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2169//a>} 2170//a> 2171//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_nfct_proto_src" class="sref">flow_get_nfct_proto_src//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2172//a>{ 2173//a>        return /a href="+code=ntohs" class="sref">ntohs//a>(/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=src" class="sref">src//a>./a href="+code=u" class="sref">u//a>./a href="+code=all" class="sref">all//a>)); 2174//a>/a href="+code=fallback" class="sref">fallback//a>: 2175//a>        return /a href="+code=flow_get_proto_src" class="sref">flow_get_proto_src//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2176//a>} 2177//a> 2178//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_nfct_proto_dst" class="sref">flow_get_nfct_proto_dst//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2179//a>{ 2180//a>        return /a href="+code=ntohs" class="sref">ntohs//a>(/a href="+code=CTTUPLE" class="sref">CTTUPLE//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=dst" class="sref">dst//a>./a href="+code=u" class="sref">u//a>./a href="+code=all" class="sref">all//a>)); 2181//a>/a href="+code=fallback" class="sref">fallback//a>: 2182//a>        return /a href="+code=flow_get_proto_dst" class="sref">flow_get_proto_dst//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2183//a>} 2184//a> 2185//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_rtclassid" class="sref">flow_get_rtclassid//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2186//a>{ 2187//a>#ifdef2/a href="+code=CONFIG_IP_ROUTE_CLASSID" class="sref">CONFIG_IP_ROUTE_CLASSID//a> 2188//a>        if (/a href="+code=skb_dst" class="sref">skb_dst//a>(/a href="+code=skb" class="sref">skb//a>)) 2189//a>                return /a href="+code=skb_dst" class="sref">skb_dst//a>(/a href="+code=skb" class="sref">skb//a>)->/a href="+code=tclassid" class="sref">tclassid//a>; 2190//a>#endif 2191//a>        return 0; 2192//a>} 2193//a> 2194//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_skuid" class="sref">flow_get_skuid//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2195//a>{ 2196//a>        if (/a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a> && /a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>->/a href="+code=sk_socket" class="sref">sk_socket//a> && /a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>->/a href="+code=sk_socket" class="sref">sk_socket//a>->/a href="+code=file" class="sref">file//a>) 2197//a>                return /a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>->/a href="+code=sk_socket" class="sref">sk_socket//a>->/a href="+code=file" class="sref">file//a>->/a href="+code=f_cred" class="sref">f_cred//a>->/a href="+code=fsuid" class="sref">fsuid//a>; 2198//a>        return 0; 2199//a>} 2200//a> 2201//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_skgid" class="sref">flow_get_skgid//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2202//a>{ 2203//a>        if (/a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a> && /a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>->/a href="+code=sk_socket" class="sref">sk_socket//a> && /a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>->/a href="+code=sk_socket" class="sref">sk_socket//a>->/a href="+code=file" class="sref">file//a>) 2204//a>                return /a href="+code=skb" class="sref">skb//a>->/a href="+code=sk" class="sref">sk//a>->/a href="+code=sk_socket" class="sref">sk_socket//a>->/a href="+code=file" class="sref">file//a>->/a href="+code=f_cred" class="sref">f_cred//a>->/a href="+code=fsgid" class="sref">fsgid//a>; 2205//a>        return 0; 2206//a>} 2207//a> 2208//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_vlan_tag" class="sref">flow_get_vlan_tag//a>(const struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2209//a>{ 2210//a>        /a href="+code=u16" class="sref">u16//a> /a href="+code=uninitialized_var" class="sref">uninitialized_var//a>(/a href="+code=tag" class="sref">tag//a>); 2211//a> 2212//a>        if (/a href="+code=vlan_get_tag" class="sref">vlan_get_tag//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=tag" class="sref">tag//a>) < 0) 2213//a>                return 0; 2214//a>        return /a href="+code=tag" class="sref">tag//a> & /a href="+code=VLAN_VID_MASK" class="sref">VLAN_VID_MASK//a>; 2215//a>} 2216//a> 2217//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_get_rxhash" class="sref">flow_get_rxhash//a>(struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>) 2218//a>{ 2219//a>        return /a href="+code=skb_get_rxhash" class="sref">skb_get_rxhash//a>(/a href="+code=skb" class="sref">skb//a>); 2220//a>} 2221//a> 2222//a>static /a href="+code=u32" class="sref">u32//a> /a href="+code=flow_key_get" class="sref">flow_key_get//a>(struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, int2/a href="+code=key" class="sref">key//a>, struct2/a href="+code=flow_keys" class="sref">flow_keys//a> */a href="+code=flow" class="sref">flow//a>) 2223//a>{ 2224//a>        switch (/a href="+code=key" class="sref">key//a>) { 2225//a>        case2/a href="+code=FLOW_KEY_SRC" class="sref">FLOW_KEY_SRC//a>: 2226//a>                return /a href="+code=flow_get_src" class="sref">flow_get_src//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2227//a>        case2/a href="+code=FLOW_KEY_DST" class="sref">FLOW_KEY_DST//a>: 2228//a>                return /a href="+code=flow_get_dst" class="sref">flow_get_dst//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2229//a>        case2/a href="+code=FLOW_KEY_PROTO" class="sref">FLOW_KEY_PROTO//a>: 2230//a>                return /a href="+code=flow_get_proto" class="sref">flow_get_proto//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2231//a>        case2/a href="+code=FLOW_KEY_PROTO_SRC" class="sref">FLOW_KEY_PROTO_SRC//a>: 2232//a>                return /a href="+code=flow_get_proto_src" class="sref">flow_get_proto_src//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2233//a>        case2/a href="+code=FLOW_KEY_PROTO_DST" class="sref">FLOW_KEY_PROTO_DST//a>: 2234//a>                return /a href="+code=flow_get_proto_dst" class="sref">flow_get_proto_dst//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2235//a>        case2/a href="+code=FLOW_KEY_IIF" class="sref">FLOW_KEY_IIF//a>: 2236//a>                return /a href="+code=flow_get_iif" class="sref">flow_get_iif//a>(/a href="+code=skb" class="sref">skb//a>); 2237//a>        case2/a href="+code=FLOW_KEY_PRIORITY" class="sref">FLOW_KEY_PRIORITY//a>: 2238//a>                return /a href="+code=flow_get_priority" class="sref">flow_get_priority//a>(/a href="+code=skb" class="sref">skb//a>); 2239//a>        case2/a href="+code=FLOW_KEY_MARK" class="sref">FLOW_KEY_MARK//a>: 2240//a>                return /a href="+code=flow_get_mark" class="sref">flow_get_mark//a>(/a href="+code=skb" class="sref">skb//a>); 2241//a>        case2/a href="+code=FLOW_KEY_NFCT" class="sref">FLOW_KEY_NFCT//a>: 2242//a>                return /a href="+code=flow_get_nfct" class="sref">flow_get_nfct//a>(/a href="+code=skb" class="sref">skb//a>); 2243//a>        case2/a href="+code=FLOW_KEY_NFCT_SRC" class="sref">FLOW_KEY_NFCT_SRC//a>: 2244//a>                return /a href="+code=flow_get_nfct_src" class="sref">flow_get_nfct_src//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2245//a>        case2/a href="+code=FLOW_KEY_NFCT_DST" class="sref">FLOW_KEY_NFCT_DST//a>: 2246//a>                return /a href="+code=flow_get_nfct_dst" class="sref">flow_get_nfct_dst//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2247//a>        case2/a href="+code=FLOW_KEY_NFCT_PROTO_SRC" class="sref">FLOW_KEY_NFCT_PROTO_SRC//a>: 2248//a>                return /a href="+code=flow_get_nfct_proto_src" class="sref">flow_get_nfct_proto_src//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2249//a>        case2/a href="+code=FLOW_KEY_NFCT_PROTO_DST" class="sref">FLOW_KEY_NFCT_PROTO_DST//a>: 2250//a>                return /a href="+code=flow_get_nfct_proto_dst" class="sref">flow_get_nfct_proto_dst//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=flow" class="sref">flow//a>); 2251//a>        case2/a href="+code=FLOW_KEY_RTCLASSID" class="sref">FLOW_KEY_RTCLASSID//a>: 2252//a>                return /a href="+code=flow_get_rtclassid" class="sref">flow_get_rtclassid//a>(/a href="+code=skb" class="sref">skb//a>); 2253//a>        case2/a href="+code=FLOW_KEY_SKUID" class="sref">FLOW_KEY_SKUID//a>: 2254//a>                return /a href="+code=flow_get_skuid" class="sref">flow_get_skuid//a>(/a href="+code=skb" class="sref">skb//a>); 2255//a>        case2/a href="+code=FLOW_KEY_SKGID" class="sref">FLOW_KEY_SKGID//a>: 2256//a>                return /a href="+code=flow_get_skgid" class="sref">flow_get_skgid//a>(/a href="+code=skb" class="sref">skb//a>); 2257//a>        case2/a href="+code=FLOW_KEY_VLAN_TAG" class="sref">FLOW_KEY_VLAN_TAG//a>: 2258//a>                return /a href="+code=flow_get_vlan_tag" class="sref">flow_get_vlan_tag//a>(/a href="+code=skb" class="sref">skb//a>); 2259//a>        case2/a href="+code=FLOW_KEY_RXHASH" class="sref">FLOW_KEY_RXHASH//a>: 2260//a>                return /a href="+code=flow_get_rxhash" class="sref">flow_get_rxhash//a>(/a href="+code=skb" class="sref">skb//a>); 2261//a>        default: 2262//a>                /a href="+code=WARN_ON" class="sref">WARN_ON//a>(1); 2263//a>                return 0; 2264//a>        } 2265//a>} 2266//a> 2267//a>#define2/a href="+code=FLOW_KEYS_NEEDED" class="sref">FLOW_KEYS_NEEDED//a> ((1 << /a href="+code=FLOW_KEY_SRC" class="sref">FLOW_KEY_SRC//a>) |                 \ 2268//a>                          (1 << /a href="+code=FLOW_KEY_DST" class="sref">FLOW_KEY_DST//a>) |                 \ 2269//a>                          (1 << /a href="+code=FLOW_KEY_PROTO" class="sref">FLOW_KEY_PROTO//a>) |               \ 2270//a>                          (1 << /a href="+code=FLOW_KEY_PROTO_SRC" class="sref">FLOW_KEY_PROTO_SRC//a>) |           \ 2271//a>                          (1 << /a href="+code=FLOW_KEY_PROTO_DST" class="sref">FLOW_KEY_PROTO_DST//a>) |           \ 2272//a>                          (1 << /a href="+code=FLOW_KEY_NFCT_SRC" class="sref">FLOW_KEY_NFCT_SRC//a>) |            \ 2273//a>                          (1 << /a href="+code=FLOW_KEY_NFCT_DST" class="sref">FLOW_KEY_NFCT_DST//a>) |            \ 2274//a>                          (1 << /a href="+code=FLOW_KEY_NFCT_PROTO_SRC" class="sref">FLOW_KEY_NFCT_PROTO_SRC//a>) |      \ 2275//a>                          (1 << /a href="+code=FLOW_KEY_NFCT_PROTO_DST" class="sref">FLOW_KEY_NFCT_PROTO_DST//a>)) 2276//a> 2277//a>static int2/a href="+code=flow_classify" class="sref">flow_classify//a>(struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, const struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, 2278//a>                         struct2/a href="+code=tcf_result" class="sref">tcf_result//a> */a href="+code=res" class="sref">res//a>) 2279//a>{ 2280//a>        struct2/a href="+code=flow_head" class="sref">flow_head//a> */a href="+code=head" class="sref">head//a> = /a href="+code=tp" class="sref">tp//a>->/a href="+code=root" class="sref">root//a>; 2281//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a>; 2282//a>        /a href="+code=u32" class="sref">u32//a> /a href="+code=keymask" class="sref">keymask//a>; 2283//a>        /a href="+code=u32" class="sref">u32//a> /a href="+code=classid" class="sref">classid//a>; 2284//a>        unsigned int2/a href="+code=n" class="sref">n//a>, /a href="+code=key" class="sref">key//a>; 2285//a>        int2/a href="+code=r" class="sref">r//a>; 2286//a> 2287//a>        /a href="+code=list_for_each_entry" class="sref">list_for_each_entry//a>(/a href="+code=f" class="sref">f//a>, &/a href="+code=head" class="sref">head//a>->/a href="+code=filters" class="sref">filters//a>, /a href="+code=list" class="sref">list//a>) { 2288//a>                /a href="+code=u32" class="sref">u32//a> /a href="+code=keys" class="sref">keys//a>[/a href="+code=FLOW_KEY_MAX" class="sref">FLOW_KEY_MAX//a> + 1]; 2289//a>                struct2/a href="+code=flow_keys" class="sref">flow_keys//a> /a href="+code=flow_keys" class="sref">flow_keys//a>; 2290//a> 2291//a>                if (!/a href="+code=tcf_em_tree_match" class="sref">tcf_em_tree_match//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=ematches" class="sref">ematches//a>, /a href="+code=NULL" class="sref">NULL//a>)) 2292//a>                        continue; 2293//a> 2294//a>                /a href="+code=keymask" class="sref">keymask//a> = /a href="+code=f" class="sref">f//a>->/a href="+code=keymask" class="sref">keymask//a>; 2295//a>                if (/a href="+code=keymask" class="sref">keymask//a> & /a href="+code=FLOW_KEYS_NEEDED" class="sref">FLOW_KEYS_NEEDED//a>) 2296//a>                        /a href="+code=skb_flow_dissect" class="sref">skb_flow_dissect//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=flow_keys" class="sref">flow_keys//a>); 2297//a> 2298//a>                for (/a href="+code=n" class="sref">n//a> = 0; /a href="+code=n" class="sref">n//a> < /a href="+code=f" class="sref">f//a>->/a href="+code=nkeys" class="sref">nkeys//a>; /a href="+code=n" class="sref">n//a>++) { 2299//a>                        /a href="+code=key" class="sref">key//a> = /a href="+code=ffs" class="sref">ffs//a>(/a href="+code=keymask" class="sref">keymask//a>) - 1; 2300//a>                        /a href="+code=keymask" class="sref">keymask//a> &= ~(1 << /a href="+code=key" class="sref">key//a>); 2301//a>                        /a href="+code=keys" class="sref">keys//a>[/a href="+code=n" class="sref">n//a>] = /a href="+code=flow_key_get" class="sref">flow_key_get//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=key" class="sref">key//a>, &/a href="+code=flow_keys" class="sref">flow_keys//a>); 2302//a>                } 2303//a> 2304//a>                if (/a href="+code=f" class="sref">f//a>->/a href="+code=mode" class="sref">mode//a> == /a href="+code=FLOW_MODE_HASH" class="sref">FLOW_MODE_HASH//a>) 2305//a>                        /a href="+code=classid" class="sref">classid//a> = /a href="+code=jhash2" class="sref">jhash2//a>(/a href="+code=keys" class="sref">keys//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=nkeys" class="sref">nkeys//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=hashrnd" class="sref">hashrnd//a>); 2306//a>                else { 2307//a>                        /a href="+code=classid" class="sref">classid//a> = /a href="+code=keys" class="sref">keys//a>[0]; 2308//a>                        /a href="+code=classid" class="sref">classid//a> = (/a href="+code=classid" class="sref">classid//a> & /a href="+code=f" class="sref">f//a>->/a href="+code=mask" class="sref">mask//a>) ^ /a href="+code=f" class="sref">f//a>->/a href="+code=xor" class="sref">xor//a>; 2309//a>                        /a href="+code=classid" class="sref">classid//a> = (/a href="+code=classid" class="sref">classid//a> >> /a href="+code=f" class="sref">f//a>->/a href="+code=rshift" class="sref">rshift//a>) + /a href="+code=f" class="sref">f//a>->/a href="+code=addend" class="sref">addend//a>; 2310//a>                } 2311//a> 2312//a>                if (/a href="+code=f" class="sref">f//a>->/a href="+code=divisor" class="sref">divisor//a>) 2313//a>                        /a href="+code=classid" class="sref">classid//a> %= /a href="+code=f" class="sref">f//a>->/a href="+code=divisor" class="sref">divisor//a>; 2314//a> 2315//a>                /a href="+code=res" class="sref">res//a>->/a href="+code=class" class="sref">class//a>   = 0; 2316//a>                /a href="+code=res" class="sref">res//a>->/a href="+code=classid" class="sref">classid//a> = /a href="+code=TC_H_MAKE" class="sref">TC_H_MAKE//a>(/a href="+code=f" class="sref">f//a>->/a href="+code=baseclass" class="sref">baseclass//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=baseclass" class="sref">baseclass//a> + /a href="+code=classid" class="sref">classid//a>); 2317//a> 2318//a>                /a href="+code=r" class="sref">r//a> = /a href="+code=tcf_exts_exec" class="sref">tcf_exts_exec//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=exts" class="sref">exts//a>, /a href="+code=res" class="sref">res//a>); 2319//a>                if (/a href="+code=r" class="sref">r//a> < 0) 2320//a>                        continue; 2321//a>                return /a href="+code=r" class="sref">r//a>; 2322//a>        } 2323//a>        return -1; 2324//a>} 2325//a> 2326//a>static void /a href="+code=flow_perturbation" class="sref">flow_perturbation//a>(unsigned long /a href="+code=arg" class="sref">arg//a>) 2327//a>{ 2328//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a> = (struct2/a href="+code=flow_filter" class="sref">flow_filter//a> *)/a href="+code=arg" class="sref">arg//a>; 2329//a> 2330//a>        /a href="+code=get_random_bytes" class="sref">get_random_bytes//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=hashrnd" class="sref">hashrnd//a>, 4); 2331//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_period" class="sref">perturb_period//a>) 2332//a>                /a href="+code=mod_timer" class="sref">mod_timer//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>, /a href="+code=jiffies" class="sref">jiffies//a> + /a href="+code=f" class="sref">f//a>->/a href="+code=perturb_period" class="sref">perturb_period//a>); 2333//a>} 2334//a> 2335//a>static const struct2/a href="+code=nla_policy" class="sref">nla_policy//a> /a href="+code=flow_policy" class="sref">flow_policy//a>[/a href="+code=TCA_FLOW_MAX" class="sref">TCA_FLOW_MAX//a> + 1] = { 2336//a>        [/a href="+code=TCA_FLOW_KEYS" class="sref">TCA_FLOW_KEYS//a>]         = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2337//a>        [/a href="+code=TCA_FLOW_MODE" class="sref">TCA_FLOW_MODE//a>]         = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2338//a>        [/a href="+code=TCA_FLOW_BASECLASS" class="sref">TCA_FLOW_BASECLASS//a>]    = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2339//a>        [/a href="+code=TCA_FLOW_RSHIFT" class="sref">TCA_FLOW_RSHIFT//a>]       = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2340//a>        [/a href="+code=TCA_FLOW_ADDEND" class="sref">TCA_FLOW_ADDEND//a>]       = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2341//a>        [/a href="+code=TCA_FLOW_MASK" class="sref">TCA_FLOW_MASK//a>]         = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2342//a>        [/a href="+code=TCA_FLOW_XOR" class="sref">TCA_FLOW_XOR//a>]          = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2343//a>        [/a href="+code=TCA_FLOW_DIVISOR" class="sref">TCA_FLOW_DIVISOR//a>]      = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2344//a>        [/a href="+code=TCA_FLOW_ACT" class="sref">TCA_FLOW_ACT//a>]          = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_NESTED" class="sref">NLA_NESTED//a> }, 2345//a>        [/a href="+code=TCA_FLOW_POLICE" class="sref">TCA_FLOW_POLICE//a>]       = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_NESTED" class="sref">NLA_NESTED//a> }, 2346//a>        [/a href="+code=TCA_FLOW_EMATCHES" class="sref">TCA_FLOW_EMATCHES//a>]     = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_NESTED" class="sref">NLA_NESTED//a> }, 2347//a>        [/a href="+code=TCA_FLOW_PERTURB" class="sref">TCA_FLOW_PERTURB//a>]      = { ./a href="+code=type" class="sref">type//a> = /a href="+code=NLA_U32" class="sref">NLA_U32//a> }, 2348//a>}; 2349//a> 2350//a>static int2/a href="+code=flow_change" class="sref">flow_change//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, unsigned long /a href="+code=base" class="sref">base//a>, 2351//a>                       /a href="+code=u32" class="sref">u32//a> /a href="+code=handle" class="sref">handle//a>, struct2/a href="+code=nlattr" class="sref">nlattr//a> **/a href="+code=tca" class="sref">tca//a>, 2352//a>                       unsigned long */a href="+code=arg" class="sref">arg//a>) 2353//a>{ 2354//a>        struct2/a href="+code=flow_head" class="sref">flow_head//a> */a href="+code=head" class="sref">head//a> = /a href="+code=tp" class="sref">tp//a>->/a href="+code=root" class="sref">root//a>; 2355//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a>; 2356//a>        struct2/a href="+code=nlattr" class="sref">nlattr//a> */a href="+code=opt" class="sref">opt//a> = /a href="+code=tca" class="sref">tca//a>[/a href="+code=TCA_OPTIONS" class="sref">TCA_OPTIONS//a>]; 2357//a>        struct2/a href="+code=nlattr" class="sref">nlattr//a> */a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MAX" class="sref">TCA_FLOW_MAX//a> + 1]; 2358//a>        struct2/a href="+code=tcf_exts" class="sref">tcf_exts//a> /a href="+code=e" class="sref">e//a>; 2359//a>        struct2/a href="+code=tcf_ematch_tree" class="sref">tcf_ematch_tree//a> /a href="+code=t" class="sref">t//a>; 2360//a>        unsigned int2/a href="+code=nkeys" class="sref">nkeys//a> = 0; 2361//a>        unsigned int2/a href="+code=perturb_period" class="sref">perturb_period//a> = 0; 2362//a>        /a href="+code=u32" class="sref">u32//a> /a href="+code=baseclass" class="sref">baseclass//a> = 0; 2363//a>        /a href="+code=u32" class="sref">u32//a> /a href="+code=keymask" class="sref">keymask//a> = 0; 2364//a>        /a href="+code=u32" class="sref">u32//a> /a href="+code=mode" class="sref">mode//a>; 2365//a>        int2/a href="+code=err" class="sref">err//a>; 2366//a> 2367//a>        if (/a href="+code=opt" class="sref">opt//a> == /a href="+code=NULL" class="sref">NULL//a>) 2368//a>                return -/a href="+code=EINVAL" class="sref">EINVAL//a>; 2369//a> 2370//a>        /a href="+code=err" class="sref">err//a> = /a href="+code=nla_parse_nested" class="sref">nla_parse_nested//a>(/a href="+code=tb" class="sref">tb//a>, /a href="+code=TCA_FLOW_MAX" class="sref">TCA_FLOW_MAX//a>, /a href="+code=opt" class="sref">opt//a>, /a href="+code=flow_policy" class="sref">flow_policy//a>); 2371//a>        if (/a href="+code=err" class="sref">err//a> < 0) 2372//a>                return /a href="+code=err" class="sref">err//a>; 2373//a> 2374//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_BASECLASS" class="sref">TCA_FLOW_BASECLASS//a>]) { 2375//a>                /a href="+code=baseclass" class="sref">baseclass//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_BASECLASS" class="sref">TCA_FLOW_BASECLASS//a>]); 2376//a>                if (/a href="+code=TC_H_MIN" class="sref">TC_H_MIN//a>(/a href="+code=baseclass" class="sref">baseclass//a>) == 0) 2377//a>                        return -/a href="+code=EINVAL" class="sref">EINVAL//a>; 2378//a>        } 2379//a> 2380//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_KEYS" class="sref">TCA_FLOW_KEYS//a>]) { 2381//a>                /a href="+code=keymask" class="sref">keymask//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_KEYS" class="sref">TCA_FLOW_KEYS//a>]); 2382//a> 2383//a>                /a href="+code=nkeys" class="sref">nkeys//a> = /a href="+code=hweight32" class="sref">hweight32//a>(/a href="+code=keymask" class="sref">keymask//a>); 2384//a>                if (/a href="+code=nkeys" class="sref">nkeys//a> == 0) 2385//a>                        return -/a href="+code=EINVAL" class="sref">EINVAL//a>; 2386//a> 2387//a>                if (/a href="+code=fls" class="sref">fls//a>(/a href="+code=keymask" class="sref">keymask//a>) - 1 > /a href="+code=FLOW_KEY_MAX" class="sref">FLOW_KEY_MAX//a>) 2388//a>                        return -/a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP//a>; 2389//a>        } 2390//a> 2391//a>        /a href="+code=err" class="sref">err//a> = /a href="+code=tcf_exts_validate" class="sref">tcf_exts_validate//a>(/a href="+code=tp" class="sref">tp//a>, /a href="+code=tb" class="sref">tb//a>, /a href="+code=tca" class="sref">tca//a>[/a href="+code=TCA_RATE" class="sref">TCA_RATE//a>], &/a href="+code=e" class="sref">e//a>, &/a href="+code=flow_ext_map" class="sref">flow_ext_map//a>); 2392//a>        if (/a href="+code=err" class="sref">err//a> < 0) 2393//a>                return /a href="+code=err" class="sref">err//a>; 2394//a> 2395//a>        /a href="+code=err" class="sref">err//a> = /a href="+code=tcf_em_tree_validate" class="sref">tcf_em_tree_validate//a>(/a href="+code=tp" class="sref">tp//a>, /a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_EMATCHES" class="sref">TCA_FLOW_EMATCHES//a>], &/a href="+code=t" class="sref">t//a>); 2396//a>        if (/a href="+code=err" class="sref">err//a> < 0) 2397//a>                goto /a href="+code=err1" class="sref">err1//a>; 2398//a> 2399//a>        /a href="+code=f" class="sref">f//a> = (struct2/a href="+code=flow_filter" class="sref">flow_filter//a> *)*/a href="+code=arg" class="sref">arg//a>; 2400//a>        if (/a href="+code=f" class="sref">f//a> != /a href="+code=NULL" class="sref">NULL//a>) { 2401//a>                /a href="+code=err" class="sref">err//a> = -/a href="+code=EINVAL" class="sref">EINVAL//a>; 2402//a>                if (/a href="+code=f" class="sref">f//a>->/a href="+code=handle" class="sref">handle//a> != /a href="+code=handle" class="sref">handle//a> && /a href="+code=handle" class="sref">handle//a>) 2403//a>                        goto /a href="+code=err2" class="sref">err2//a>; 2404//a> 2405//a>                /a href="+code=mode" class="sref">mode//a> = /a href="+code=f" class="sref">f//a>->/a href="+code=mode" class="sref">mode//a>; 2406//a>                if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MODE" class="sref">TCA_FLOW_MODE//a>]) 2407//a>                        /a href="+code=mode" class="sref">mode//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MODE" class="sref">TCA_FLOW_MODE//a>]); 2408//a>                if (/a href="+code=mode" class="sref">mode//a> != /a href="+code=FLOW_MODE_HASH" class="sref">FLOW_MODE_HASH//a> && /a href="+code=nkeys" class="sref">nkeys//a> > 1) 2409//a>                        goto /a href="+code=err2" class="sref">err2//a>; 2410//a> 2411//a>                if (/a href="+code=mode" class="sref">mode//a> == /a href="+code=FLOW_MODE_HASH" class="sref">FLOW_MODE_HASH//a>) 2412//a>                        /a href="+code=perturb_period" class="sref">perturb_period//a> = /a href="+code=f" class="sref">f//a>->/a href="+code=perturb_period" class="sref">perturb_period//a>; 2413//a>                if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_PERTURB" class="sref">TCA_FLOW_PERTURB//a>]) { 2414//a>                        if (/a href="+code=mode" class="sref">mode//a> != /a href="+code=FLOW_MODE_HASH" class="sref">FLOW_MODE_HASH//a>) 2415//a>                                goto /a href="+code=err2" class="sref">err2//a>; 2416//a>                        /a href="+code=perturb_period" class="sref">perturb_period//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_PERTURB" class="sref">TCA_FLOW_PERTURB//a>]) * /a href="+code=HZ" class="sref">HZ//a>; 2417//a>                } 2418//a>        } else { 2419//a>                /a href="+code=err" class="sref">err//a> = -/a href="+code=EINVAL" class="sref">EINVAL//a>; 2420//a>                if (!/a href="+code=handle" class="sref">handle//a>) 2421//a>                        goto /a href="+code=err2" class="sref">err2//a>; 2422//a>                if (!/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_KEYS" class="sref">TCA_FLOW_KEYS//a>]) 2423//a>                        goto /a href="+code=err2" class="sref">err2//a>; 2424//a> 2425//a>                /a href="+code=mode" class="sref">mode//a> = /a href="+code=FLOW_MODE_MAP" class="sref">FLOW_MODE_MAP//a>; 2426//a>                if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MODE" class="sref">TCA_FLOW_MODE//a>]) 2427//a>                        /a href="+code=mode" class="sref">mode//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MODE" class="sref">TCA_FLOW_MODE//a>]); 2428//a>                if (/a href="+code=mode" class="sref">mode//a> != /a href="+code=FLOW_MODE_HASH" class="sref">FLOW_MODE_HASH//a> && /a href="+code=nkeys" class="sref">nkeys//a> > 1) 2429//a>                        goto /a href="+code=err2" class="sref">err2//a>; 2430//a> 2431//a>                if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_PERTURB" class="sref">TCA_FLOW_PERTURB//a>]) { 2432//a>                        if (/a href="+code=mode" class="sref">mode//a> != /a href="+code=FLOW_MODE_HASH" class="sref">FLOW_MODE_HASH//a>) 2433//a>                                goto /a href="+code=err2" class="sref">err2//a>; 2434//a>                        /a href="+code=perturb_period" class="sref">perturb_period//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_PERTURB" class="sref">TCA_FLOW_PERTURB//a>]) * /a href="+code=HZ" class="sref">HZ//a>; 2435//a>                } 2436//a> 2437//a>                if (/a href="+code=TC_H_MAJ" class="sref">TC_H_MAJ//a>(/a href="+code=baseclass" class="sref">baseclass//a>) == 0) 2438//a>                        /a href="+code=baseclass" class="sref">baseclass//a> = /a href="+code=TC_H_MAKE" class="sref">TC_H_MAKE//a>(/a href="+code=tp" class="sref">tp//a>->/a href="+code=q" class="sref">q//a>->/a href="+code=handle" class="sref">handle//a>, /a href="+code=baseclass" class="sref">baseclass//a>); 2439//a>                if (/a href="+code=TC_H_MIN" class="sref">TC_H_MIN//a>(/a href="+code=baseclass" class="sref">baseclass//a>) == 0) 2440//a>                        /a href="+code=baseclass" class="sref">baseclass//a> = /a href="+code=TC_H_MAKE" class="sref">TC_H_MAKE//a>(/a href="+code=baseclass" class="sref">baseclass//a>, 1); 2441//a> 2442//a>                /a href="+code=err" class="sref">err//a> = -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>; 2443//a>                /a href="+code=f" class="sref">f//a> = /a href="+code=kzalloc" class="sref">kzalloc//a>(sizeof(*/a href="+code=f" class="sref">f//a>), /a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL//a>); 2444//a>                if (/a href="+code=f" class="sref">f//a> == /a href="+code=NULL" class="sref">NULL//a>) 2445//a>                        goto /a href="+code=err2" class="sref">err2//a>; 2446//a> 2447//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=handle" class="sref">handle//a> = /a href="+code=handle" class="sref">handle//a>; 2448//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=mask" class="sref">mask//a>   = ~0U; 2449//a> 2450//a>                /a href="+code=get_random_bytes" class="sref">get_random_bytes//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=hashrnd" class="sref">hashrnd//a>, 4); 2451//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>./a href="+code=function" class="sref">function//a> = /a href="+code=flow_perturbation" class="sref">flow_perturbation//a>; 2452//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>./a href="+code=data" class="sref">data//a> = (unsigned long)/a href="+code=f" class="sref">f//a>; 2453//a>                /a href="+code=init_timer_deferrable" class="sref">init_timer_deferrable//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>); 2454//a>        } 2455//a> 2456//a>        /a href="+code=tcf_exts_change" class="sref">tcf_exts_change//a>(/a href="+code=tp" class="sref">tp//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=exts" class="sref">exts//a>, &/a href="+code=e" class="sref">e//a>); 2457//a>        /a href="+code=tcf_em_tree_change" class="sref">tcf_em_tree_change//a>(/a href="+code=tp" class="sref">tp//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=ematches" class="sref">ematches//a>, &/a href="+code=t" class="sref">t//a>); 2458//a> 2459//a>        /a href="+code=tcf_tree_lock" class="sref">tcf_tree_lock//a>(/a href="+code=tp" class="sref">tp//a>); 2460//a> 2461//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_KEYS" class="sref">TCA_FLOW_KEYS//a>]) { 2462//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=keymask" class="sref">keymask//a> = /a href="+code=keymask" class="sref">keymask//a>; 2463//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=nkeys" class="sref">nkeys//a>   = /a href="+code=nkeys" class="sref">nkeys//a>; 2464//a>        } 2465//a> 2466//a>        /a href="+code=f" class="sref">f//a>->/a href="+code=mode" class="sref">mode//a> = /a href="+code=mode" class="sref">mode//a>; 2467//a> 2468//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MASK" class="sref">TCA_FLOW_MASK//a>]) 2469//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=mask" class="sref">mask//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_MASK" class="sref">TCA_FLOW_MASK//a>]); 2470//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_XOR" class="sref">TCA_FLOW_XOR//a>]) 2471//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=xor" class="sref">xor//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_XOR" class="sref">TCA_FLOW_XOR//a>]); 2472//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_RSHIFT" class="sref">TCA_FLOW_RSHIFT//a>]) 2473//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=rshift" class="sref">rshift//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_RSHIFT" class="sref">TCA_FLOW_RSHIFT//a>]); 2474//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_ADDEND" class="sref">TCA_FLOW_ADDEND//a>]) 2475//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=addend" class="sref">addend//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_ADDEND" class="sref">TCA_FLOW_ADDEND//a>]); 2476//a> 2477//a>        if (/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_DIVISOR" class="sref">TCA_FLOW_DIVISOR//a>]) 2478//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=divisor" class="sref">divisor//a> = /a href="+code=nla_get_u32" class="sref">nla_get_u32//a>(/a href="+code=tb" class="sref">tb//a>[/a href="+code=TCA_FLOW_DIVISOR" class="sref">TCA_FLOW_DIVISOR//a>]); 2479//a>        if (/a href="+code=baseclass" class="sref">baseclass//a>) 2480//a>                /a href="+code=f" class="sref">f//a>->/a href="+code=baseclass" class="sref">baseclass//a> = /a href="+code=baseclass" class="sref">baseclass//a>; 2481//a> 2482//a>        /a href="+code=f" class="sref">f//a>->/a href="+code=perturb_period" class="sref">perturb_period//a> = /a href="+code=perturb_period" class="sref">perturb_period//a>; 2483//a>        /a href="+code=del_timer" class="sref">del_timer//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>); 2484//a>        if (/a href="+code=perturb_period" class="sref">perturb_period//a>) 2485//a>                /a href="+code=mod_timer" class="sref">mod_timer//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>, /a href="+code=jiffies" class="sref">jiffies//a> + /a href="+code=perturb_period" class="sref">perturb_period//a>); 2486//a> 2487//a>        if (*/a href="+code=arg" class="sref">arg//a> == 0) 2488//a>                /a href="+code=list_add_tail" class="sref">list_add_tail//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=list" class="sref">list//a>, &/a href="+code=head" class="sref">head//a>->/a href="+code=filters" class="sref">filters//a>); 2489//a> 2490//a>        /a href="+code=tcf_tree_unlock" class="sref">tcf_tree_unlock//a>(/a href="+code=tp" class="sref">tp//a>); 2491//a> 2492//a>        */a href="+code=arg" class="sref">arg//a> = (unsigned long)/a href="+code=f" class="sref">f//a>; 2493//a>        return 0; 2494//a> 2495//a>/a href="+code=err2" class="sref">err2//a>: 2496//a>        /a href="+code=tcf_em_tree_destroy" class="sref">tcf_em_tree_destroy//a>(/a href="+code=tp" class="sref">tp//a>, &/a href="+code=t" class="sref">t//a>); 2497//a>/a href="+code=err1" class="sref">err1//a>: 2498//a>        /a href="+code=tcf_exts_destroy" class="sref">tcf_exts_destroy//a>(/a href="+code=tp" class="sref">tp//a>, &/a href="+code=e" class="sref">e//a>); 2499//a>        return /a href="+code=err" class="sref">err//a>; 2500//a>} 2501//a> 2502//a>static void /a href="+code=flow_destroy_filter" class="sref">flow_destroy_filter//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a>) 2503//a>{ 2504//a>        /a href="+code=del_timer_sync" class="sref">del_timer_sync//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_timer" class="sref">perturb_timer//a>); 2505//a>        /a href="+code=tcf_exts_destroy" class="sref">tcf_exts_destroy//a>(/a href="+code=tp" class="sref">tp//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=exts" class="sref">exts//a>); 2506//a>        /a href="+code=tcf_em_tree_destroy" class="sref">tcf_em_tree_destroy//a>(/a href="+code=tp" class="sref">tp//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=ematches" class="sref">ematches//a>); 2507//a>        /a href="+code=kfree" class="sref">kfree//a>(/a href="+code=f" class="sref">f//a>); 2508//a>} 2509//a> 2510//a>static int2/a href="+code=flow_delete" class="sref">flow_delete//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, unsigned long /a href="+code=arg" class="sref">arg//a>) 2511//a>{ 2512//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a> = (struct2/a href="+code=flow_filter" class="sref">flow_filter//a> *)/a href="+code=arg" class="sref">arg//a>; 2513//a> 2514//a>        /a href="+code=tcf_tree_lock" class="sref">tcf_tree_lock//a>(/a href="+code=tp" class="sref">tp//a>); 2515//a>        /a href="+code=list_del" class="sref">list_del//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=list" class="sref">list//a>); 2516//a>        /a href="+code=tcf_tree_unlock" class="sref">tcf_tree_unlock//a>(/a href="+code=tp" class="sref">tp//a>); 2517//a>        /a href="+code=flow_destroy_filter" class="sref">flow_destroy_filter//a>(/a href="+code=tp" class="sref">tp//a>, /a href="+code=f" class="sref">f//a>); 2518//a>        return 0; 2519//a>} 2520//a> 2521//a>static int2/a href="+code=flow_init" class="sref">flow_init//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>) 2522//a>{ 2523//a>        struct2/a href="+code=flow_head" class="sref">flow_head//a> */a href="+code=head" class="sref">head//a>; 2524//a> 2525//a>        /a href="+code=head" class="sref">head//a> = /a href="+code=kzalloc" class="sref">kzalloc//a>(sizeof(*/a href="+code=head" class="sref">head//a>), /a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL//a>); 2526//a>        if (/a href="+code=head" class="sref">head//a> == /a href="+code=NULL" class="sref">NULL//a>) 2527//a>                return -/a href="+code=ENOBUFS" class="sref">ENOBUFS//a>; 2528//a>        /a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD//a>(&/a href="+code=head" class="sref">head//a>->/a href="+code=filters" class="sref">filters//a>); 2529//a>        /a href="+code=tp" class="sref">tp//a>->/a href="+code=root" class="sref">root//a> = /a href="+code=head" class="sref">head//a>; 2530//a>        return 0; 2531//a>} 2532//a> 2533//a>static void /a href="+code=flow_destroy" class="sref">flow_destroy//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>) 2534//a>{ 2535//a>        struct2/a href="+code=flow_head" class="sref">flow_head//a> */a href="+code=head" class="sref">head//a> = /a href="+code=tp" class="sref">tp//a>->/a href="+code=root" class="sref">root//a>; 2536//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a>, */a href="+code=next" class="sref">next//a>; 2537//a> 2538//a>        /a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe//a>(/a href="+code=f" class="sref">f//a>, /a href="+code=next" class="sref">next//a>, &/a href="+code=head" class="sref">head//a>->/a href="+code=filters" class="sref">filters//a>, /a href="+code=list" class="sref">list//a>) { 2539//a>                /a href="+code=list_del" class="sref">list_del//a>(&/a href="+code=f" class="sref">f//a>->/a href="+code=list" class="sref">list//a>); 2540//a>                /a href="+code=flow_destroy_filter" class="sref">flow_destroy_filter//a>(/a href="+code=tp" class="sref">tp//a>, /a href="+code=f" class="sref">f//a>); 2541//a>        } 2542//a>        /a href="+code=kfree" class="sref">kfree//a>(/a href="+code=head" class="sref">head//a>); 2543//a>} 2544//a> 2545//a>static unsigned long /a href="+code=flow_get" class="sref">flow_get//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, /a href="+code=u32" class="sref">u32//a> /a href="+code=handle" class="sref">handle//a>) 2546//a>{ 2547//a>        struct2/a href="+code=flow_head" class="sref">flow_head//a> */a href="+code=head" class="sref">head//a> = /a href="+code=tp" class="sref">tp//a>->/a href="+code=root" class="sref">root//a>; 2548//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a>; 2549//a> 2550//a>        /a href="+code=list_for_each_entry" class="sref">list_for_each_entry//a>(/a href="+code=f" class="sref">f//a>, &/a href="+code=head" class="sref">head//a>->/a href="+code=filters" class="sref">filters//a>, /a href="+code=list" class="sref">list//a>) 2551//a>                if (/a href="+code=f" class="sref">f//a>->/a href="+code=handle" class="sref">handle//a> == /a href="+code=handle" class="sref">handle//a>) 2552//a>                        return (unsigned long)/a href="+code=f" class="sref">f//a>; 2553//a>        return 0; 2554//a>} 2555//a> 2556//a>static void /a href="+code=flow_put" class="sref">flow_put//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, unsigned long /a href="+code=f" class="sref">f//a>) 2557//a>{ 2558//a>} 2559//a> 2560//a>static int2/a href="+code=flow_dump" class="sref">flow_dump//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, unsigned long /a href="+code=fh" class="sref">fh//a>, 2561//a>                     struct2/a href="+code=sk_buff" class="sref">sk_buff//a> */a href="+code=skb" class="sref">skb//a>, struct2/a href="+code=tcmsg" class="sref">tcmsg//a> */a href="+code=t" class="sref">t//a>) 2562//a>{ 2563//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a> = (struct2/a href="+code=flow_filter" class="sref">flow_filter//a> *)/a href="+code=fh" class="sref">fh//a>; 2564//a>        struct2/a href="+code=nlattr" class="sref">nlattr//a> */a href="+code=nest" class="sref">nest//a>; 2565//a> 2566//a>        if (/a href="+code=f" class="sref">f//a> == /a href="+code=NULL" class="sref">NULL//a>) 2567//a>                return /a href="+code=skb" class="sref">skb//a>->/a href="+code=len" class="sref">len//a>; 2568//a> 2569//a>        /a href="+code=t" class="sref">t//a>->/a href="+code=tcm_handle" class="sref">tcm_handle//a> = /a href="+code=f" class="sref">f//a>->/a href="+code=handle" class="sref">handle//a>; 2570//a> 2571//a>        /a href="+code=nest" class="sref">nest//a> = /a href="+code=nla_nest_start" class="sref">nla_nest_start//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_OPTIONS" class="sref">TCA_OPTIONS//a>); 2572//a>        if (/a href="+code=nest" class="sref">nest//a> == /a href="+code=NULL" class="sref">NULL//a>) 2573//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2574//a> 2575//a>        if (/a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_KEYS" class="sref">TCA_FLOW_KEYS//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=keymask" class="sref">keymask//a>) || 2576//a>            /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_MODE" class="sref">TCA_FLOW_MODE//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=mode" class="sref">mode//a>)) 2577//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2578//a> 2579//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=mask" class="sref">mask//a> != ~0 || /a href="+code=f" class="sref">f//a>->/a href="+code=xor" class="sref">xor//a> != 0) { 2580//a>                if (/a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_MASK" class="sref">TCA_FLOW_MASK//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=mask" class="sref">mask//a>) || 2581//a>                    /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_XOR" class="sref">TCA_FLOW_XOR//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=xor" class="sref">xor//a>)) 2582//a>                        goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2583//a>        } 2584//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=rshift" class="sref">rshift//a> && 2585//a>            /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_RSHIFT" class="sref">TCA_FLOW_RSHIFT//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=rshift" class="sref">rshift//a>)) 2586//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2587//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=addend" class="sref">addend//a> && 2588//a>            /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_ADDEND" class="sref">TCA_FLOW_ADDEND//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=addend" class="sref">addend//a>)) 2589//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2590//a> 2591//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=divisor" class="sref">divisor//a> && 2592//a>            /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_DIVISOR" class="sref">TCA_FLOW_DIVISOR//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=divisor" class="sref">divisor//a>)) 2593//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2594//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=baseclass" class="sref">baseclass//a> && 2595//a>            /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_BASECLASS" class="sref">TCA_FLOW_BASECLASS//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=baseclass" class="sref">baseclass//a>)) 2596//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2597//a> 2598//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=perturb_period" class="sref">perturb_period//a> && 2599//a>            /a href="+code=nla_put_u32" class="sref">nla_put_u32//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=TCA_FLOW_PERTURB" class="sref">TCA_FLOW_PERTURB//a>, /a href="+code=f" class="sref">f//a>->/a href="+code=perturb_period" class="sref">perturb_period//a> / /a href="+code=HZ" class="sref">HZ//a>)) 2600//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2601//a> 2602//a>        if (/a href="+code=tcf_exts_dump" class="sref">tcf_exts_dump//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=exts" class="sref">exts//a>, &/a href="+code=flow_ext_map" class="sref">flow_ext_map//a>) < 0) 2603//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2604//a>#ifdef /a href="+code=CONFIG_NET_EMATCH" class="sref">CONFIG_NET_EMATCH//a> 2605//a>        if (/a href="+code=f" class="sref">f//a>->/a href="+code=ematches" class="sref">ematches//a>./a href="+code=hdr" class="sref">hdr//a>./a href="+code=nmatches" class="sref">nmatches//a> && 2606//a>            /a href="+code=tcf_em_tree_dump" class="sref">tcf_em_tree_dump//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=ematches" class="sref">ematches//a>, /a href="+code=TCA_FLOW_EMATCHES" class="sref">TCA_FLOW_EMATCHES//a>) < 0) 2607//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2608//a>#endif 2609//a>        /a href="+code=nla_nest_end" class="sref">nla_nest_end//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=nest" class="sref">nest//a>); 2610//a> 2611//a>        if (/a href="+code=tcf_exts_dump_stats" class="sref">tcf_exts_dump_stats//a>(/a href="+code=skb" class="sref">skb//a>, &/a href="+code=f" class="sref">f//a>->/a href="+code=exts" class="sref">exts//a>, &/a href="+code=flow_ext_map" class="sref">flow_ext_map//a>) < 0) 2612//a>                goto /a href="+code=nla_put_failure" class="sref">nla_put_failure//a>; 2613//a> 2614//a>        return /a href="+code=skb" class="sref">skb//a>->/a href="+code=len" class="sref">len//a>; 2615//a> 2616//a>/a href="+code=nla_put_failure" class="sref">nla_put_failure//a>: 2617//a>        /a href="+code=nlmsg_trim" class="sref">nlmsg_trim//a>(/a href="+code=skb" class="sref">skb//a>, /a href="+code=nest" class="sref">nest//a>); 2618//a>        return -1; 2619//a>} 2620//a> 2621//a>static void /a href="+code=flow_walk" class="sref">flow_walk//a>(struct2/a href="+code=tcf_proto" class="sref">tcf_proto//a> */a href="+code=tp" class="sref">tp//a>, struct2/a href="+code=tcf_walker" class="sref">tcf_walker//a> */a href="+code=arg" class="sref">arg//a>) 2622//a>{ 2623//a>        struct2/a href="+code=flow_head" class="sref">flow_head//a> */a href="+code=head" class="sref">head//a> = /a href="+code=tp" class="sref">tp//a>->/a href="+code=root" class="sref">root//a>; 2624//a>        struct2/a href="+code=flow_filter" class="sref">flow_filter//a> */a href="+code=f" class="sref">f//a>; 2625//a> 2626//a>        /a href="+code=list_for_each_entry" class="sref">list_for_each_entry//a>(/a href="+code=f" class="sref">f//a>, &/a href="+code=head" class="sref">head//a>->/a href="+code=filters" class="sref">filters//a>, /a href="+code=list" class="sref">list//a>) { 2627//a>                if (/a href="+code=arg" class="sref">arg//a>->/a href="+code=count" class="sref">count//a> < /a href="+code=arg" class="sref">arg//a>->/a href="+code=skip" class="sref">skip//a>) 2628//a>                        goto /a href="+code=skip" class="sref">skip//a>; 2629//a>                if (/a href="+code=arg" class="sref">arg//a>->/a href="+code=fn" class="sref">fn//a>(/a href="+code=tp" class="sref">tp//a>, (unsigned long)/a href="+code=f" class="sref">f//a>, /a href="+code=arg" class="sref">arg//a>) < 0) { 2630//a>                        /a href="+code=arg" class="sref">arg//a>->/a href="+code=stop" class="sref">stop//a> = 1; 2631//a>                        break; 2632//a>                } 2633//a>/a href="+code=skip" class="sref">skip//a>: 2634//a>                /a href="+code=arg" class="sref">arg//a>->/a href="+code=count" class="sref">count//a>++; 2635//a>        } 2636//a>} 2637//a> 2638//a>static struct2/a href="+code=tcf_proto_ops" class="sref">tcf_proto_ops//a> /a href="+code=cls_flow_ops" class="sref">cls_flow_ops//a> /a href="+code=__read_mostly" class="sref">__read_mostly//a> = { 2639//a>        ./a href="+code=kind" class="sref">kind//a>           = /span class="string">"flow", 2640//a>        ./a href="+code=classify" class="sref">classify//a>       = /a href="+code=flow_classify" class="sref">flow_classify//a>, 2641//a>        ./a href="+code=init" class="sref">init//a>           = /a href="+code=flow_init" class="sref">flow_init//a>, 2642//a>        ./a href="+code=destroy" class="sref">destroy//a>        = /a href="+code=flow_destroy" class="sref">flow_destroy//a>, 2643//a>        ./a href="+code=change" class="sref">change//a>         = /a href="+code=flow_change" class="sref">flow_change//a>, 2644//a>        ./a href="+code=delete" class="sref">delete//a>         = /a href="+code=flow_delete" class="sref">flow_delete//a>, 2645//a>        ./a href="+code=get" class="sref">get//a>            = /a href="+code=flow_get" class="sref">flow_get//a>, 2646//a>        ./a href="+code=put" class="sref">put//a>            = /a href="+code=flow_put" class="sref">flow_put//a>, 2647//a>        ./a href="+code=dump" class="sref">dump//a>           = /a href="+code=flow_dump" class="sref">flow_dump//a>, 2648//a>        ./a href="+code=walk" class="sref">walk//a>           = /a href="+code=flow_walk" class="sref">flow_walk//a>, 2649//a>        ./a href="+code=owner" class="sref">owner//a>          = /a href="+code=THIS_MODULE" class="sref">THIS_MODULE//a>, 2650//a>}; 2651//a> 2652//a>static int2/a href="+code=__init" class="sref">__init//a> /a href="+code=cls_flow_init" class="sref">cls_flow_init//a>(void) 2653//a>{ 2654//a>        return /a href="+code=register_tcf_proto_ops" class="sref">register_tcf_proto_ops//a>(&/a href="+code=cls_flow_ops" class="sref">cls_flow_ops//a>); 2655//a>} 2656//a> 2657//a>static void /a href="+code=__exit" class="sref">__exit//a> /a href="+code=cls_flow_exit" class="sref">cls_flow_exit//a>(void) 2658//a>{ 2659//a>        /a href="+code=unregister_tcf_proto_ops" class="sref">unregister_tcf_proto_ops//a>(&/a href="+code=cls_flow_ops" class="sref">cls_flow_ops//a>); 2660//a>} 2661//a> 2662//a>/a href="+code=module_init" class="sref">module_init//a>(/a href="+code=cls_flow_init" class="sref">cls_flow_init//a>); 2663//a>/a href="+code=module_exit" class="sref">module_exit//a>(/a href="+code=cls_flow_exit" class="sref">cls_flow_exit//a>); 2664//a> 2665//a>/a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE//a>(/span class="string">"GPL"); 2666//a>/a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR//a>(/span class="string">"Patrick McHardy <kaber@trash.net>"); 2667//a>/a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION//a>(/span class="string">"TC flow classifier"); 2668//a>
lxr.linux.no kindly hosted by Redpill Linpro AS//a>, provider of Linux consulting and operations services since 1995.