Lines Matching refs:timeout
44 struct nf_ct_timeout timeout; member
70 ctnl_timeout_parse_policy(void *timeout, in ctnl_timeout_parse_policy() argument
91 ret = l4proto->ctnl_timeout.nlattr_to_obj(tb, net, timeout); in ctnl_timeout_parse_policy()
106 struct ctnl_timeout *timeout, *matching = NULL; in cttimeout_new_timeout() local
120 list_for_each_entry(timeout, &pernet->nfct_timeout_list, head) { in cttimeout_new_timeout()
121 if (strncmp(timeout->name, name, CTNL_TIMEOUT_NAME_MAX) != 0) in cttimeout_new_timeout()
127 matching = timeout; in cttimeout_new_timeout()
136 if (matching->timeout.l3num != l3num || in cttimeout_new_timeout()
137 matching->timeout.l4proto->l4proto != l4num) in cttimeout_new_timeout()
140 return ctnl_timeout_parse_policy(&matching->timeout.data, in cttimeout_new_timeout()
141 matching->timeout.l4proto, in cttimeout_new_timeout()
157 timeout = kzalloc(sizeof(struct ctnl_timeout) + in cttimeout_new_timeout()
159 if (timeout == NULL) { in cttimeout_new_timeout()
164 ret = ctnl_timeout_parse_policy(&timeout->timeout.data, l4proto, in cttimeout_new_timeout()
169 strcpy(timeout->name, nla_data(cda[CTA_TIMEOUT_NAME])); in cttimeout_new_timeout()
170 timeout->timeout.l3num = l3num; in cttimeout_new_timeout()
171 timeout->timeout.l4proto = l4proto; in cttimeout_new_timeout()
172 refcount_set(&timeout->refcnt, 1); in cttimeout_new_timeout()
174 list_add_tail_rcu(&timeout->head, &pernet->nfct_timeout_list); in cttimeout_new_timeout()
178 kfree(timeout); in cttimeout_new_timeout()
185 int event, struct ctnl_timeout *timeout) in ctnl_timeout_fill_info() argument
189 const struct nf_conntrack_l4proto *l4proto = timeout->timeout.l4proto; in ctnl_timeout_fill_info()
199 if (nla_put_string(skb, CTA_TIMEOUT_NAME, timeout->name) || in ctnl_timeout_fill_info()
201 htons(timeout->timeout.l3num)) || in ctnl_timeout_fill_info()
204 htonl(refcount_read(&timeout->refcnt)))) in ctnl_timeout_fill_info()
211 ret = l4proto->ctnl_timeout.obj_to_nlattr(skb, &timeout->timeout.data); in ctnl_timeout_fill_info()
312 static int ctnl_timeout_try_del(struct net *net, struct ctnl_timeout *timeout) in ctnl_timeout_try_del() argument
319 if (refcount_dec_if_one(&timeout->refcnt)) { in ctnl_timeout_try_del()
321 list_del_rcu(&timeout->head); in ctnl_timeout_try_del()
322 nf_ct_untimeout(net, &timeout->timeout); in ctnl_timeout_try_del()
323 kfree_rcu(timeout, rcu_head); in ctnl_timeout_try_del()
456 timeouts = &nf_icmp_pernet(info->net)->timeout; in cttimeout_default_get()
471 timeouts = &nf_icmpv6_pernet(info->net)->timeout; in cttimeout_default_get()
484 timeouts = &nf_generic_pernet(info->net)->timeout; in cttimeout_default_get()
516 struct ctnl_timeout *timeout, *matching = NULL; in ctnl_timeout_find_get() local
518 list_for_each_entry_rcu(timeout, &pernet->nfct_timeout_list, head) { in ctnl_timeout_find_get()
519 if (strncmp(timeout->name, name, CTNL_TIMEOUT_NAME_MAX) != 0) in ctnl_timeout_find_get()
522 if (!refcount_inc_not_zero(&timeout->refcnt)) in ctnl_timeout_find_get()
524 matching = timeout; in ctnl_timeout_find_get()
528 return matching ? &matching->timeout : NULL; in ctnl_timeout_find_get()
533 struct ctnl_timeout *timeout = in ctnl_timeout_put() local
534 container_of(t, struct ctnl_timeout, timeout); in ctnl_timeout_put()
536 if (refcount_dec_and_test(&timeout->refcnt)) { in ctnl_timeout_put()
537 kfree_rcu(timeout, rcu_head); in ctnl_timeout_put()
660 static int untimeout(struct nf_conn *ct, void *timeout) in untimeout() argument
665 RCU_INIT_POINTER(timeout_ext->timeout, NULL); in untimeout()