Skip to content

Full IOS-XR Diff() support #10

Open
@naveci

Description

Dear Mike,

Thanks for building this awesome tool. I've been using it for some time now and it has helped tremendously with my projects. I've previously opened a bug report on the previous version of ciscoconfparse relating to route-policies in IOS-XR and the fact that regex wasn't properly escaped. However, now I'd like to open a feature request, because I'm noticing other issues with IOS-XR as well.

In short, I would like better support for XR specific syntax in this tool. There are several components that do not behave the same way as IOS-XE or the other components in XR. These components are:

  • route-policy
  • community-set
  • prefix-set
    potentially more..

Below are some config examples and I'm sure you will immediately recognise why I have some problems, especially with the diffs.

route-policy:

route-policy RP-PASS
  pass
end-policy
!
route-policy RP-MOD($COMM1, $COMM2)
  if community matches-any $COMM1 then
    drop
  elseif community matches-any $COMM2 then
    pass
  endif
end-policy

community-set

community-set SHUTDOWN-COMM
  65535:0
end-set

prefix-set:

prefix-set ALL
  0.0.0.0/0 eq 32
end-set
!
prefix-set PEERINGS
  1.1.1.1/32,
  2.2.2.2/32,
  10.0.1.0/24,
  172.16.0.0/12,
  192.168.3.0/26
end-set

Problems that currently occur:

  • end-set or end-policy are not a child of the preceeding config. In the diff, this does not show up because the diff doesn't handle it properly. If I want to add more configuration to another set (or extract), then I need to "hack" those statements in there as it won't be part of any object that ciscoconfparse finds.
  • For example in the prefix-set, if i do a diff to get the commands to change something, and two prefixes have a different order, then I will see the following for example:
prefix-set PEERINGS
  172.16.0.0/12,
  10.0.1.0/24,

There are three problems with that:

  1. It'll overwrite the existing prefix-set
  2. shows a comma, but the last entry will never have one
  3. it's missing the end-set statement

There are likely more issues, but these are the ones i'm currently running into.

I wouldn't mind helping out, but I would first have to get comfortable with the codebase here. Also, the question is if IOS-XR would require it's own code, be a derivative of XE or only modify the default IOS codeset to support both.

Kr.

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions