On Fri, Jan 31, 2025 at 08:39:52PM +0100, Stefano Brivio wrote: > Those are symmetric to TAPSIDE(x)/TAPFLOW(x) and I'll use them in > the next patch to extract 'oport' in order to re-bind sockets to > the original socket-side local port. > > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tcp_internal.h | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/tcp_internal.h b/tcp_internal.h > index 94e5780..9cf31f5 100644 > --- a/tcp_internal.h > +++ b/tcp_internal.h > @@ -38,9 +38,13 @@ > #define OPT_SACK 5 > #define OPT_TS 8 > > -#define TAPSIDE(conn_) ((conn_)->f.pif[1] == PIF_TAP) > -#define TAPFLOW(conn_) (&((conn_)->f.side[TAPSIDE(conn_)])) > -#define TAP_SIDX(conn_) (FLOW_SIDX((conn_), TAPSIDE(conn_))) > +#define TAPSIDE(conn_) ((conn_)->f.pif[1] == PIF_TAP) > +#define TAPFLOW(conn_) (&((conn_)->f.side[TAPSIDE(conn_)])) > +#define TAP_SIDX(conn_) (FLOW_SIDX((conn_), TAPSIDE(conn_))) > + > +#define HOSTSIDE(conn_) ((conn_)->f.pif[1] == PIF_HOST) > +#define HOSTFLOW(conn_) (&((conn_)->f.side[HOSTSIDE(conn_)])) > +#define HOST_SIDX(conn_) (FLOW_SIDX((conn_), TAPSIDE(conn_))) > > #define CONN_V4(conn) (!!inany_v4(&TAPFLOW(conn)->oaddr)) > #define CONN_V6(conn) (!CONN_V4(conn)) -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson