On Mon, Apr 17, 2023 at 12:45:43PM +0200, Claudio Jeker wrote: > On Mon, Apr 17, 2023 at 12:12:47PM +0200, Theo Buehler wrote: > > On Mon, Apr 17, 2023 at 11:28:37AM +0200, Claudio Jeker wrote: > > > I want to extend the parser to support lists in a few places. > > > One of them is for communities. This is the first step towards this goal. > > > The change uses the fact that match_token() has access to argc and argv > > > and changes the community parsers to parse the next token for communities. > > > As a nice side-effect this reduces the amount of tables and removes the > > > ext-community subtype tables which are probably never in sync with the one > > > from bgpd.h. > > > > I like the direction and it looks like a good intermediate step. Go > > ahead > > > > ok > > > > > The way argv is passed to match_token() is not great, tripple pointers are > > > just strange. I plan to fix this in an upcomming diff. > > > > That would be nice. > > How about this? I think this is the simplest way to handle this.
Yes, that's much better and agreed, I don't see a simpler way. > -const struct token *match_token(int *argc, char **argv[], > - const struct token []); > +const struct token *match_token(int argc, char *argv[], > + const struct token [], int *); This is not new, but I'd either name all arguments or none of them. Other than that, ok