Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: rpki-client: pass around a container struct instead of a long parameter list
To:
Job Snijders <job@openbsd.org>
Cc:
tech@openbsd.org
Date:
Tue, 8 Jul 2025 14:54:26 +0200

Download raw body.

Thread
On Tue, Jul 08, 2025 at 12:44:12PM +0000, Job Snijders wrote:
> I think it is fine to continue to pass around 'everything' into the
> various output functions - even when a particular function doesn't use a
> one or more of the available trees; BUT, it seems tedious that every
> time we add or remove a feature, every output function's signature also
> has to change.

Yes. I mentioned this when I added the nca tree and had a similar diff
somewhere.

> Perhaps it is better to use a struct that contains references to the
> various trees and pass that 'container' around. I believe this kind of
> refactor will help avoid certain churn in future work.

Definitely. One request:

> +entity_process(struct ibuf *b, struct stats *st, struct trees *trees)

...

> +output_bgpd(FILE *out, struct trees *trees, struct stats *st)

Can we stick to one order please?