On Tue, Apr 02, 2013 at 07:18:39PM +0200, Arturo Borrero Gonzalez wrote: > 2013/4/2 Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>: > > I think we need something similar to: > > > > int nft_parse_data(union nft_data_reg *data, struct nlattr *attr, int *type); > > > > We should pass a 'type' that indicates: > > > > DATA_VALUE, > > DATA_VERDICT, > > DATA_CHAIN, > > > > So you know if you have print what the data_reg contains. > > > > If cmp and bitwise are going to always have DATA_VALUE, and imm > depending on what was set, I think we could do: > > int nft_data_reg_snprintf(char *buf, union data_reg *data, int type, ...) > switch(type) > return nft_data_reg_snprintf_'type'(buf, data, ...) where 'type' can be: value, verdict or chain. > And the same applies when parsing XML. Exactly. -- 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