linux/crypto/af_alg.c
<<
> > p/spa pspa class="lxr_search"> > ="+search" method="post" onsubmit="return do_search(this);"> > > > Search > p/spa > ="ajax+*" method="post" onsubmit="return false;"> pinput typ"v4hidden" nam"v4ajax_lookup" idv4ajax_lookup" lue="v4"> >
pdiv idv4file_contents"
o o1p/a>pspa
 class="comment">/*p/spa
  o o2p/a>pspa
 class="comment"> * af_alg: User-space algorithm interfacep/spa
  o o3p/a>pspa
 class="comment"> *p/spa
  o o4p/a>pspa
 class="comment"> * This file provides the user-space API for algorithms.p/spa
  o o5p/a>pspa
 class="comment"> *p/spa
  o o6p/a>pspa
 class="comment"> * Copyright (c) 2010 Herbert Xu <herbert@gondor.apa
a.org.au>p/spa
  o o7p/a>pspa
 class="comment"> *p/spa
  o o8p/a>pspa
 class="comment"> * This program is free software; you ca
 redistribute it and/or modify itp/spa
  o o9p/a>pspa
 class="comment"> * under the terms of the GNU General Public License as published by the Freep/spa
  o pspa
 class="comment"> * Software Foundaon>
; either versn va2 of the License, or (at your tion>
)p/spa
  o 11p/a>pspa
 class="comment"> * any later versn v.p/spa
  o 12p/a>pspa
 class="comment"> *p/spa
  o 13p/a>pspa
 class="comment"> */p/spa
  o 14p/a> o 15p/a>#include <linux/at mic.hp/a>> o 16p/a>#include <crypto/if_alg.hp/a>> o 17p/a>#include <linux/crypto.hp/a>> o 18p/a>#include <linux/init.hp/a>> o 19p/a>#include <linux/kernel.hp/a>> o 20p/a>#include <linux/list.hp/a>> o 21p/a>#include <linux/module.hp/a>> o 22p/a>#include <linux/net.hp/a>> o 23p/a>#include <linux/rwsem.hp/a>> o 24p/a> o 25p/a>structopa href="+code=alg_typ"_list" class="sref">alg_typ"_listp/a> { o 26p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_alg_typ"p/a> *pa href="+code=typ"" class="sref">typ"p/a>; o 27p/a>        structopa href="+code=list_head" class="sref">list_headp/a> pa href="+code=list" class="sref">listp/a>; o 28p/a>}; o 29p/a> o 30p/a>staticopa href="+code=at mic_long_t" class="sref">at mic_long_tp/a> pa href="+code=alg_memory_allocated" class="sref">alg_memory_allocatedp/a>; o 31p/a> o 32p/a>staticostructopa href="+code=proto" class="sref">protop/a> pa href="+code=alg_proto" class="sref">alg_protop/a> = { o 33p/a>        .pa href="+code=nam"" class="sref">nam"p/a>                   = pspa
 class="string">"ALG"p/spa
 , o 34p/a>        .pa href="+code=owner" class="sref">ownerp/a>                  = pa href="+code=THIS_MODULE" class="sref">THIS_MODULEp/a>, o 35p/a>        .pa href="+code=memory_allocated" class="sref">memory_allocatedp/a>       = &pa href="+code=alg_memory_allocated" class="sref">alg_memory_allocatedp/a>, o 36p/a>        .pa href="+code=obj_siz"" class="sref">obj_siz"p/a>               = siz"of(structopa href="+code=alg_sock" class="sref">alg_sockp/a>), o 37p/a>}; o 38p/a> o 39p/a>staticopa href="+code=LIST_HEAD" class="sref">LIST_HEADp/a>(pa href="+code=alg_typ"s" class="sref">alg_typ"sp/a>); o 40p/a>staticopa href="+code=DECLARE_RWSEM" class="sref">DECLARE_RWSEMp/a>(pa href="+code=alg_typ"s_sem" class="sref">alg_typ"s_semp/a>); o 41p/a> o 42p/a>staticoconst structopa href="+code=af_alg_typ"" class="sref">af_alg_typ"p/a> *pa href="+code=alg_get_typ"" class="sref">alg_get_typ"p/a>(const char *pa href="+code=nam"" class="sref">nam"p/a>) o 43p/a>{ o 44p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_alg_typ"p/a> *pa href="+code=typ"" class="sref">typ"p/a> = pa href="+code=ERR_PTR" class="sref">ERR_PTRp/a>(-pa href="+code=ENOENT" class="sref">ENOENTp/a>); o 45p/a>        structopa href="+code=alg_typ"_list" class="sref">alg_typ"_listp/a> *pa href="+code=node" class="sref">nodep/a>; o 46p/a> o 47p/a>        pa href="+code=down_read" class="sref">down_readp/a>(&pa href="+code=alg_typ"s_sem" class="sref">alg_typ"s_semp/a>); o 48p/a>        pa href="+code=list_for_each_entry" class="sref">list_for_each_entryp/a>(pa href="+code=node" class="sref">nodep/a>, &pa href="+code=alg_typ"s" class="sref">alg_typ"sp/a>, pa href="+code=list" class="sref">listp/a>) { o 49p/a>                if (pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=node" class="sref">nodep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa href="+code=nam"" class="sref">nam"p/a>, pa href="+code=nam"" class="sref">nam"p/a>)) o 50p/a>                        continue; o 51p/a> o 52p/a>                if (pa href="+code=try_module_get" class="sref">try_module_getp/a>(pa href="+code=node" class="sref">nodep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa href="+code=owner" class="sref">ownerp/a>)) o 53p/a>                        pa href="+code=typ"" class="sref">typ"p/a> = pa href="+code=node" class="sref">nodep/a>->pa href="+code=typ"" class="sref">typ"p/a>; o 54p/a>                break; o 55p/a>        } o 6ip/a>        pa href="+code=mpo 49p/a>                if (pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=node" class="sref">nodep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa hr"+code=node" class="sref">nodep/a>->pa href="+code=typ"" class="sref">t"p/a>->pa href="+code=owne6" class=6sref">listp/a>) {                lnl/a>_typ"_listp/a> *pa href="+code=n7"" class7"sref">nam"p/a>)) o 51p/a> alg_typ)yp"p/a>->pa hrGFP_KERNELt" class="sref"GFP_KERNELo/af_alg.c#L20" idv4L20" class='c7" class=7sref">ownerp/a>)) o 40oNOM" _typ"_listp/a> *pa href="+code=n7p"" clas7="sref">typ"p/a>; alg_typ)_listp/a> *pa href="+code=n7p/a>    7           break;                lnl/a>_typ"_listp/a> *pa href="+code=n7
 class=7"comment"> *p/spa
  nodep/a>->pa href="pe" class="sref">"pef">nodep/a>->pa href="+code=typ"" class="sref">typ="+code=owner" class="sref">ownerp/a>                  = pa"_listp/a> *pa href="+code=n7"sref">a7g_typ"s_semp/a>); strcmpp/a>(pa href="+code=node" class="sref">n="+code=owner" cla"+code=node" class="sref">nodep/a>->pa href="+code=t7" class=7sref">listp/a>) { o 27p/a>     ad"a>        pa href="+code="+code=strcmp" class="sref">strcmpp/a>(pa href=alg_typ"s" class="sref">algh_entryp/a>(pa href="+code=node" class="sref">nodep/a>, &am_alg.c#L20" idv4L20" class='c8"" class8"sref">nam"p/a>)) typ"p/a>;     8           break;  *p/spa
  listp/a>) { o 44p/a>        const sunregef"er44">opa href="+cdv4L44" class="line" nam"v4L44">o 44p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_alp/a>->pa href="+code=owne9"" class9"sref">nam"p/a>)) o 45p/a>        structopa href="+code=alg_typ"_list" class="sref">alg_typ"_listp/a> *pa href="+code=n9"line" n9m"v4L51">o 51p/a> ERR_P"_listp/a> *pa href="+code=n9" class=9sref">ownerp/a>)) typ"p/a>;         pa href="+code=mp */p/spa
          pa href="+code=mplinux0/crypto.hp/a>> o 44p/a>        const sunregef"er44">opa h_alg.c#L20" idv4L20" class='c10fref">lin0ux/init.hp/a>>         cne"dosreleasopa href="+cdv4L44" class="line" nam"v4L44">o 44p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_al,cvoiddhref="+code=af_aprivatst" class="sref"privatsf_alp/a>->pa href="+code=owne1 or (at youur tion>
)p/spa
  , pa href="+code=lis1* any lateer versn v.p/spa
  af_alp/a>->pa href="+code=owne1
 class="ccomment"> *p/spa
  
linuxx/at mic.hp/a>> nodep/a>->pa href="+code=typ"" class="sref">typ"alg.c#L20" idv4L20" class='c1 f">cryptoo/if_alg.hp/a>> linuxx/crypto.hp/a>> linnux/init.hp/a>>         cm"v4L4releaso     ev4L44" class="line" nz"of 52p/a>          z"of 5topa href="+code=af_ap/a>               z"of(strup/a>pspa
 class="comment"> * blished bx/kernel.hp/a>> li1nux/list.hp/a>>                z"of(strodep/a>->pa href=s>               zf(strup/a>pspa
 class="comment"> *  any laterr versn v.p/spa
                 z"of(strodep/a>->pa href=s>               zf(strualg.c#L20" idv4L20" class='c1="fref">l1inux/net.hp/a>> linuxlg_typ"_listp/a> { typ"p/a>;        = &bine     ev4L44" class="line" nz"of 52p/a>          z"of 5topa href="+code=af_ap/a>               z"of(str,cdv4L44" class="line" nz"ofaddde=typ"" class="z"ofadddtopa href="+code=af_auaddde=typ"" class="uadddtopa,cin4" class="line" naddd_lod="/a>       = &addd_lod(strup/a>pspa
 class="comment"> * ef">linuxs="sref">listp/a>; lin"v4L28">o 28p/a>};                z"of(strodep/a>->pa href=s>               zf(stralg.c#L20" idv4L20" class='c1="line" n1am"v4L29">o 29p/a>                = siz"of(str href="+code=af_als>               azf(str="+code=owner" cla= siz>               = sizkpa hrref="+code=af_ap>               zf(strualg.c#L20" idv4L20" class='c1">alg_mem1ory_allocatedp/a>; o 41p/a> ENOENTp/a>); n)_entryentry+code=owner" claPTR_ERde=typ"" class="PTR_ERdpa hrref="+code=af_a"+code=node" class="sref">n)_=  a> = pa href="+code=ERR_PTR" class="sref">ERR_P_typ"sp/a>, pa href="+code=lis1ode" clas1s="sref">nodep/a>; naodeif-%s/a>           #ref="+code=af_apae=typ"" class="za(strodep/a>->pa href=sv4L26">o 26p/a>        sst structopa)alg.c#L20" idv4L20" class='c1=p"" clas1am"v4L46">o 46p/a> n="+code=owner" claag_typ"" class="sref">af_alg_typ"p/a> *pa hrref="+code=af_apae=typ"" class="za(strodep/a>->pa href=sv4L26">o 26p/a>        sst structopa)alg.c#L20" idv4L20" class='c1=ine" nam1lg_typ"s_semp/a>); listp/a>) { nam"p/a>)) n)p/a>->pa href="+code=owne1         1         continue; 
 = pa href=PTR_ERde=typ"" class="PTR_ERdpa hrref="+code=af_a"+code=node" class="sref">n)alg.c#L20" idv4L20" class='c1="line" n1am"v4L51">o 51p/a> typ"p/a>; , pa href="+code=lis14p/a>    1            break; nodep/a>->pa href="+code=typ"" class="sref">typ"alg.c#L20" idv4L20" class='c1am"v4L55"1>o 55p/a>        } nam"p/a>)) o 49p/a>   wa4 href="+code=DECLARE_s>               azf(str>strcmpp/a>(pa href="+code=node" class="sref">nyp"p/a>->pa hr"+code=node" class="sref">nualg.c#L20" idv4L20" class='c16"line" n16m"v4L51">o 51p/a> o 49p/a>   wa4 href="+code=DECLARE_s>               azf(str>strcmpp/a>(pa href=privatst" class="sref"privatsf_alyp"p/a>->pa hrprivatst" class="sref"privatsf_alpalg.c#L20" idv4L20" class='c16" class=16sref">ownerp/a>)) typ"p/a>;                releasopp/a>pa hrref="+code=af_ap>               zf(strualg.c#L20" idv4L20" class='c16p/a>    16           break; linux//at mic.hp/a>>         cne"dosreleasopa hrmpp/a>(pa href="+code=node" class="sref">nyp"p/a>->pa hrprivatst" class="sref"privatsf_alpalg.c#L20" idv4L20" class='c16L39" idv16comment"> * This file p16f="c167to/af_alg.c#L51" idv4L51" class16"sref">a16g_typ"s_semp/a>);     17           break; o 44p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_alg_typ"p/a> *pa hre_s>               azf(str>strcmpp/a>(pa href="+code=node" class="sref">nalg.c#L20" idv4L20" class='c17ef">linux7"comment"> *p/spa
  o 48p/a>   u8topa href="+code=af_akeL48">o 48p/a>   keLpa halg.c#L20" idv4L20" class='c17f">crypto//if_alg.hp/a>> nam"p/a>)) o 48p/a>   keLpa hup/a>pspa
 class="comment"> *8        18        continue; 
 = pa href="+coNOM" nam"v4L40">o 40oNOM" _typ"_listp/a> *pa href="+code=n18"line" n18m"v4L51">o 51p/a> ownerp/a>)) typ"p/a>;     19           break; op45">o 45p/a>        setp/a>op4pa hrdv4L44" class="line" nz"of 52p/a>          z"of 5topa href="+code=af_ap/a>               z"of(str,cin4" class="line" nlevel48">o 48p/a>    evel(str,cin4" class="line" nop4"+code=typ"" class=op4"+copa hctopa href="+code=alg_sock" 19
 class=19"comment"> *p/spa
  o 48p/a>   op4val(str,cunsignedcin4" class="line" nop4lod="/a>       = &op4lodpa hup/a>pspa
 class="comment"> *9dor.apa
19a.org.au>p/spa
   *p/spa
                 z"of(strodep/a>->pa href=s>               zf(stralg.c#L20" idv4L20" class='c19 it and/1oor modify itp/spa
                 = siz"of(str href="+code=af_als>               azf(str="+code=owner" cla= siz>               = sizkpa hrref="+code=af_ap>               zf(strualg.c#L20" idv4L20" class='c20blished 2yy the Freep/spa
  o 26p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_alg_typ"p/a> *pa href="+code=t20or (at y20ur tion>
)p/spa
   *pa href="+code=t20ef">linux0r versn v.p/spa
   */p/spa
  af_alg_typ"p/a> *pa hre_s>               azf(str>strcmpp/a>(pa href="+code=node" class="sref">nalg.c#L20" idv4L20" class='c205lass="c20           break; linu20/at mic.hp/a>> o 48p/a>    evel(str !odref="+code=af_aSOL_ALG48">o 48p/a>   SOL_ALG(str || !" class="line" lg_typ"" class="sref">af_alp/a>->pa href="+code=owne20f">crypt20/if_alg.hp/a>>                lnl/a>_typ"_listp/a> *pa href="+code=n20ef">linu20/crypto.hp/a>> li20ux/init.hp/a>> , pa href="+code=lis2ublished 2by the Freep/spa
  li:f_alg.c#L51" idv4L51" class2 or (at y2uur tion>
)p/spa
  ->pa href=statst" class="sref"stats(str=""+code=owner" claSS_CONNECTEine" nam"v4L39">SS_CONNECTEi(strup/a>pspa
 class="comment"> 2* any lat2er versn v.p/spa
                 lnl/a>_typ"_listp/a> *pa href="+code=n2
 class="2comment"> *p/spa
  af_alodep/a>->pa href=setkeL48">o 48p/a>   setkeLpa hup/a>pspa
 class="comment"> 2*class="c2omment"> */p/spa
                 lnl/a>_typ"_listp/a> *pa href="+code=n2
5lass="c2am"v4L14">o 14p/a> linu2x/at mic.hp/a>> o 48p/a>   a4L4setkeLpa hrref="+code=af_ap>               zf(stryp"p/a>->pa hrop4val48">o 48p/a>   op4val(str,c class="line" nop4lod="/a>       = &op4lodpa hu"_listp/a> *pa href="+code=n2
f">crypt2o/if_alg.hp/a>> linu2x/crypto.hp/a>> li2nux/init.hp/a>>                lnl/a>_typ:f_alg.c#L51" idv4L51" class2 blished 2x/kernel.hp/a>>                releasopp/a>pa hrref="+code=af_ap>               zf(strualg.c#L20" idv4L20" class='c2"fref">li2nux/list.hp/a>> linu2s="sref">listp/a>; o 26p/a>        const structopa href="+code=af_alg_typ"" class="sref">af_alg_typ"p/a> *pa href="+code=t2"fref">li2"v4L28">o 28p/a>};  *pa href="+code=t2="line" n2am"v4L29">o 29p/a>  *p/spa
  af_alg_typ"p/a> *pa hre_s>               azf(str>strcmpp/a>(pa href="+code=node" class="sref">nalg.c#L20" idv4L20" class='c23ref">lin2;ALG"p/spa
 , THIS_MODULEp/a>,  *pa href="+code=t2">alg_mem2ory_allocatedp/a>, af_alp/a>->pa href="+code=owne23p"" clas2ef">alg_sockp/a>),                lnl/a>_typ"_listp/a> *pa href="+code=n2line" nam2"v4L37">o 37p/a>}; o 38p/a> 2               zf2f_al="+code=owner" clapk_="+code=strcmp" claspk_="+copa hrref="+code=af_ap/a>pn 52p/a>          z"ofpn 5pa hrref="+code=af_ap>               zf(stru,c class="line" nPF_ALG48">o 48p/a>   PF_ALG(str,c class="line" nGFP_KERNELt" class="sref"GFP_KERNELo/afh_entryp/a>(pa href="+codeproto               = siproto(strualg.c#L20" idv4L20" class='c2lass="sre2f">alg_typ"sp/a>); o 40oNOM" _typ"_listp/a> *pa href="+code=n2="sref">a2lg_typ"s_semp/a>); 2               zf2f_alp/a>->pa href="+code=owne2="line" n2am"v4L41">o 41p/a>                lnl/a>_typ"_listp/a> *pa href="+code=n2= class="2s="sref">nam"p/a>) o 43p/a>{  *pa href="+code=n2=ss="sref2sref">ENOENTp/a>);           z"ofpgraf5pa hrref="+code=af_ap>2               zf2f_alyp"p/a>->pa hreewz"of               newz"ofpa hu"_listp/a> *pa href="+code=n2=>alg_mem2s="sref">nodep/a>; o 46p/a> nodep/a>->pa href=accep45">o 45p/a>     ccep4pa hryp"p/a> *pa hre_s>               azf(str>strcmpp/a>(pa href=privatst" class="sref"privatsf_alyp"p/a>->pa hrp>2               zf2f_alp"_listp/a> *pa href="+code=n2=ine" nam2lg_typ"s_semp/a>); , pa href="+code=lis2t" class=2"sref">listp/a>) {  *pa href="+code=n2m"" class2="sref">nam"p/a>))                lnl/a>_typ"_listp/a> *pa href="+code=n2         2         continue; o 51p/a> o 55p/a>        }                = sizkpa hrref="+code=af_ap>2               zf2f_alp>strcmpp/a>(pa href=paren45">o 45p/a>    paren4f_al="+code=owner" clapk               zf(stralg.c#L20" idv4L20" class='c2ap"" clas24comment"> * This file p2rf="c25pto/af_alg.c#L47" idv4L47" cine"z>               = sizkpa hrref="+code=af_ap>2               zf2f_alp>strcmpp/a>(pa href="+code=node" class="sref">n="+code=owner" cla"+code=node" class="sref">nodep/a>->pa href="+code=t2="sref">a25g_typ"s_semp/a>); listp/a>) { ->pa href="pe" class="sref">"pef">n   ref="+code=af_a"+code=node" class="sref">nodep/a>->pa href="pe" class="sref">"pef">nodep/a>->pa href="+code=t26"" class26"sref">nam"p/a>)) ->pa href=statst" class="sref"stats(str="+code=owner" claSS_CONNECTEine" nam"v4L39">SS_CONNECTEi(strodep/a>->pa href="+code=t26        26        continue; o 51p/a> linu2//at mic.hp/a>>  * This file p26f="c26pto/af_alg.c#  >
 = pa href=erde=typ"" class="erd    alg.c#L20" idv4L20" class='c26"sref">a26g_typ"s_semp/a>); listp/a>) { o 45p/a>     m"v4L4accep4pa hualg.c#L20" idv4L20" class='c27"" class27"sref">nam"p/a>)) o 45p/a>     4L4accep4pa hrdv4L44" class="line" nz"of 52p/a>          z"of 5topa href="+code=af_ap/a>               z"of(str,cdv4L44" class="line" nz"of 52p/a>          z"of 5topa href="+code=af_anewz"of               newz"ofpa h,cin4" class="line" nflage" class="sref">flagef_alp/a>->pa href="+code=owne27"line" n27m"v4L51">o 51p/a> , pa href="+code=lis27" class=27sref">ownerp/a>)) o 45p/a>     m"v4L4accep4pa hrref="+code=af_ap/a>               z"of(strodep/a>->pa href=s>               zf(stryp"p/a>->pa hreewz"of               newz"ofpa hu"_listp/a> *pa href="+code=n27p"" clas27="sref">typ"p/a>;     27           break; linu27"comment"> *p/spa
  proto_"peto/afp/a>(pa href="+codeproto_"pe" class="sref">codeproto_"pe       yp"sp/a>, pa href="+code=lis27L39" idv2//if_alg.hp/a>> o 48p/a>   familL             =_alg.c# class="line" nPF_ALG48">o 48p/a>   PF_ALG(str,p"sp/a>, pa href="+code=lis27"sref">a27g_typ"s_semp/a>); typ          =_alg.c# class="line" nTHIS_MODULEe=typ"" class="THIS_MODULE(str,p"sp/a>, pa href="+code=lis27" class=27sref">listp/a>) { nam"p/a>)) o 45p/a>    L26nec4to/af_alg.c#=_alg.c# class="line" nz"ofpno_L26nec45">o 45p/a>    z"ofpno_L26nec4(str,p"sp/a>, pa href="+code=lis28        28        continue; , pa href="+code=lis28"line" n28m"v4L51">o 51p/a> , pa href="+code=lis28" class=28sref">ownerp/a>)) o 48p/a>   ioctl>typ          =_alg.c# class="line" nz"ofpno_ioctl48">o 48p/a>   z"ofpno_ioctl(str,p"sp/a>, pa href="+code=lis28p"" clas28="sref">typ"p/a>; , pa href="+code=lis28p/a>    28           break; , pa href="+code=lis28ef">linu28"comment"> *p/spa
  op45">o 45p/a>    getp/a>op4pa hlg.c#=_alg.c# class="line" nz"ofpno_ge4p/a>op45">o 45p/a>    z"ofpno_ge4p/a>op4(str,p"sp/a>, pa href="+code=lis28L39" idv28a.org.au>p/spa
  o 49p/a>  mma4to/af_alg.c#L49=_alg.c# class="line" nz"ofpno_mma4L49">o 49p/a>  z"ofpno_mma4(str,p"sp/a>, pa href="+code=lis28"sref">a2//crypto.hp/a>> , pa href="+code=lis28" class=28sref">listp/a>) { , pa href="+code=lis29"" class29"sref">nam"p/a>)) , pa href="+code=lis29        29        continue; o 48p/a>   pollto/af_alg.c#L49=_alg.c# class="line" nz"ofpno_poll48">o 48p/a>   z"ofpno_poll(str,p"sp/a>, pa href="+code=lis29"line" n29m"v4L51">o 51p/a> linu30r versn v.p/spa
  typ"p/a>; linu30/at mic.hp/a>>           n 5topa href="+code=af_ane52p/a>          n 5topa,cdv4L44" class="line" nz"of 52p/a>          z"of 5topa href="+code=af_ap/a>               z"of(str,cin4" class="line" nprotocol48">o 48p/a>   protocolpa h,p"sp/a>, pa href="+code=lis30f">crypt30/if_alg.hp/a>>  30ef">linu30/crypto.hp/a>> li30ux/init.hp/a>> 
)p/spa
                 lnl/a>_typ"_listp/a> *pa"+code=node" class="sref">n= !odref="+code=af_aSNK_SEQPACKERR_PTR" class="saSNK_SEQPACKERpa hup/a>pspa
 class="comment"> 3
 class="3comment"> *p/spa
  
 = pa href="+coaSNKTNOSUPPORTt" class="sref"EaSNKTNOSUPPORT    alg.c#L20" idv4L20" class='c3 4class="3omment"> */p/spa
  o 48p/a>   protocolpa h= !o0up/a>pspa
 class="comment"> 3
5lass="c3am"v4L14">o 14p/a> li3nux/init.hp/a>>                zf(strp/a>->pa href="+code=owne3 blished 3x/kernel.hp/a>> list_headp/a> pa href="+code=l3"fref">li3nux/list.hp/a>>                lnl/a>_typ"_listp/a> *pa"pe" class="sref">"pef">n   entryp/a>(pa href="+codeproto_"pe" class="sref">codeproto_"pe    st_headp/a> pa href="+code=l3" class="3inux/net.hp/a>> li3"v4L28">o 28p/a>}; li:f_alg.c#L51" idv4L51" class3="line" n3am"v4L29">o 29p/a>  *p/spa
  o 48p/a>   n 5eproto_familLto/afcode=owner" cla= sifamilL48">o 48p/a>   = sifamilLpa h="+f_alg.c#L43" idv4L43" class=33ref">lin3;ALG"p/spa
 , o 48p/a>   familL     =_alg.c# class="line" nPF_ALG48">o 48p/a>   PF_ALG(str,p"sp/a>, pa href="+code=lis3ass="sref3">THIS_MODULEp/a>, , pa href="+code=lis3aef">linu3ory_allocatedp/a>, typ  =_alg.c# class="line" nTHIS_MODULEe=typ"" class="THIS_MODULE(str,p"sp/a>, pa href="+code=lis33p"" clas3ef">alg_sockp/a>),  *pa href="+code=n3line" nam3"v4L37">o 37p/a>}; o 38p/a> o 48p/a>   am"v4L4sgl(str href="+code=af_apgl48">o 48p/a>   sgl(str,cvoiddv4L45" class="l__o4p/               __o4p/(str href="+code=af_aadd/               add/(str,cin4" class="line" nlod="/a>       = &lod(str,p"sp/a>, pa href="+code=lis3lass="sre3f">alg_typ"sp/a>); ->pa href="+code=owne3="sref">a3lg_typ"s_semp/a>); o 41p/a> o 48p/a>   frompa h9=_(unsignedclong)ref="+code=af_aadd/               add/(str"_listp/a> *pa href="+code=n3= class="3s="sref">nam"p/a>) npagoe(str"_listp/a> *pa href="+code=n3=ref">lin3m"v4L43">o 43p/a>{  *pa href="+code=n3=ss="sref3sref">ENOENTp/a>); o 46p/a> );  *pa href="+code=n3t" class=3"sref">listp/a>) {                access_o>pa hrref="+code=af_awritst" class="sref"writs(str ?#L47" idv4L47" cVERIFY_REAine" nam"v4L39">VERIFY_REAi(str :#L47" idv4L47" cVERIFY_WRITEe=typ"" class="VERIFY_WRITEf">nyp"p/a>->pa hr_dd/               add/(str,c class="line" nlod="/a>       = &lod(struup/a>pspa
 class="comment"> 3m"" class3="sref">nam"p/a>)) list_headp/a> pa href="+code=l3         3         continue; o 51p/a> o 48p/a>   frompa h9entry ~ class="line" nPAGE_MASK48">o 48p/a>   PAGE_MASK">list_headp/a> pa href="+code=l3  class="3"sref">ownerp/a>)) npagoe(str9=_(L47" idv4L47" c"ffe=typ"" class="sff(str=+c class="line" nlod="/a>       = &lod(str=+c class="line" nPAGE_SIZEe=typ"" class="PAGE_SIZE(str=- 1) dep/dep/c class="line" nPAGE_SHIFRR_PTR" class="sPAGE_SHIFR">list_headp/a> pa href="+code=l3 ref">lin3s="sref">typ"p/a>; npagoe(str9dep/c class="line" nALG_MAX_PAGES" class="sref">ALG_MAX_PAGES(strp/a>->pa href="+code=owne34p/a>    3            break; npagoe(str9=_ class="line" nALG_MAX_PAGES" class="sref">ALG_MAX_PAGES(strst_headp/a> pa href="+code=l3 >alg_mem3>o 55p/a>        }  * This file p3rf="c35pto/af_alg.c#L47" idv4L47" cerde=typ"" class="erd       ref="+code=af_aget_o4p/_pagoe_fas45">o 45p/a>    get_o4p/_pagoe_fas4pa hrref="+code=af_afrom48">o 48p/a>   frompa hyp"p/a>->pa hrepagoe" class="sref">npagoe(stryp"p/a>->pa hrwritst" class="sref"writs(str,cref="+code=af_apgl48">o 48p/a>   sgl(str>strcmpp/a>(pa href=pagoe" class="sref">pagoe(strualg.c#L20" idv4L20" class='c3="sref">a35g_typ"s_semp/a>);  3y" class=35sref">listp/a>) { list_headp/a> pa href="+code=l36"" class36"sref">nam"p/a>)) npagoe(str9=_ class="line" nerde=typ"" class="erd    alg.c#L20" idv4L20" class='c36"line" n36m"v4L51">o 51p/a>  *pa href="+code=t36" class=36sref">ownerp/a>)) npagoe(str9=!o0uup/a>pspa
 class="comment"> 36p"" clas36="sref">typ"p/a>; list_headp/a> pa href="+code=l36p/a>    36           break; linu3//at mic.hp/a>> listp/a>) { nam"p/a>)) npagoe(str"" class="line" nie=typ"" class="i    ++_typ"sp/a>, pa href="+code=lis37        37        continue; ownerp/a>)) o 48p/a>   sgl(str>strcmpp/a>(pa href=sse=typ"" class="zgpa h=+c class="line" nie=typ"" class="i    ,cref="+code=af_apgl48">o 48p/a>   sgl(str>strcmpp/a>(pa href=pagoe" class="sref">pagoe(str[ class="line" nie=typ"" class="i    ],cref="+code=af_aplod="/a>       = &plod(str,c class="line" noffe=typ"" class="sff(strualg.c#L20" idv4L20" class='c37p"" clas37="sref">typ"p/a>;     37           break; > o 51p/a> ownerp/a>)) a3//crypto.hp/a>> listp/a>) { nam"p/a>)) , pa href="+code=lis39        39        continue; o 48p/a>   sgl(str>strcmpp/a>(pa href=pagoe" class="sref">pagoe(str[ class="line" nie=typ"" class="i    ]ualg.c#L20" idv4L20" class='c39"line" n39m"v4L51">o 51p/a> o 45p/a>    ngpis_las4pa hrref="+code=af_apgl48">o 48p/a>   sgl(str>strcmpp/a>(pa href=sse=typ"" class="zgpa h=+c2ref="+code=af_aie=typ"" class="i    ++_)ualg.c#L20" idv4L20" class='c39" class=39sref">ownerp/a>)) typ"p/a>; , pa href="+code=lis40or (at y40ur tion>
)p/spa
  o 48p/a>   CMSG_OK href="+code=DECLAREmsse=typ"" class="mss(str,c class="line" ncmsse=typ"" class="cmss(str)_p"sp/a>, pa href="+code=lis402r (at y40m"v4L51">o 51p/a> 
 = pa href="+coINVALt" class="sref"EINVALf_alg_typ"p/a> *pa href="+code=t40 class="40omment"> *p/spa
  o 48p/a>   cmzgplevelto/af !odref="+code=af_aSL_ALG48">o 48p/a>   aSL_ALG(strup/a>pspa
 class="comment"> 404class="40="sref">typ"p/a>;  *pa href="+code=t405 404class           break; li4u30/at mic.hp/a>> , pa href="+code=lis70ef">li4u39a.org.au>p/spa
  <4r307 4c307to/af_alg.c#f_alg.case9=_ class="line" nALSET_IVcode=node" clas nALSET_IVuf">li:f_alg.c#L51" idv4L51" cla4 30ef">li4u30/crypto.hp/a>> o 48p/a>  =cmzgpc"i     &lp/c class="line"  CMSLE_ONt" class="sre  CMSLE_nepa hizeof(r href="+code=af_acon48">o 48p/a>   con(str>strcmpp/a>(pa hreivaie=typ"" class=vss(strtrup/a>pspa
 class="comment"> 90ef">li4u3oor modify itp/spa
  <4r309 4035pto/af_alg.c#L49" ic#L52" idvvvvvvvc#  >
 = pa href="+coINVALt" class="sref"EINVALf_alg_typ"p/a> *pa href="+code=c3ublishe4 3by the Freep/spa
  o 48p/a>   con(str>strcmpp/a>(pa hreivaie=typ"" class=vss(str9=/avoi*ng)ref="+code=af  CMSDATAONt" class="sre  CMSDATAOK href="+code=DECLA ncmsse=typ"" class="cmss(stalg_typ"p/a> *pa href="+code=c40or (at y3uur tion>
)p/spa
  o 48p/a>  =cmzgpc"i     &lp/c class="line"  CMSLE_ONt" class="sre  CMSLE_nepa  href="+code=af_acon48">o 48p/a>   con(str>strcmpp/a>(pa hreivaie=typ"" class=vss(str>strcmpp/a>(pa hreivgpcon48">o 48p/a> ivgpczgpa hlg_typ"p/a> *pa href="+code=c402r (at t3er versn v.p/spa
  o 48p/a>   con(str>strcmpp/a>(pa hreivaie=typ"" class=vss(strtrup/a>pspa
 class="comment"> 3
 class4"3comment"> *p/spa
  
 = pa href="+coINVALt" class="sref"EINVALf_alg_typ"p/a> *pa href="+code=c404class="3omment"> */p/spa
   *pa href="+code=c405 404clc3am"v4L14">o 14p/a> li4u3x/at mic.hp/a>> li:f_alg.c#L51" idv4L51" cla4s3
f">cry4t3o/if_alg.hp/a>> o 48p/a>  =cmzgpc"i     &lp/c class="line"  CMSLE_ONt" class="sre  CMSLE_nepa hizeof(/c class="line"ut3am"v4L31"s="sreuc33ptotrtrup/a>pspa
 class="comment"> 30ef">li4u3x/crypto.hp/a>> 
 = pa href="+coINVALt" class="sref"EINVALf_alg_typ"p/a> *pa href="+code=c90ef">li4i3nux/init.hp/a>> o 48p/a>   con(str>strcmpp/a>(pa hreoma4L49">o 49p/a>opss(str9*(/c class="line"ut3am"v4L31"s="sreuc33ptoi*ng)ref="+code=af  CMSDATAONt" class="sre  CMSDATAOK href="+code=DECLA ncmsse=typ"" class="cmss(stalg_typ"p/a> *pa href="+code=e3 blishe4 3x/kernel.hp/a>>  *pa href="+code=l3"fref">4i3nux/list.hp/a>> > 
 = pa href="+coINVALt" class="sref"EINVALf_alg_typ"p/a> *pa href="+code=c3fref">l4n3ux/rwsem.hp/a>> o 24p/a> li4u3lg_typ"_listp/a> { cry4t3s="sref">typ"p/a>; 
<  0af_alg.c#L38" idv4L38" cla4s3 ef">li4u3s="sref">listp/a>; 4i3"v4L28">o 28p/a>};        = &am"v4L4cmzgps nepatalg_typ"p/a> *pa href="+code=s3="line"4n3am"v4L29">o 29p/a> alg_m4m3ory_allocatedp/a>; o 48p/a>  nam"v4wait_for_completiacPL hrc#in4" class="line" nerde=typ"" class="erd  tr,idv4L26" class="line" nam"v4L2mpletiacon48">o 48p/a>  nam"v4completiacPL htr href="+code=af_ampletiacon48">o 48p/a> completiacPL htrup/a>pspa
 class="comment">n3" any l4t3am"v4L31">o 31p/a> , pa href="+code=l4c33 class4"3oomment"> *p/spa
  , pa href="+code=l4=33ref">l4n3;ALG"p/spa
 ,  = pa href="+coPROGRESGES" class="sref+coPROGRESGuf">li:f_alg.c#L51" idv4L51" cla4s3ass="sr4f3">THIS_MODULEp/a>,  = pa href="+BUSYES" class="sref+BUSYuf">li:f_alg.c#L51" idv4L51" cla4s3 ef">li4u3ory_allocatedp/a>, ->pa hrewait_for_completiacon48">o 48p/a> wait_for_completiacPL hr  entryp/a>(pa href=_ampletiacon48">o 48p/a> completiacPL htr>strcmpp/a>(pa hrefampletiacon48">o 48p/a> completiacPL htalg_typ"p/a> *pa href="+code=s3=f">cry4s3ef">alg_sockp/a>), o 48p/a> completiacPL htr>strcmpp/a>(pa hrefampletiacon48">o 48p/a> completiacPL htalg_typ"p/a> *pa href="+code=s3 ef">li4m3"v4L37">o 37p/a>}; o 48p/a> completiacPL htr>strcmpp/a>(pa href=erde=typ"" class="erd    alg.c#L20" idv4L20" class=4s3="line"4n3am"v4L38">o 38p/a>  *pa href="+code=s3lass="s4e3f">alg_typ"sp/a>);  *pa href="+code4e3="sref"4a3lg_typ"s_semp/a>); o 41p/a> 
 = pa href=erde=typ"" class="erd    alg.c#L20" idv4L20" class=4n3= class4"3s="sref">nam"p/a>) l4n3m"v4L43">o 43p/a>{ o 48p/a>  nam"v4wait_for_completiacPL htalg_typ"p/a> *pa href="+code=n3=ss="sr4f3sref">ENOENTp/a>); alg_m4m3s="sref">nodep/a>; o 45p/a>  L51" i_async_requelaPL htr href="+code=afreqs45">o 45p/a>  reqrd  trc#in4" class="line" nerde=typ"" class="erd  trup/a>pspa
 class="comment">c3=p"" cl4s3am"v4L46">o 46p/a> , pa href="+code=l4s3=ine" n4m3lg_typ"s_semp/a>); o 48p/a>  nam"v4completiacPL htr href="+code=af_ampletiacon48">o 48p/a> completiacPL htr==_ class="line"reqs45">o 45p/a>  reqrd  tr>strcmpp/a>(pa hret_datae=typ"" classt_datapaalg_typ"p/a> *pa href="+code=n3="line"4=3"sref">listp/a>) { nam"p/a>)) o 48p/a> completiacPL htr>strcmpp/a>(pa href=erde=typ"" class="erd  tr9=_ class="line" nerde=typ"" class="erd    alg.c#L20" idv4L20" class=4l3       4 3         continue; (pa href=_ampletiacon48">o 48p/a> completiacPL htr>strcmpp/a>(pa hrefampletiacon48">o 48p/a> completiacPL htalg_typ"p/a> *pa href="+code=s3="line"4n3am"v4L51">o 51p/a> ownerp/a>))  = pa href="+coXPORT_SYMBOL_GPLt" class="sref"EXPORT_SYMBOL_GPL href="+code=DECLARE_m"v4complet+code=node" clas"lim"v4complet+nepatalg_typ"p/a> *pa href="+code=s3=ref">l4n3s="sref">typ"p/a>;   4 3            break; pspa
 class="comment">l3 >alg_m4m3>o 55p/a>        } , pa href="+code=l4s3ap"" cl4s34comment"> * This file4p3rf=4538pto/af_alg.c#in4" class="line"f=erde=typ"" class="erd  tr9=_ class="line"5eprotreg_referde=typ"" class5eprotreg_refenepa   entryp/a>(pa href=a+codeproto               = siproto(s, 0talg_typ"p/a> *pa href="+code=s3=ine" n4a35g_typ"s_semp/a>); listp/a>) { l36"" cla4s36"sref">nam"p/a>)) list_headp/a> pa href="+code4s36      4 36        continue; o 51p/a> (pa href=a+cosifamilL48">o 48p/a>   = sifamilLpatalg_typ"p/a> *pa href="+code=t36" clas4=36sref">ownerp/a>)) typ"p/a>; list_headp/a> pa href="+code4s34p/a>  4 36           break; li4u3//at mic.hp/a>> li:f_alg.c#L51" idv4L51" cla4c36L39" i4v36comment"> * This file4p36f=4626pto/af_alg.c#  >
<=_ class="line" nerde=typ"" class="erd    alg.c#L20" idv4L20" class=4s36"sref"4a36g_typ"s_semp/a>); listp/a>) { li:f_alg.c#L51" idv4L51" cla4s37"" cla4s37"sref">nam"p/a>)) (pa href=a+codeproto               = siproto(stalg_typ"p/a> *pa href="+code=s37      4 37        continue; list_headp/a> pa href="+code4c37"line"4n37m"v4L51">o 51p/a> ownerp/a>)) typ"p/a>; pspa
 class="comment">s37p/a>  4 37           break; , pa href="+code=l4c37ef">li4u37"comment"> *p/spa
  <4 37f=4732pto/af_alg.c#L56" idv4L56"  s"ounreg_referde=typ"" class  s"ounreg_refePL href="+code=DECLA nPF_ALG48">o 48p/a>   PF_ALG(stalg_typ"p/a> *pa href="+code=s36L39" i4v3//if_alg.hp/a>> (pa href=a+codeproto               = siproto(stalg_typ"p/a> *pa href="+code=s36"sref"4a37g_typ"s_semp/a>); listp/a>) { nam"p/a>))  *pa href="+code=s38      4 38        continue;  *pa href="+code=s37"line"4n38m"v4L51">o 51p/a> "L_G" *pa href="+code=s37" clas4=38sref">ownerp/a>))  = pa href="S_MODU_ALIAS_NET"EPROcode=node" clasS_MODU_ALIAS_NET"EPROPL href="+code=DECLAAnPF_ALG48">o 48p/a> A PF_ALG(stalg_typ"p/a> *pa href="+code=c38p"" cl4s38="sref">typ"p/a>; 


fooefer> The original LXR software by the9=_ class=http://sourceforge.net/projects/lxer>LXR commupinyto(s, this experimental version by =_ class=mailto:lxe@typux.no">lxe@typux.noto(s. subfooefer> lxe.typux.no kindly horefd by =_ class=http://www.redpill-typpro.no">Redpill Lyppro ASto(s, provider of Lypuxg.cL2ulting and operatiacs services since 1995.