On Wed, Jul 10, 2013 at 07:25:09PM +0100, Michael Zintakis wrote: > * add a separate nfacct_options struct with its get/set functions, allowing > userspace programs, like nfacct, to specify the width of the columns which > are to be printed, so that they are no longer hard-coded into the printing > template itself. This allows column width to be "adjusted", depending on the > value of each property; > > * add a separate NFACCT_SNPRINTF_F_NUMONLY template, which prints the > numbers-only properties of the accounting objects (formatted - see below) - > useful to the nfnetlink callback function in order to determine the maximum > column width, which needs to be used to print each column. > > * add a new nfacct_snprintf_with_options function enhancing the existing API > to enable "options" to be specified during printing properties of nfacct > objects. > > * allow on-the-fly formatting, using over 14 different formats when printing > accounting objects. This formatting, if specified, applies to *all* > accounting objects. This patch adds many things in one single patch that need to be split in many of them. > Signed-off-by: Michael Zintakis <michael.zintakis@xxxxxxxxxxxxxx> > --- > configure.ac | 2 +- > include/libnetfilter_acct/libnetfilter_acct.h | 75 ++++ > src/libnetfilter_acct.c | 512 ++++++++++++++++++++++++-- > src/libnetfilter_acct.map | 10 + > 4 files changed, 569 insertions(+), 30 deletions(-) > [...] > +void nfacct_option_set(struct nfacct_options *options, > + enum nfacct_option_type type, const void *data); > +void nfacct_option_set_u16(struct nfacct_options *options, > + enum nfacct_option_type type, uint16_t value); > +void nfacct_option_set_tsize(struct nfacct_options *options, > + enum nfacct_option_type type, size_t value); > +void nfacct_option_unset(struct nfacct_options *options, > + enum nfacct_option_type type); > +const void *nfacct_option_get(struct nfacct_options *options, > + enum nfacct_option_type type); > +uint16_t nfacct_option_get_u16(struct nfacct_options *options, > + enum nfacct_option_type type); > +size_t nfacct_option_get_tsize(struct nfacct_options *options, > + enum nfacct_option_type type); You can get rid of all these if you use flags. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html