LCOV - code coverage report
Current view: top level - include/linux/netfilter - nf_conntrack_common.h (source / functions) Hit Total Coverage
Test: gcov_data_raspi2_real_modules_combined.info Lines: 6 8 75.0 %
Date: 2020-09-30 20:25:40 Functions: 2 2 100.0 %
Branches: 2 6 33.3 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: GPL-2.0 */
       2                 :            : #ifndef _NF_CONNTRACK_COMMON_H
       3                 :            : #define _NF_CONNTRACK_COMMON_H
       4                 :            : 
       5                 :            : #include <linux/atomic.h>
       6                 :            : #include <uapi/linux/netfilter/nf_conntrack_common.h>
       7                 :            : 
       8                 :            : struct ip_conntrack_stat {
       9                 :            :         unsigned int found;
      10                 :            :         unsigned int invalid;
      11                 :            :         unsigned int ignore;
      12                 :            :         unsigned int insert;
      13                 :            :         unsigned int insert_failed;
      14                 :            :         unsigned int drop;
      15                 :            :         unsigned int early_drop;
      16                 :            :         unsigned int error;
      17                 :            :         unsigned int expect_new;
      18                 :            :         unsigned int expect_create;
      19                 :            :         unsigned int expect_delete;
      20                 :            :         unsigned int search_restart;
      21                 :            : };
      22                 :            : 
      23                 :            : #define NFCT_INFOMASK   7UL
      24                 :            : #define NFCT_PTRMASK    ~(NFCT_INFOMASK)
      25                 :            : 
      26                 :            : struct nf_conntrack {
      27                 :            :         atomic_t use;
      28                 :            : };
      29                 :            : 
      30                 :            : void nf_conntrack_destroy(struct nf_conntrack *nfct);
      31                 :    2145408 : static inline void nf_conntrack_put(struct nf_conntrack *nfct)
      32                 :            : {
      33   [ -  +  #  # ]:    2145408 :         if (nfct && atomic_dec_and_test(&nfct->use))
      34                 :          0 :                 nf_conntrack_destroy(nfct);
      35                 :    2145408 : }
      36                 :     357708 : static inline void nf_conntrack_get(struct nf_conntrack *nfct)
      37                 :            : {
      38         [ -  + ]:     357708 :         if (nfct)
      39                 :          0 :                 atomic_inc(&nfct->use);
      40                 :     357708 : }
      41                 :            : 
      42                 :            : #endif /* _NF_CONNTRACK_COMMON_H */

Generated by: LCOV version 1.14