peval(1)

NAME
peval

SYNOPSIS
peval [options] [<expression>]

DESCRIPTION

peval is a low level policy evaluation tool that can be used to write router configuration generators. peval, in a command loop, inputs policy expressions, expands the AS macros, route communities, AS numbers as specified in the options, evaluates the resulting expression and outputs the result. Instead of a command loop, the expression can be given as an argument.

RAToolSet COMMON OPTIONS

    -help
        Print summary of command-line options and abort.

    -T [whois_query | whois_response | input | all]
        Trace the argument. Useful for debugging.

    -D <integer>
        Print debugging messages of debug channel <integer> (if compiled with DEBUG defined).

    -version
        Print the version number and quit.

    -h <host-name>
        Establish an radbserver connection to host <host-name>.

    -p <port-no>
        Establish an radbserver connection to port <port-no>.

    -s <source-list>
        Consider the sources specified in the comma separated <source-list>. If an object is defined in multiple sources in <source-list>, peval uses the definition first encountered in <source-list> from left to right.

    -rusage
        Print resource usage upon completion.

    -prompt <string>
        Set the interactive prompt to <string>.

    -ignore_errors
        Do not print error and warning messages due to communication to the database server or parsing policy objects.

    -report_errors
        Print error and warning messages due to communication to the database server or parsing policy objects.

OTHER OPTIONS

    -expand_as_macros
        Expand AS Macros into AS numbers.

    -expand_communities
        Expand community names into routes.

    -expand_as
        Expand AS numbers into routes.

    -expand_all
        Expand everything.

    -symbolic
        Do a prior symbolic evaluation, then do the expansions and then re-evaluate. This may be faster for some policies.

    -e <expression>
        Evaluate expression.

ENVIRONMENT VARIABLES

    IRR_HOST
        Specifies the radbserver host to connect.

    IRR_PORT
        Specifies the radbserver port number to connect.

    IRR_SOURCES
        Specifies the source list (comma separated) to consider.

Command line options take precedence over environment variables.

EXAMPLES

Perform only symbolic evaluation:

% ./peval
peval> (AS1 OR AS2) AND AS1
((AS1))
peval> AS1 AND NOT AS1
NOT ANY
peval>

Expand AS macros and evaluate:

% ./peval -expand_as_macros AS-ANSCT
((AS1326 AS2002 AS2538 AS2752 AS3723))

Expand all and evaluate (e.g. multihomed routes to AS1220 and AS226):

% ./peval -expand_all 'AS1220 AND AS226'
({192.237.125.0/24, 192.92.56.0/24, 196.2.41.0/24, 196.2.40.0/24})

REGISTERS

Registers can be used to store and access intermediate evaluations. Register names start with $ and can contain letters, numbers, and the characters '.', '/', and '%'. For example:

% ./peval -expand_all
peval> set $A AS690
peval> $A
({198.83.209.0/24, 199.222.34.0/24, 152.161.0.0/16, 192.103.63.0/24,
140.222.0.0/16, 206.157.77.0/29, 206.157.77.8/29, 199.221.28.0/24})
peval> $A AND {199.222.34.0/24, 152.161.0.0/16, 128.9.0.0/16}
({199.222.34.0/24, 152.161.0.0/16})
peval> set $B $A AND {199.222.34.0/24, 152.161.0.0/16}
peval> $B
({199.222.34.0/24, 152.161.0.0/16})
peval>

AUTHORS
Cengiz Alaettinoglu <cengiz@isi.edu>