public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob ed4f578266700e23feea4920747c973ea8ebe3c6 1093 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
/* SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright Red Hat
 * Author: David Gibson <david@gibson.dropbear.id.au>
 *
 * Definitions for the global table of packet flows.
 */
#ifndef FLOW_TABLE_H
#define FLOW_TABLE_H

/**
 * union flow - Descriptor for a logical packet flow (e.g. connection)
 * @f:		Fields common between all variants
 * @tcp:	Fields for non-spliced TCP connections
 * @tcp_splice:	Fields for spliced TCP connections
*/
union flow {
	struct flow_common f;
	struct tcp_tap_conn tcp;
	struct tcp_splice_conn tcp_splice;
};

/* Global Flow Table */
extern union flow flowtab[];


/** flow_idx - Index of flow from common structure
 * @f:	Common flow fields pointer
 *
 * Return: index of @f in the flow table
 */
static inline unsigned flow_idx(const struct flow_common *f)
{
	return (union flow *)f - flowtab;
}

/** FLOW_IDX - Find the index of a flow
 * @f_:	Flow pointer, either union flow * or protocol specific
 *
 * Return: index of @f in the flow table
 */
#define FLOW_IDX(f_)		(flow_idx(&(f_)->f))

#define FLOW(idx)		(&flowtab[(idx)])

#endif /* FLOW_TABLE_H */

debug log:

solving ed4f578 ...
found ed4f578 in https://archives.passt.top/passt-dev/20231123023629.2024938-5-david@gibson.dropbear.id.au/
found c4c646b in https://passt.top/passt
preparing index
index prepared:
100644 c4c646bf12dcd244baaab33ff8e6722dac9114d4	flow_table.h

applying [1/1] https://archives.passt.top/passt-dev/20231123023629.2024938-5-david@gibson.dropbear.id.au/
diff --git a/flow_table.h b/flow_table.h
index c4c646b..ed4f578 100644

Checking patch flow_table.h...
Applied patch flow_table.h cleanly.

index at:
100644 ed4f578266700e23feea4920747c973ea8ebe3c6	flow_table.h

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).