Re: rpki-client: add 'shortlist' functionality

2022-11-17 Thread Theo de Raadt
Job Snijders  wrote:

> rpki-client currently is using 'only' 18 out of the 66 ([a-zA-Z0-9).
> I am not very concerned in that regard. :-)


I have to disagree strongly -- Software bloat is dangerous.






Re: rpki-client: add 'shortlist' functionality

2022-11-17 Thread Job Snijders
Heya!

On Thu, Nov 17, 2022 at 08:39:36PM +0100, Theo Buehler wrote:
> > This functionality is handy if you want to inspect only specific
> > repositories and ignore the rest of the world. Useful for monitoring
> > too.
> > 
> > OK? Feedback?
> 
> I have no objection code-wise and I understand the motivation. However,
> I'm not a fan of using 'q' for this - it suggests quiet mode.

I was thinking 'quick', but I can see your point too.

> A more general concern could be summarized by saying that rpki-client
> will soon need to copy the BUGS section from indent(1). I'm only half
> joking. I'm not sure whether we have already reached the point where we
> must stop adding things, but we're getting close. We will soon need to
> start asking ourselves if adding this one feature might block a future,
> more important, thing, simply because there are only finitely many
> letters.

rpki-client currently is using 'only' 18 out of the 66 ([a-zA-Z0-9).
I am not very concerned in that regard. :-)

Garbage collection options:
   '-r' can be removed, its been the default for a while now anyway
   '-T' can maybe be merged into -B using getopt('B:'). I doubt many
(if any) people use '-T'.

If you don't like '-q', which of the following do you like better?
a A C D E F g G h H i I J k K l L m M N O p P Q u U w W x X y Y z Z

Kind regards,

Job



Re: rpki-client: add 'shortlist' functionality

2022-11-17 Thread Claudio Jeker
On Thu, Nov 17, 2022 at 05:53:40PM +, Job Snijders wrote:
> Dear all,
> 
> I introduced a 'shortlist' feature in rpki-client(8). If the operator
> specifies one or more '-q' options followed by FQDNs, the utility will
> *only* connect to those hosts and skip all others.
> 
> $ doas rpki-client -q rpki.ripe.net -q chloe.sobornost.net
> Processing time 84 seconds (75 seconds user, 10 seconds system)
> Skiplist entries: 0
> Route Origin Authorizations: 32459 (0 failed parse, 0 invalid)
> AS Provider Attestations: 0 (0 failed parse, 0 invalid)
> BGPsec Router Certificates: 2
> Certificates: 18750 (0 invalid)
> Trust Anchor Locators: 5 (0 invalid)
> Manifests: 18586 (0 failed parse, 0 stale)
> Certificate revocation lists: 18586
> Ghostbuster records: 1
> Trust Anchor Keys: 0
> Repositories: 8
> Cleanup: removed 1 files, 1270 directories, 67 superfluous
> VRP Entries: 179160 (179160 unique)
> VAP Entries: 0 (0 unique)
> 
> $ ls -lahtr /var/cache/rpki-client/
> total 28
> drwxr-xr-x  4 root  wheel   512B Nov 10 21:07 ..
> drwxr-xr-x  2 _rpki-client  wheel   512B Nov 17 17:35 .rsync
> drwxr-xr-x  7 _rpki-client  wheel   512B Nov 17 17:45 ta
> drwxr-xr-x  3 _rpki-client  wheel   512B Nov 17 17:47 rpki.ripe.net
> drwxr-xr-x  3 _rpki-client  wheel   512B Nov 17 17:47 chloe.sobornost.net
> drwxr-xr-x  7 _rpki-client  wheel   1.0K Nov 17 17:47 .
> drwxr-xr-x  5 _rpki-client  wheel   512B Nov 17 17:48 .rrdp
> 
> This functionality is handy if you want to inspect only specific
> repositories and ignore the rest of the world. Useful for monitoring
> too.
> 
> OK? Feedback?
> 
> Kind regards,
> 
> Job
> 
> Index: extern.h
> ===
> RCS file: /cvs/src/usr.sbin/rpki-client/extern.h,v
> retrieving revision 1.159
> diff -u -p -r1.159 extern.h
> --- extern.h  4 Nov 2022 12:05:36 -   1.159
> +++ extern.h  17 Nov 2022 17:47:34 -
> @@ -34,6 +34,15 @@ struct skiplistentry {
>  LIST_HEAD(skiplist, skiplistentry);
>  
>  /*
> + * Shortlist of hosts to connect to (loaded via -q arguments).
> + */
> +struct shortlistentry {
> + LIST_ENTRY(shortlistentry)   entry;
> + char*value; /* FQDN */
> +};
> +LIST_HEAD(shortlist, shortlistentry);
> +

Please define these in main.c. The shortlist is not used outside of main.c

Appart from that I agree with tb@ (both about the argument -q and the fact
that rpki-client ends up with a heck of a lot of options and modes).

-- 
:wq Claudio



Re: rpki-client: add 'shortlist' functionality

2022-11-17 Thread Theo Buehler
> This functionality is handy if you want to inspect only specific
> repositories and ignore the rest of the world. Useful for monitoring
> too.
> 
> OK? Feedback?

I have no objection code-wise and I understand the motivation. However,
I'm not a fan of using 'q' for this - it suggests quiet mode.

A more general concern could be summarized by saying that rpki-client
will soon need to copy the BUGS section from indent(1). I'm only half
joking. I'm not sure whether we have already reached the point where we
must stop adding things, but we're getting close. We will soon need to
start asking ourselves if adding this one feature might block a future,
more important, thing, simply because there are only finitely many
letters.