IOS-XR route-policies in NSO part 2

As an update to my previous post about route-policies in NSO, I managed to try out a very recent version of the Cisco IOS-XR NED that was more suited for the XR RPL behaviour.

Instead of defining a route-policy that contains one line with all prefixes, a prefix list is defined and a general route-policy that accepts a prefix-list name as a variable is created.

General route-policy:

route-policy INET_IN($PLIST)
  if destination in $PLIST then

The prefix-list is created in the xml template, iterating around the list of prefixes, and the prefix-list is reference through the general policy in the BGP neighbor definition

Partial XML template:

<prefix-set xmlns="" tags="replace">
  <name tags="create">PL_INET_{$NAME}</name>
    <value># {$CUSTOMER} - {$NAME} prefix set</value>
   <?foreach {/prefixes}?>
    <!-- Test if prefix length is defined, then use it -->
    <?if {prfx_length} ?>
      <value>{prefix} le {prfx_length}</value>
    <!-- Test if prefix length is defined, if not don't use it -->
<router xmlns="" tags="merge">
   <?foreach {bgp}?>
           <name>{concat('INET_IN(PL_INET_', $NAME, ')'}</name>
       <!-- Test if BGP password is defined -->
       <?if {bgp_password}?>