]> git.proxmox.com Git - mirror_ovs.git/blob - lib/netlink-conntrack.h
dpctl: Add the option 'pmd' for dump-flows.
[mirror_ovs.git] / lib / netlink-conntrack.h
1 /*
2 * Copyright (c) 2015 Nicira, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef NETLINK_CONNTRACK_H
18 #define NETLINK_CONNTRACK_H
19
20 #include <linux/netfilter/nfnetlink_cttimeout.h>
21
22 #include "byte-order.h"
23 #include "compiler.h"
24 #include "ct-dpif.h"
25 #include "openvswitch/dynamic-string.h"
26 #include "openvswitch/hmap.h"
27 #include "openvswitch/ofpbuf.h"
28 #include "timeval.h"
29 #include "unixctl.h"
30 #include "util.h"
31
32 enum nl_ct_event_type {
33 NL_CT_EVENT_NEW = 1 << 0,
34 NL_CT_EVENT_UPDATE = 1 << 1,
35 NL_CT_EVENT_DELETE = 1 << 2,
36 };
37
38 #define NL_CT_TIMEOUT_POLICY_MAX_ATTR (CTA_TIMEOUT_TCP_MAX + 1)
39
40 struct nl_ct_timeout_policy {
41 char name[CTNL_TIMEOUT_NAME_MAX];
42 uint16_t l3num;
43 uint8_t l4num;
44 uint32_t attrs[NL_CT_TIMEOUT_POLICY_MAX_ATTR];
45 uint32_t present;
46 };
47
48 struct nl_ct_dump_state;
49 struct nl_ct_timeout_policy_dump_state;
50
51 int nl_ct_dump_start(struct nl_ct_dump_state **, const uint16_t *zone,
52 int *ptot_bkts);
53 int nl_ct_dump_next(struct nl_ct_dump_state *, struct ct_dpif_entry *);
54 int nl_ct_dump_done(struct nl_ct_dump_state *);
55
56 int nl_ct_flush(void);
57 int nl_ct_flush_zone(uint16_t zone);
58 int nl_ct_flush_tuple(const struct ct_dpif_tuple *, uint16_t zone);
59
60 int nl_ct_set_timeout_policy(const struct nl_ct_timeout_policy *nl_tp);
61 int nl_ct_get_timeout_policy(const char *tp_name,
62 struct nl_ct_timeout_policy *nl_tp);
63 int nl_ct_del_timeout_policy(const char *tp_name);
64 int nl_ct_timeout_policy_dump_start(
65 struct nl_ct_timeout_policy_dump_state **statep);
66 int nl_ct_timeout_policy_dump_next(
67 struct nl_ct_timeout_policy_dump_state *state,
68 struct nl_ct_timeout_policy *nl_tp);
69 int nl_ct_timeout_policy_dump_done(
70 struct nl_ct_timeout_policy_dump_state *state);
71
72 bool nl_ct_parse_entry(struct ofpbuf *, struct ct_dpif_entry *,
73 enum nl_ct_event_type *);
74 void nl_ct_format_event_entry(const struct ct_dpif_entry *,
75 enum nl_ct_event_type, struct ds *,
76 bool verbose, bool print_stats);
77
78 #endif /* NETLINK_CONNTRACK_H */