Lines Matching refs:ct

141 static inline u_int16_t nf_ct_l3num(const struct nf_conn *ct)  in nf_ct_l3num()  argument
143 return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num; in nf_ct_l3num()
146 static inline u_int8_t nf_ct_protonum(const struct nf_conn *ct) in nf_ct_protonum() argument
148 return ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum; in nf_ct_protonum()
151 #define nf_ct_tuple(ct, dir) (&(ct)->tuplehash[dir].tuple) argument
158 static inline struct net *nf_ct_net(const struct nf_conn *ct) in nf_ct_net() argument
160 return read_pnet(&ct->ct_net); in nf_ct_net()
164 void nf_conntrack_alter_reply(struct nf_conn *ct,
184 void nf_conntrack_tcp_set_closing(struct nf_conn *ct);
187 static inline void nf_ct_put(struct nf_conn *ct) in nf_ct_put() argument
189 if (ct && refcount_dec_and_test(&ct->ct_general.use)) in nf_ct_put()
190 nf_ct_destroy(&ct->ct_general); in nf_ct_put()
203 int nf_conntrack_hash_check_insert(struct nf_conn *ct);
204 bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
210 void __nf_ct_refresh_acct(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
215 static inline void nf_ct_refresh_acct(struct nf_conn *ct, in nf_ct_refresh_acct() argument
220 __nf_ct_refresh_acct(ct, ctinfo, skb, extra_jiffies, true); in nf_ct_refresh_acct()
224 static inline void nf_ct_refresh(struct nf_conn *ct, in nf_ct_refresh() argument
228 __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, false); in nf_ct_refresh()
232 bool nf_ct_kill_acct(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
236 static inline bool nf_ct_kill(struct nf_conn *ct) in nf_ct_kill() argument
238 return nf_ct_delete(ct, 0, 0); in nf_ct_kill()
258 void nf_conntrack_free(struct nf_conn *ct);
265 static inline int nf_ct_is_template(const struct nf_conn *ct) in nf_ct_is_template() argument
267 return test_bit(IPS_TEMPLATE_BIT, &ct->status); in nf_ct_is_template()
271 static inline int nf_ct_is_confirmed(const struct nf_conn *ct) in nf_ct_is_confirmed() argument
273 return test_bit(IPS_CONFIRMED_BIT, &ct->status); in nf_ct_is_confirmed()
276 static inline int nf_ct_is_dying(const struct nf_conn *ct) in nf_ct_is_dying() argument
278 return test_bit(IPS_DYING_BIT, &ct->status); in nf_ct_is_dying()
290 static inline unsigned long nf_ct_expires(const struct nf_conn *ct) in nf_ct_expires() argument
292 s32 timeout = READ_ONCE(ct->timeout) - nfct_time_stamp; in nf_ct_expires()
297 static inline bool nf_ct_is_expired(const struct nf_conn *ct) in nf_ct_is_expired() argument
299 return (__s32)(READ_ONCE(ct->timeout) - nfct_time_stamp) <= 0; in nf_ct_is_expired()
303 static inline bool nf_ct_should_gc(const struct nf_conn *ct) in nf_ct_should_gc() argument
305 return nf_ct_is_expired(ct) && nf_ct_is_confirmed(ct) && in nf_ct_should_gc()
306 !nf_ct_is_dying(ct); in nf_ct_should_gc()
315 static inline void nf_ct_offload_timeout(struct nf_conn *ct) in nf_ct_offload_timeout() argument
317 if (nf_ct_expires(ct) < NF_CT_DAY / 2) in nf_ct_offload_timeout()
318 WRITE_ONCE(ct->timeout, nfct_time_stamp + NF_CT_DAY); in nf_ct_offload_timeout()
353 u32 nf_ct_get_id(const struct nf_conn *ct);
357 nf_ct_set(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info info) in nf_ct_set() argument
359 skb_set_nfct(skb, (unsigned long)ct | info); in nf_ct_set()
373 #define NF_CT_STAT_INC(net, count) __this_cpu_inc((net)->ct.stat->count)
374 #define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count)
375 #define NF_CT_STAT_ADD_ATOMIC(net, count, v) this_cpu_add((net)->ct.stat->count, (v))