From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=lskr+Klc; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id EAEE15A026E for ; Wed, 29 Apr 2026 07:21:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1777440103; bh=djoO7lgVGqdRbKNCYsWXiHUbbR7gKIJoQB3jffU38J8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lskr+KlcqlcLXktfbQasbHQIovXsvaqVzHgiIT/h6f7AlEsiMFSXTdVtJ0iFi4vTv 6YaoIYgnoGPfxDiim/53v90Cv896lnUIlBOfM1bY+Nhvh2Lgiu5yTpBdaxAynYExiB XdjAsK7ws0gV3nfSzd8LLY5z6OADqNG4SeqriQENfrFYWnjwqeraT/9K2JidKKzXI1 WbQZXI0Vxv/Vknb/Nsdv5Mq/hYPuF2ppq40bbXhR53am3tVieu+0JJE7+sFlODix/j 4L42fy8txq+uBeaNNFMmiegetQ3IKDkCFbhGGbj+WTuL8i/skZpnmd5B74tdOlRfhY 1O6QWAKdPSwFw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4g55JR5lTMz4wnv; Wed, 29 Apr 2026 15:21:43 +1000 (AEST) Date: Wed, 29 Apr 2026 15:19:22 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v5 15/18] pesto: Read current ruleset from passt/pasta and optionally display it Message-ID: References: <20260421062516.2601204-1-david@gibson.dropbear.id.au> <20260421062516.2601204-16-david@gibson.dropbear.id.au> <20260425113558.2dbc419e@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HoOybz8WwtaPVhof" Content-Disposition: inline In-Reply-To: <20260425113558.2dbc419e@elisabeth> Message-ID-Hash: 6EMEP24E6PUXDB7MXI5M3WUB6WIIJOEM X-Message-ID-Hash: 6EMEP24E6PUXDB7MXI5M3WUB6WIIJOEM X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jon Maloy , passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --HoOybz8WwtaPVhof Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 25, 2026 at 11:35:59AM +0200, Stefano Brivio wrote: > On Fri, 24 Apr 2026 18:37:58 -0400 > Jon Maloy wrote: >=20 > > On 2026-04-21 02:25, David Gibson wrote: > > > Implement serialisation of our current forwarding rules in conf.c, > > > deserialising it to display in the pesto client. Doing this requires > > > adding ip.c, inany.c, bitmap.c, lineread.c and fwd_rule.c to the pesto > > > build. With previous preparations that now requires only a trivial c= hange =20 > > [...] > >=20 > > > + > > > + > > > +/** > > > + * fwd_rule_read() - Read serialised rule from an fd > > > + * @fd: fd to serialise to > > > + * @rule: Buffer to store rule into > > > + * > > > + * Return: 0 on success, -1 on error (with errno set) > > > + */ > > > +int fwd_rule_read(int fd, struct fwd_rule *rule) > > > +{ > > > + if (read_all_buf(fd, rule, sizeof(*rule))) > > > + return -1; > > > + > > > + /* Byteswap for host */ > > > + rule->first =3D ntohs(rule->first); > > > + rule->last =3D ntohs(rule->last); > > > + rule->to =3D htons(rule->to); =20 > > Or ntohs() ? >=20 > Thanks, nice catch, I'll fix this (I'm adopting this series and trying > to complete it while David is off). Oops, yes, good catch, thanks. --=20 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 --HoOybz8WwtaPVhof Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmnxlM4ACgkQzQJF27ox 2GdojA/+JSf8PLbHolg7CwcbO10H6jzi1aCz7p6MoLHHHY1D6GrbLcF/9iwguHz1 e9QP7iYAwtTG6jCT7QEqqmfA/WI2tc5ylgZEzTHm0JdrvbX4o/1zaZaidgFCPrpZ u5Kx36S1PQ5UDa2DaD+R/POPmrqxbwM2DAA24+UbSDG9cqxIgsUY7YDsd4xPQ2pX AsZVIiuId39/SfZ4h6CKfJpNmIkjjgkdpwATiJNJZ7YJrafhlrUnEQuI2v/ZMqDU NunRsP/DhYughcd/qQlpc9K7CSNlNVlnnNXNqQEbWPsh6uZDXHMZ0Zewyd5f0r1l GvHbn+Ff0S/QPmFsvAHN5muDer+ypM+9RAbq0D1c/+73oYhmICMuqiffzAdjFYJk DVot092OFBBrXX2Znq6r/eWRgWhVk++Pge//FnNT4HBAy4QuckVLj+i6OgzAB75O 7XNbK4ej97vJoaPBHcvoH/qi2Po4P6I2SBdMpW5uAtD4mkH3UatUwFSsyvsxp5PY bQrZe82GpikmMjZAB7KcYXGBQ+8ixIO6/5I5YjzehthLOorYCBp6a5bRBT5VV37L 5kjTU5ebu7nLP2ilT5yJ1xVh/bNBXzlIFWiOPT01RheKDAb3FyuohdtZRJPaJFCL fhZ0ui69HBpd1URBtZrmIzrhiQbYpgu5Uo9mVSMxAjxw8IhasV0= =lIab -----END PGP SIGNATURE----- --HoOybz8WwtaPVhof--