LCOV - code coverage report
Current view: top level - net/ipv4 - xfrm4_state.c (source / functions) Hit Total Coverage
Test: Real Lines: 3 12 25.0 %
Date: 2020-10-17 15:46:16 Functions: 0 2 0.0 %
Legend: Neither, QEMU, Real, Both Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: GPL-2.0
       2                 :            : /*
       3                 :            :  * xfrm4_state.c
       4                 :            :  *
       5                 :            :  * Changes:
       6                 :            :  *      YOSHIFUJI Hideaki @USAGI
       7                 :            :  *              Split up af-specific portion
       8                 :            :  *
       9                 :            :  */
      10                 :            : 
      11                 :            : #include <net/ip.h>
      12                 :            : #include <net/xfrm.h>
      13                 :            : #include <linux/pfkeyv2.h>
      14                 :            : #include <linux/ipsec.h>
      15                 :            : #include <linux/netfilter_ipv4.h>
      16                 :            : #include <linux/export.h>
      17                 :            : 
      18                 :          0 : int xfrm4_extract_header(struct sk_buff *skb)
      19                 :            : {
      20                 :            :         const struct iphdr *iph = ip_hdr(skb);
      21                 :            : 
      22                 :          0 :         XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph);
      23                 :          0 :         XFRM_MODE_SKB_CB(skb)->id = iph->id;
      24                 :          0 :         XFRM_MODE_SKB_CB(skb)->frag_off = iph->frag_off;
      25                 :          0 :         XFRM_MODE_SKB_CB(skb)->tos = iph->tos;
      26                 :          0 :         XFRM_MODE_SKB_CB(skb)->ttl = iph->ttl;
      27                 :          0 :         XFRM_MODE_SKB_CB(skb)->optlen = iph->ihl * 4 - sizeof(*iph);
      28                 :          0 :         memset(XFRM_MODE_SKB_CB(skb)->flow_lbl, 0,
      29                 :            :                sizeof(XFRM_MODE_SKB_CB(skb)->flow_lbl));
      30                 :            : 
      31                 :          0 :         return 0;
      32                 :            : }
      33                 :            : 
      34                 :            : static struct xfrm_state_afinfo xfrm4_state_afinfo = {
      35                 :            :         .family                 = AF_INET,
      36                 :            :         .proto                  = IPPROTO_IPIP,
      37                 :            :         .output                 = xfrm4_output,
      38                 :            :         .output_finish          = xfrm4_output_finish,
      39                 :            :         .extract_input          = xfrm4_extract_input,
      40                 :            :         .extract_output         = xfrm4_extract_output,
      41                 :            :         .transport_finish       = xfrm4_transport_finish,
      42                 :            :         .local_error            = xfrm4_local_error,
      43                 :            : };
      44                 :            : 
      45                 :          3 : void __init xfrm4_state_init(void)
      46                 :            : {
      47                 :          3 :         xfrm_state_register_afinfo(&xfrm4_state_afinfo);
      48                 :          3 : }
    

Generated by: LCOV version 1.14