path: root/examples/nft-table-xml-add.c
Commit message (Collapse)AuthorAgeFilesLines
* examples: nft-{table,chain,rule}-xml-add: fix missing NLM_F_CREATEPablo Neira Ayuso2013-07-101-13/+8
| | | | | | | | | | | | | | | | | | Thus, automodule loading was not working. While at it, apply not so relevant comestic cleanups and fix some inconsistencies between examples. * Fix copyright header, this is code heavily based on existing nft-*-add examples. * Remove unrequired extern struct nft_table definition. * Make sure we close file descriptor once we don't need it anymore. * Remove unrequired casting. * Remove comment that provides nothing interesting. I considered a patch to address each on those was too much burden. Signed-off-by: Pablo Neira Ayuso <>
* examples: XML parsing examplesArturo Borrero Gonzalez2013-05-231-0/+117
Some code snipplets to add tables/chain/rules using the XML representation. The examples contains: * A binary to parse/add the object using libnftables. * A shellscript to easily call that binary, doing some tests. * table/chain/rule sample XML file. I included my name in new files, but I don't know if this is correct. Please let me know. Instructions: $ cd examples/ ; make nft-table-xml-add # cd test/ ; ./ NOTE: Some kernel changes are required to allow reinsert exactly what is printed (handle handling, flags..) Signed-off-by: Arturo Borrero Gonzalez <> Signed-off-by: Pablo Neira Ayuso <>