libnl 1.1.4
ct.h
1/*
2 * netlink/netfilter/ct.h Conntrack
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
7 * of the License.
8 *
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10 * Copyright (c) 2007 Philip Craig <philipc@snapgear.com>
11 * Copyright (c) 2007 Secure Computing Corporation
12 */
13
14#ifndef NETLINK_CT_H_
15#define NETLINK_CT_H_
16
17#include <netlink/netlink.h>
18#include <netlink/addr.h>
19#include <netlink/cache.h>
20#include <netlink/msg.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26struct nfnl_ct;
27
28extern struct nl_object_ops ct_obj_ops;
29
30/* General */
31extern struct nfnl_ct * nfnl_ct_alloc(void);
32extern struct nl_cache *nfnl_ct_alloc_cache(struct nl_handle *);
33
34extern int nfnlmsg_ct_group(struct nlmsghdr *);
35extern struct nfnl_ct * nfnlmsg_ct_parse(struct nlmsghdr *);
36
37extern void nfnl_ct_get(struct nfnl_ct *);
38extern void nfnl_ct_put(struct nfnl_ct *);
39
40extern int nfnl_ct_dump_request(struct nl_handle *);
41
42extern void nfnl_ct_set_family(struct nfnl_ct *, uint8_t);
43extern uint8_t nfnl_ct_get_family(const struct nfnl_ct *);
44
45extern void nfnl_ct_set_proto(struct nfnl_ct *, uint8_t);
46extern int nfnl_ct_test_proto(const struct nfnl_ct *);
47extern uint8_t nfnl_ct_get_proto(const struct nfnl_ct *);
48
49extern void nfnl_ct_set_tcp_state(struct nfnl_ct *, uint8_t);
50extern int nfnl_ct_test_tcp_state(const struct nfnl_ct *);
51extern uint8_t nfnl_ct_get_tcp_state(const struct nfnl_ct *);
52extern char * nfnl_ct_tcp_state2str(uint8_t, char *, size_t);
53extern int nfnl_ct_str2tcp_state(const char *name);
54
55extern void nfnl_ct_set_status(struct nfnl_ct *, uint32_t);
56extern void nfnl_ct_unset_status(struct nfnl_ct *, uint32_t);
57extern uint32_t nfnl_ct_get_status(const struct nfnl_ct *);
58
59extern void nfnl_ct_set_timeout(struct nfnl_ct *, uint32_t);
60extern int nfnl_ct_test_timeout(const struct nfnl_ct *);
61extern uint32_t nfnl_ct_get_timeout(const struct nfnl_ct *);
62
63extern void nfnl_ct_set_mark(struct nfnl_ct *, uint32_t);
64extern int nfnl_ct_test_mark(const struct nfnl_ct *);
65extern uint32_t nfnl_ct_get_mark(const struct nfnl_ct *);
66
67extern void nfnl_ct_set_use(struct nfnl_ct *, uint32_t);
68extern int nfnl_ct_test_use(const struct nfnl_ct *);
69extern uint32_t nfnl_ct_get_use(const struct nfnl_ct *);
70
71extern void nfnl_ct_set_id(struct nfnl_ct *, uint32_t);
72extern int nfnl_ct_test_id(const struct nfnl_ct *);
73extern uint32_t nfnl_ct_get_id(const struct nfnl_ct *);
74
75extern int nfnl_ct_set_src(struct nfnl_ct *, int,
76 struct nl_addr *);
77extern struct nl_addr * nfnl_ct_get_src(const struct nfnl_ct *, int);
78
79extern int nfnl_ct_set_dst(struct nfnl_ct *, int,
80 struct nl_addr *);
81extern struct nl_addr * nfnl_ct_get_dst(const struct nfnl_ct *, int);
82
83extern void nfnl_ct_set_src_port(struct nfnl_ct *, int, uint16_t);
84extern int nfnl_ct_test_src_port(const struct nfnl_ct *, int);
85extern uint16_t nfnl_ct_get_src_port(const struct nfnl_ct *, int);
86
87extern void nfnl_ct_set_dst_port(struct nfnl_ct *, int, uint16_t);
88extern int nfnl_ct_test_dst_port(const struct nfnl_ct *, int);
89extern uint16_t nfnl_ct_get_dst_port(const struct nfnl_ct *, int);
90
91extern void nfnl_ct_set_icmp_id(struct nfnl_ct *, int, uint16_t);
92extern int nfnl_ct_test_icmp_id(const struct nfnl_ct *, int);
93extern uint16_t nfnl_ct_get_icmp_id(const struct nfnl_ct *, int);
94
95extern void nfnl_ct_set_icmp_type(struct nfnl_ct *, int, uint8_t);
96extern int nfnl_ct_test_icmp_type(const struct nfnl_ct *, int);
97extern uint8_t nfnl_ct_get_icmp_type(const struct nfnl_ct *, int);
98
99extern void nfnl_ct_set_icmp_code(struct nfnl_ct *, int, uint8_t);
100extern int nfnl_ct_test_icmp_code(const struct nfnl_ct *, int);
101extern uint8_t nfnl_ct_get_icmp_code(const struct nfnl_ct *, int);
102
103extern void nfnl_ct_set_packets(struct nfnl_ct *, int, uint64_t);
104extern int nfnl_ct_test_packets(const struct nfnl_ct *, int);
105extern uint64_t nfnl_ct_get_packets(const struct nfnl_ct *,int);
106
107extern void nfnl_ct_set_bytes(struct nfnl_ct *, int, uint64_t);
108extern int nfnl_ct_test_bytes(const struct nfnl_ct *, int);
109extern uint64_t nfnl_ct_get_bytes(const struct nfnl_ct *, int);
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif
struct nl_cache * nfnl_ct_alloc_cache(struct nl_handle *)
Build a conntrack cache holding all conntrack currently in the kernel.
Definition: ct.c:407
Object Operations.
Definition: object-api.h:255
Netlink message header.