Description
xmlparser uses libxml2 & GNU getopt.
User writes information in xml files, and xmlparser parses the xml files and produces the switch rules and group information.
This sample program is divided into two, one is mklist, another is mkglist. The former is for switch rules, and the other for group information.
Installation
For mklist
- make
- ./mklist -h
- use make clean to clean up
For mkglist
- make
- ./mkglist -h
- use make clean to clean up
Usage
Usage: ./mklist [-f file -a action [-p port] [-t protocol]] | -h
The details about options & parameters:
-f file A must. Specify the input xml file.
-a action A must. Specify permit or deny.
-p port Not must. Specify the port number, 0~65535.
-t protocol Not must. Specify the tcp or udp protocol.
-h Not must. Find help on how to use this command.
You can sepcify the output file via pipeline. Like ./mklist -f users.xml -p 20 -t tcp -a permit >> switches.rules
Usage: ./mkglist [-f file] | -h
The details about options & parameters:
-f file A must. Specify the input file.
-h Not must. Find help on how to use this command.
You can sepcify the output file via pipeline. Like ./mkglist -f users.xml >> output.txt
For further information, please contact me at chinylv@gmail.com.