Re: [iproute PATCH 2/3] ss: Put filter DB parsing into a separate function

2018-03-27 Thread Phil Sutter
On Tue, Mar 27, 2018 at 11:46:01AM -0700, Stephen Hemminger wrote: > On Sat, 24 Mar 2018 19:18:10 +0100 > Phil Sutter wrote: > > > +#define ENTRY(name, ...) { #name, { __VA_ARGS__, MAX_DB }} > > > + ENTRY(all, UDP_DB, DCCP_DB, TCP_DB, RAW_DB, \ > > +

Re: [iproute PATCH 2/3] ss: Put filter DB parsing into a separate function

2018-03-27 Thread Stephen Hemminger
On Sat, 24 Mar 2018 19:18:10 +0100 Phil Sutter wrote: > +#define ENTRY(name, ...) { #name, { __VA_ARGS__, MAX_DB }} > + ENTRY(all, UDP_DB, DCCP_DB, TCP_DB, RAW_DB, \ > +UNIX_ST_DB, UNIX_DG_DB, UNIX_SQ_DB, \ > +PACKET_R_DB,

[iproute PATCH 2/3] ss: Put filter DB parsing into a separate function

2018-03-24 Thread Phil Sutter
Use a table for database name parsing. The tricky bit is to allow for association of a (nearly) arbitrary number of DBs with each name. Luckily the number is not fully arbitrary as there is an upper bound of MAX_DB items. Since it is not possible to have a variable length array inside a variable