summaryrefslogtreecommitdiffstats
path: root/tests/xmlfiles/73-set.xml
Commit message (Collapse)AuthorAgeFilesLines
* src: remove libmxml supportArturo Borrero2016-09-231-1/+0
| | | | | | | | | | | | | | | | | | | This patch removes the libmxml integration in libnftnl, since we have JSON in place and there is no need to support two at the same time. The JSON support is much better, for example libjansson has a better parsing error reporting. Moreover, libmxml 2.10 breaks the integration with libnftnl somehow, as reported in Debian bug #83870 [0]. Also, the XML support inside libnftnl has never been in good shape, with several tiny inconsitencies. [0] https://bugs.debian.org/838370 Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: update JSON/XML tests with the new syntaxAlvaro Neira Ayuso2015-02-101-1/+1
| | | | | Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* expr: data_reg: use 'reg' instead of 'data_reg'Pablo Neira Ayuso2014-11-101-1/+1
| | | | | | | | | | | | data_reg is unnecessarily long name and it always has to be wrapped by another data node. This will allow us to represent data not only as registers if needed. Get rid of 'cmpdata' and 'immediatedata' too and use 'data' instead to wrap 'reg' so these are consistent with the bitwise expression. No reason for such specific tag per expression. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: xmlfiles: Test files without unset child elements in set elementsAna Rey2014-06-111-1/+1
| | | | | | | Test files without unset child element in set elements. Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: xml: delete commentsArturo Borrero2014-01-151-1/+0
| | | | | | | | | | | | | | | | When building a XML tree, only one root node can be in place. This is a "feature" added in libmxml 2.7: <<< mxmlLoad... did not error out on XML with multiple root nodes (Bug #403) >>> In libmxml 2.6 the second root node was ignored, not because it was a comment but a bug. Our files had two root nodes, being comments or not. libmxml accept comments, but inside the root node. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: nft-parsing-test: use nft_ruleset_parse_file()Arturo Borrero2014-01-091-1/+1
| | | | | | | | | | All testfiles are now enclosed in the corresponding top element, ie. * XML: <nftables>...</nftables> * JSON: {"nftables":[...]} Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: xml: reorder XML elements in setsArturo Borrero2013-08-121-1/+1
| | | | | | | | Some node reorganization in order to have an input file equal to what set_snprintf will output. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: xml: remove \t and \n from all the filesPablo Neira Ayuso2013-08-101-37/+1
| | | | | | | | | | | | | | | | | These XML files are intented to be used for automated tests. Thus, it's important to have exactly the same output that was generated by the library. The beautified output does not match the real output that the library provides and it just makes things harder for us to provide a more advanced automated testing. If you want to make any of those file human readable, please use: xmllint --format file.xml or open the xml file and any browser, eg. firefox. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: xml: delete unneeded XML prefixesArturo Borrero Gonzalez2013-08-071-12/+12
| | | | | | | | | | | | | | | | | | | | This patch changes some XML nodes with prefixes, as the example below ilustrates. Before: <rule> <rule_flags/> <rule_family/> <rule> After: <rule> <flags> <family> </rule> Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: remove version from XML and JSON representationsPablo Neira Ayuso2013-07-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | This patch removes the version XML node and the version JSON field in all our existing objects. The current versioning approach consists of adding a version field to every object representation in XML and JSON. While listing my entire rule-set, one can notice that this approach is too bloated. Once the library enters stable stage, if we need to obsolete a XML node and a JSON field, we can follow this procedure: 1) Remove the XML node and the JSON field from the output, so fresh outputs will not contain the old ones anymore. 2) Do not remove the parsing of the old XML node and the JSON field inmediately. We have to keep supporting the parsing for a while to avoid breaking the interpretion of old XML/JSON files. We can spot a warning to warn about it, so users generate a fresh output again. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* set: add XML parsingArturo Borrero2013-07-261-0/+39
Sets are now parsed, following this previous snprintf pattern: <set> <set_name>string</set_name> <set_table>table</set_table> <set_xml_version>int</set_xml_version> <set_flags>uint32_t</set_flags> <key_type>uint32_t</key_type> <key_len>size_t</key_len> <data_type>uint32_t</data_type> <data_len>size_t</data_len> <set_elem> <set_elem_flags>uint32_t</set_elem_flags> <set_elem_key> <data_reg type="value"> <len></len> <dataN></dataN> </data_reg> </set_elem_key> <set_elem_data> <data_reg type="xx"> [...] </data_reg> </set_elem_data> </set_elem> </set> Signed-off-by: Arturo Borrero González <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>