CP2XML
Section: User Commands (1)
Updated: 12 Mar 2008
Index
Return to Main Contents
NAME
cp2xml - Convert a Check Point colons-and-parentheses file to XML
SYNOPSIS
cp2xml
[-i input_file] [-o output_file] [-p name] [-P desc] [-n name]
[-r name] [-l name] [-b size_in_kb] [-s] [-m] [-M] [-d] [-h] [-v]
DESCRIPTION
cp2xml
will convert the awkward format used in many Check Point configuration
and data files into XML, which is generally more useful when
passing data on to third applications. Many of the files found
in a Check Point installation that end in .C (having nothing to
do with C/C++) or .fws are in this format, and if you have worked
much with their firewalls, you probably recognize this format on
sight.
With
cp2xml
you can control some aspects of the XML to be generated.
You can "prune" branches of the tree structure of the input file if
those branches do not interest you. All you need to know is a
string that uniquely identifies the start of the branch to be pruned.
You can also control the names given to certain nodes that do not
have explicit names defined in the Check Point-format data. These
include the root node, nodes with no identifiers immediately on
either side of their defining colons, and "true leaf" nodes that have
no child nodes whatsoever.
Terms
For the purposes of understanding
cp2xml,
knowing the meaning of certain terms will be helpful.
Tree
- As the Check Point format is a hierarchical one, each data
file can be said to contain a tree composed of nodes, all ultimately
related to a root node.
Branch
- A branch can be any given node along with all of that node's
child nodes, all of those nodes' children, and so on until there are
no more nodes "under" the first node of the branch.
Node
- A node is that unit of data which is demarcated by a colon.
The node contains the text immediately to the right of the colon, but
before any parentheses. This text is the node's
name.
Any pair of left and right parentheses that follows the colon (either
immediately or after a
name)
demarcate further nodes that are children of the first
node.
An exception to this is the node's
description,
which, if present at all, is any text *IMMEDIATELY* following a
node's left parenthesis and before the next child node's colon.
OPTIONS
Often cp2xml will be usefully invoked in the following simple way:
cp2xml < blah.C > blah.xml
These options may be given in any order:
- -i {input file}
-
Use this option to specify the location of the input (Check Point) file,
or omit this option to have
cp2xml
use stdin for input.
- -o {output file}
-
Use this option to specify the location of the desired output (XML),
or omit this option to have
cp2xml
use stdout for output.
- -p {name}
-
Prune a branch (a node and all of its descendants) given the name of
a node at which to start pruning.
- -P {description}
-
Prune a branch (a node and all of its descendants) given the description
of a node at which to start pruning.
- -n {name}
-
Specify a name to apply to all nodes that are not explicity given a
name in the input (Check Point) data stream. The default name applied
to such nodes is "node".
- -r {name}
-
Specify a name to apply to the root node. The default name applied
is "root".
- -l {name}
-
Specify a name to apply to true leaf nodes. True leaf nodes have no
children and not even name of their own.
- -b {size in KB}
-
Set the size of the parse buffer. This defaults to 4 KB. You generally
shouldn't need this option, unless your input stream contains individual
strings that exceed 4096 bytes in length.
- -s
-
Output a "simple" format instead of XML. Just try it to see what the
format looks like. It's easily parsed and built mainly on semi-colons
and tab-delimitation.
- -m
-
Print (on stderr) the peak amount of memory in bytes used to process
all nodes. This is mainly useful for debugging.
- -M
-
Print (on stderr) the amount of memory in bytes used to process all nodes
after reducing the total appropriately if any branches have been pruned,
thus lowering memory usage. This is mainly useful for debugging.
- -d
-
Print some possibly useful (or not) debugging messages on stderr as
the conversion process proceeds. This is mainly useful for debugging.
- -h
-
Display help and exit.
- -v
-
Display version information and exit.
FILES
None
SEE ALSO
None
COPYRIGHT AND LICENSE
Copyright (C) 2008 Hurricane Labs, LLC.
cp2xml is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
sddelta is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
Check Point is a
registered trademark of Check Point Software Technologies Ltd.
BUGS
Probably. Especially when input is malformed.
AUTHOR
Lebbeous Weekley <lebbeous-dev@hurricanelabs.com>
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- FILES
-
- SEE ALSO
-
- COPYRIGHT AND LICENSE
-
- AUTHOR
-
- BUGS
-
This document was created by
man2html,
using the manual pages.
Time: 20:30:50 GMT, May 19, 2008