Lines Matching refs:ct
156 struct nf_conntrack *ct, void *data)
159 if (ct_filter_conntrack(ct, 1))
164 nl_destroy_conntrack(STATE(flush), ct);
199 int nl_get_conntrack(struct nfct_handle *h, const struct nf_conntrack *ct)
209 nfct_copy(tmp, ct, NFCT_CP_ORIG);
223 struct nf_conntrack *ct;
225 ct = nfct_clone(orig);
226 if (ct == NULL)
230 nfct_set_attr_u32(ct, ATTR_TIMEOUT, timeout);
233 if (nfct_attr_is_set(ct, ATTR_STATUS)) {
234 uint32_t status = nfct_get_attr_u32(ct, ATTR_STATUS);
236 nfct_set_attr_u32(ct, ATTR_STATUS, status);
239 nfct_setobjopt(ct, NFCT_SOPT_SETUP_REPLY);
242 if (nfct_attr_is_set(ct, ATTR_TCP_STATE)) {
251 if (nfct_get_attr_u8(ct, ATTR_TCP_STATE) >=
255 nfct_set_attr_u8(ct, ATTR_TCP_FLAGS_ORIG, flags);
256 nfct_set_attr_u8(ct, ATTR_TCP_MASK_ORIG, flags);
257 nfct_set_attr_u8(ct, ATTR_TCP_FLAGS_REPL, flags);
258 nfct_set_attr_u8(ct, ATTR_TCP_MASK_REPL, flags);
261 ret = nfct_query(h, NFCT_Q_CREATE, ct);
262 nfct_destroy(ct);
272 struct nf_conntrack *ct;
274 ct = nfct_clone(orig);
275 if (ct == NULL)
279 nfct_set_attr_u32(ct, ATTR_TIMEOUT, timeout);
282 nfct_attr_unset(ct, ATTR_SNAT_IPV4);
283 nfct_attr_unset(ct, ATTR_DNAT_IPV4);
284 nfct_attr_unset(ct, ATTR_SNAT_PORT);
285 nfct_attr_unset(ct, ATTR_DNAT_PORT);
287 if (nfct_attr_is_set(ct, ATTR_STATUS)) {
288 uint32_t status = nfct_get_attr_u32(ct, ATTR_STATUS);
290 nfct_set_attr_u32(ct, ATTR_STATUS, status);
293 if (nfct_attr_is_set(ct, ATTR_HELPER_NAME))
294 nfct_attr_unset(ct, ATTR_HELPER_NAME);
297 if (ct_is_related(ct)) {
298 nfct_attr_unset(ct, ATTR_MASTER_L3PROTO);
299 nfct_attr_unset(ct, ATTR_MASTER_L4PROTO);
300 nfct_attr_unset(ct, ATTR_MASTER_IPV4_SRC);
301 nfct_attr_unset(ct, ATTR_MASTER_IPV4_DST);
302 nfct_attr_unset(ct, ATTR_MASTER_IPV6_SRC);
303 nfct_attr_unset(ct, ATTR_MASTER_IPV6_DST);
304 nfct_attr_unset(ct, ATTR_MASTER_PORT_SRC);
305 nfct_attr_unset(ct, ATTR_MASTER_PORT_DST);
309 if (nfct_attr_is_set(ct, ATTR_TCP_STATE)) {
318 if (nfct_get_attr_u8(ct, ATTR_TCP_STATE) >=
322 nfct_set_attr_u8(ct, ATTR_TCP_FLAGS_ORIG, flags);
323 nfct_set_attr_u8(ct, ATTR_TCP_MASK_ORIG, flags);
324 nfct_set_attr_u8(ct, ATTR_TCP_FLAGS_REPL, flags);
325 nfct_set_attr_u8(ct, ATTR_TCP_MASK_REPL, flags);
328 ret = nfct_query(h, NFCT_Q_UPDATE, ct);
329 nfct_destroy(ct);
334 int nl_destroy_conntrack(struct nfct_handle *h, const struct nf_conntrack *ct)
336 return nfct_query(h, NFCT_Q_DESTROY, ct);