.\"// $Id: peval.1,v 4.13 2006/10/01 11:23:32 shane Exp $ .\"// Copyright (c) 2001,2002 RIPE NCC .\"// .\"// All Rights Reserved .\"// .\"// Permission to use, copy, modify, and distribute this software and its .\"// documentation for any purpose and without fee is hereby granted, .\"// provided that the above copyright notice appear in all copies and that .\"// both that copyright notice and this permission notice appear in .\"// supporting documentation, and that the name of the author not be .\"// used in advertising or publicity pertaining to distribution of the .\"// software without specific, written prior permission. .\"// .\"// THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING .\"// ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL .\"// AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY .\"// DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN .\"// AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\"// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\"// .\"// .\"// Copyright (c) 1994 by the University of Southern California .\"// and/or the International Business Machines Corporation. .\"// All rights reserved. .\"// .\"// Permission to use, copy, modify, and distribute this software and .\"// its documentation in source and binary forms for lawful .\"// non-commercial purposes and without fee is hereby granted, provided .\"// that the above copyright notice appear in all copies and that both .\"// the copyright notice and this permission notice appear in supporting .\"// documentation, and that any documentation, advertising materials, .\"// and other materials related to such distribution and use acknowledge .\"// that the software was developed by the University of Southern .\"// California, Information Sciences Institute and/or the International .\"// Business Machines Corporation. The name of the USC or IBM may not .\"// be used to endorse or promote products derived from this software .\"// without specific prior written permission. .\"// .\"// NEITHER THE UNIVERSITY OF SOUTHERN CALIFORNIA NOR INTERNATIONAL .\"// BUSINESS MACHINES CORPORATION MAKES ANY REPRESENTATIONS ABOUT .\"// THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. THIS SOFTWARE IS .\"// PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, .\"// INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\"// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND .\"// NON-INFRINGEMENT. .\"// .\"// IN NO EVENT SHALL USC, IBM, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY .\"// SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, WHETHER IN CONTRACT, .\"// TORT, OR OTHER FORM OF ACTION, ARISING OUT OF OR IN CONNECTION WITH, .\"// THE USE OR PERFORMANCE OF THIS SOFTWARE. .\"// .\"// Questions concerning this software should be directed to .\"// irrtoolset@ripe.net .\"// .\"// Author(s): Cengiz Alaettinoglu .\"// Katie Petrusha .\" .\" .TH peval 1 local .SH NAME peval .SH SYNOPSIS .B peval .RI [ options ]\ [] .SH DESCRIPTION .PP 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 sets, route sets, filter sets, AS numbers (unless specified otherwise using command line options), evaluates the resulting expression and outputs the result. Instead of a command loop, the expression can be given as an argument. .PP By default peval evaluates the expression for ipv4 unicast address family. Also the list of address families can be specified in order to restrict the results. The syntax is: afi . .PP is a comma separated list of address families. The supported ones are: ipv4, ipv4.unicast (same as ipv4), ipv4.multicast, ipv6, ipv6.unicast (same as ipv6), ipv6.multicast, any.unicast (ipv4.unicast, ipv6.unicast), any.multicast (ipv4.multicast, ipv6.multicast), any (ipv4.unicast, ipv4.multicast, ipv6.unicast, ipv6.multicast). If the results are to be restricted to uncomparable address families (ipv4, ipv6), in the output they will be joined using 'OR' clause. .PP is a valid RPSLng filter over AS-numbers, ipv4/ipv6 prefixes, range operators, filter-sets, route-sets, as-sets and logical operators. For more details about mp-filter format see RPSLng documentation. .PP .SH IRRToolSet COMMON OPTIONS .RS .IP -help Print summary of command-line options and abort. .IP "\-T [whois_query | whois_response | input | all]" Trace the argument. Useful for debugging. .IP "\-D " Print debugging messages of debug channel (if compiled with DEBUG defined). .IP "\-version" Print the version number and quit. .IP "\-h " Establish a whois connection to host . The default is whois.radb.net. .IP "\-p " Establish a whois connection to port . The default is 43. .IP "\-protocol " Use the to connect to the IRR server. can be irrd(rawhoisd), ripe(bird), and ripe_perl. The default is irrd. The ripe_perl option should be used with the old ripe server. .IP "\-s " Consider the sources specified in the comma separated . If an object is defined in multiple sources in , peval uses the definition first encountered in from left to right. .IP "\-f " IRR cache file. You can have any RPSL object in this file, except route objects. They will override these objects in IRR. This option is intended for private objects, or to test new public objects before publishing. You can specify more than one cache file by specifying this option repeatedly. .IP \-rusage Print resource usage upon completion. .IP "\-prompt " Set the interactive prompt to . .IP "\-ignore_errors" Do not print error and warning messages due to communication to the database server or parsing policy objects. .IP "\-report_errors" Print error and warning messages due to communication to the database server or parsing policy objects. .RE .SH OTHER OPTIONS .RS .IP -no-as-set Do not expand AS sets into AS numbers. .IP -no-route-set Do not expand route sets into prefixes. .IP -no-as Do not expand AS numbers into prefixes. .IP -none Do not expand anything. .IP -symbolic Do a prior symbolic evaluation, then do the expansions and then re-evaluate. This may be faster for some policies. .IP -compressed Print prefix lists using the more specific operators. Otherwise, an expression like 128.9.0.0/16^24 will result in 256 prefixes being printed. .IP "\-e " Evaluate expression. .RE .SH ENVIRONMENT VARIABLES .RS .IP IRR_HOST Specifies the IRR host to connect. .IP IRR_PORT Specifies the IRR port number to connect. .IP IRR_SOURCES Specifies the source list (comma separated) to consider. .RE .PP Command line options take precedence over environment variables. .SH EXAMPLES .PP Perform only symbolic evaluation: .PP .nf % ./peval -none peval> (AS1 OR AS2) AND AS1 ((AS1)) peval> AS1 AND NOT AS1 NOT ANY peval> .fi .PP Expand AS macros and evaluate: .PP .nf % ./peval -no-as AS-ANSCT ((AS1326 AS2002 AS2538 AS2752 AS3723)) .fi .PP Expand all and evaluate (e.g. multihomed routes to AS1220 and AS226): .PP .nf % ./peval 'AS1220 AND AS226' ({192.237.125.0/24, 192.92.56.0/24, 196.2.41.0/24, 196.2.40.0/24}) .fi .PP Evaluate the filter for ipv4 and ipv6 address families: .PP .nf % ./peval 'afi ipv6, ipv4 rs-rpslng' ({1001:0:0:0:0:0:0:0/35, 1:0:0:0:0:0:0:0/35}) OR ({1.0.0.0/8, 1.2.3.0/24}) .SH ERROR AND WARNING MESSAGES Error: Internal error. .RS .PP Fails if couldn't evaluate the filter to resulting normal expression. .PP .RE Unknown protocol! .RS .PP Connection to IRR server failed. This can be caused by various reasons, please see IRR-Errors manpage, IRR Communication errors. .PP .RE ***Error: badly formed filter. .RS .PP syntax error in RPSL filter specification. .PP .RE For more error descriptions, please see .B IRR-Errors manual page. .SH AUTHORS Cengiz Alaettinoglu .PP Katie Petrusha