aboutgitcodebugslistschat
path: root/flow_table.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-07-18 15:26:34 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-07-19 18:32:56 +0200
commit163a339214dd34696ce485930f35ed21c86057f0 (patch)
treee5e37fb9281ea71ebcee9c3f1573c0301337a97d /flow_table.h
parentf19a8f71f9df0fb01e81af56cf30dd207958a591 (diff)
downloadpasst-163a339214dd34696ce485930f35ed21c86057f0.tar
passt-163a339214dd34696ce485930f35ed21c86057f0.tar.gz
passt-163a339214dd34696ce485930f35ed21c86057f0.tar.bz2
passt-163a339214dd34696ce485930f35ed21c86057f0.tar.lz
passt-163a339214dd34696ce485930f35ed21c86057f0.tar.xz
passt-163a339214dd34696ce485930f35ed21c86057f0.tar.zst
passt-163a339214dd34696ce485930f35ed21c86057f0.zip
tcp, flow: Replace TCP specific hash function with general flow hash
Currently we match TCP packets received on the tap connection to a TCP connection via a hash table based on the forwarding address and both ports. We hope in future to allow for multiple guest side addresses, or for multiple interfaces which means we may need to distinguish based on the endpoint address and pif as well. We also want a unified hash table to cover multiple protocols, not just TCP. Replace the TCP specific hash function with one suitable for general flows, or rather for one side of a general flow. This includes all the information from struct flowside, plus the pif and the L4 protocol number. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'flow_table.h')
-rw-r--r--flow_table.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/flow_table.h b/flow_table.h
index aabdbb7..b3cb546 100644
--- a/flow_table.h
+++ b/flow_table.h
@@ -146,4 +146,7 @@ void flow_activate(struct flow_common *f);
#define FLOW_ACTIVATE(flow_) \
(flow_activate(&(flow_)->f))
+uint64_t flow_hash(const struct ctx *c, uint8_t proto, uint8_t pif,
+ const struct flowside *side);
+
#endif /* FLOW_TABLE_H */