diff options
author | Daniele Di Proietto <diproiettod@vmware.com> | 2015-10-28 10:32:32 -0700 |
---|---|---|
committer | Daniele Di Proietto <diproiettod@vmware.com> | 2015-12-21 17:23:43 -0800 |
commit | a0f7b6d525d61a91c9e00e693d9513bf7833e373 (patch) | |
tree | 1044ee90feb0c973b77955c3e8589106619ae850 /lib | |
parent | b77d9629ad173b2b903f2146b931c729c22ae2d8 (diff) | |
download | openvswitch-a0f7b6d525d61a91c9e00e693d9513bf7833e373.tar.gz |
ct-dpif: Add ct_dpif_flush().
This function will flush the connection tracking tables of a specific
datapath.
It simply calls a function pointer in the dpif_class. No dpif
currently implements the required interface.
The next commits will provide an implementation in dpif-netlink.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ct-dpif.c | 11 | ||||
-rw-r--r-- | lib/ct-dpif.h | 1 | ||||
-rw-r--r-- | lib/dpif-netdev.c | 1 | ||||
-rw-r--r-- | lib/dpif-netlink.c | 1 | ||||
-rw-r--r-- | lib/dpif-provider.h | 4 |
5 files changed, 18 insertions, 0 deletions
diff --git a/lib/ct-dpif.c b/lib/ct-dpif.c index 4d5263157..d255a7150 100644 --- a/lib/ct-dpif.c +++ b/lib/ct-dpif.c @@ -108,6 +108,17 @@ ct_dpif_dump_done(struct ct_dpif_dump_state *dump) : EOPNOTSUPP); } +/* Flush the entries in the connection tracker used by 'dpif'. + * + * If 'zone' is not NULL, flush only the entries in '*zone'. */ +int +ct_dpif_flush(struct dpif *dpif, const uint16_t *zone) +{ + return (dpif->dpif_class->ct_flush + ? dpif->dpif_class->ct_flush(dpif, zone) + : EOPNOTSUPP); +} + void ct_dpif_entry_uninit(struct ct_dpif_entry *entry) { diff --git a/lib/ct-dpif.h b/lib/ct-dpif.h index 6c452a679..47663c752 100644 --- a/lib/ct-dpif.h +++ b/lib/ct-dpif.h @@ -179,6 +179,7 @@ int ct_dpif_dump_start(struct dpif *, struct ct_dpif_dump_state **, const uint16_t *zone); int ct_dpif_dump_next(struct ct_dpif_dump_state *, struct ct_dpif_entry *); int ct_dpif_dump_done(struct ct_dpif_dump_state *); +int ct_dpif_flush(struct dpif *, const uint16_t *zone); void ct_dpif_entry_uninit(struct ct_dpif_entry *); void ct_dpif_format_entry(const struct ct_dpif_entry *, struct ds *, bool verbose, bool print_stats); diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 3e626308f..3efbed019 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3688,6 +3688,7 @@ const struct dpif_class dpif_netdev_class = { NULL, /* ct_dump_start */ NULL, /* ct_dump_next */ NULL, /* ct_dump_done */ + NULL, /* ct_flush */ }; static void diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index bf81e6131..fa995c113 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -2322,6 +2322,7 @@ const struct dpif_class dpif_netlink_class = { NULL, /* ct_dump_start */ NULL, /* ct_dump_next */ NULL, /* ct_dump_done */ + NULL, /* ct_flush */ }; static int diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h index f00e63563..a9844be9e 100644 --- a/lib/dpif-provider.h +++ b/lib/dpif-provider.h @@ -415,6 +415,10 @@ struct dpif_class { int (*ct_dump_next)(struct dpif *, struct ct_dpif_dump_state *, struct ct_dpif_entry *entry); int (*ct_dump_done)(struct dpif *, struct ct_dpif_dump_state *state); + + /* Flushes the connection tracking tables. If 'zone' is not NULL, + * only deletes connections in '*zone'. */ + int (*ct_flush)(struct dpif *, const uint16_t *zone); }; extern const struct dpif_class dpif_netlink_class; |