skb_copy_and_csum_dev()函数

今天还发现了一个特别好的网站,可以去查各类的linux函数

http://lxr.free-electrons.com/ident?v=2.6.35&i=

void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
{
         __wsum csum;
         long csstart;
 
         if (skb->ip_summed == CHECKSUM_PARTIAL)
                 csstart = skb->csum_start - skb_headroom(skb);
         else
                 csstart = skb_headlen(skb);
 
         BUG_ON(csstart > skb_headlen(skb));
 
         skb_copy_from_linear_data(skb, to, csstart);
 
         csum = 0;
         if (csstart != skb->len)
                 csum = skb_copy_and_csum_bits(skb, csstart, to + csstart,
                                               skb->len - csstart, 0);
 
         if (skb->ip_summed == CHECKSUM_PARTIAL) {
                 long csstuff = csstart + skb->csum_offset;
 
                 *((__sum16 *)(to + csstuff)) = csum_fold(csum);
         }
 }


你可能感兴趣的:(api,function,command,Descriptor,fold)