Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
eb99106
Adding support for confederations in AS PATH for 'show bgp' IOS-XR pa…
vkoulermos Feb 18, 2022
82b930e
Merge branch 'master' of https://github.com/vkoulermos/genieparser
vkoulermos Feb 18, 2022
e185fe8
add changelog
vkoulermos Feb 18, 2022
a224a2a
ShowBgpInstanceAllAll: Added golden output files. And fixed p16 not m…
vkoulermos Feb 19, 2022
2570f4b
Reverted ShowBgpL2vpnEvpn changes.
vkoulermos Feb 19, 2022
d5c8e23
Added ShowBgpInstanceNeighborsRoutes golden outputs
vkoulermos Feb 19, 2022
b116c51
Added ShowBgpInstanceNeighborsAdvertisedRoutes golden outputs
vkoulermos Feb 19, 2022
810e572
Missed this during commit 2570f4b00ac5026b6f90b00ee66e14e4bbed3721
vkoulermos Feb 19, 2022
1c70f03
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Mar 2, 2022
b8b2c45
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Mar 10, 2022
465f9d3
Update changelog_show_bgp_iosxr_20220218145506.rst
bobody64 Mar 11, 2022
1ebacb6
adding examples of device output
vkoulermos Mar 12, 2022
681365a
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Mar 21, 2022
efe330f
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Mar 30, 2022
e332455
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Apr 8, 2022
b269124
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Apr 17, 2022
2539a81
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos May 25, 2022
c38bb7e
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Jun 9, 2022
add939a
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Jul 5, 2022
8993669
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Jul 27, 2022
96c5a97
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Aug 24, 2022
eb88107
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Dec 9, 2022
d489e2b
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Apr 29, 2023
d7358f0
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Jun 14, 2023
3a6fa8d
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Jul 23, 2023
664ed54
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Oct 12, 2023
d3c9e72
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Dec 12, 2023
fb69969
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Jan 30, 2024
693c5bb
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos May 15, 2024
0b3d3ed
Merge branch 'CiscoTestAutomation:master' into master
vkoulermos Sep 2, 2024
6ac3231
Merge branch 'main' into master
vkoulermos Oct 9, 2025
2dc8ea1
Merge branch 'CiscoTestAutomation:main' into master
vkoulermos Dec 16, 2025
cafe401
Merge branch 'CiscoTestAutomation:main' into master
vkoulermos Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* IOS-XR
* Modified ShowBgpInstanceNeighborsReceivedRoutes:
* Updated regex pattern <p13> and <p13_1> to accommodate for BGP confederations in AS_PATH.
* Updated regex pattern <p13.m1> , <p13.m2> and <p13.m3> to accommodate for BGP confederations in AS_PATH.
* Modified ShowBgpInstanceNeighborsAdvertisedRoutes:
* Updated regex pattern <p4> and <p5_1> to accommodate for BGP confederations in AS_PATH.
* Modified ShowBgpInstanceAllAll:
* Updated regex pattern <p16_2> , <p16> and <p17> to accommodate for BGP confederations in AS_PATH.
* Updated regex pattern <p16.m1> , <p16.m2> and <p16.m3> to accommodate for BGP confederations in AS_PATH.

54 changes: 30 additions & 24 deletions src/genie/libs/parser/iosxr/show_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3746,11 +3746,11 @@ def cli(self, vrf_type='all', neighbor='', vrf='all', instance='all', address_fa
p12 = re.compile(r'^Route +Distinguisher: *(?P<route_distinguisher>\S+) *'
r'(\(default +for +vrf +(?P<default_vrf>[a-zA-Z0-9]+)\))?$')
p13 = re.compile(r'^(?P<status_codes>(i|s|x|S|d|h|\*|\>|\s)+)? *'
r'(?P<prefix>(?P<ip>[\w\.\:\/\[\]]+)\/(?P<mask>\d+))?( +'
r'(?P<next_hop>[\w\.\:]+) *(?P<number>[\d\.\s\{\}]+)?'
r'(?: *(?P<origin_codes>(i|e|\?)))?)?$')
p13_1 = re.compile(r'(?P<path>[\d\.\s]+)'
r' *(?P<origin_codes>(i|e|\?))?$')
'(?P<prefix>(?P<ip>[\w\.\:\/\[\]]+)\/(?P<mask>\d+))?( +'
'(?P<next_hop>[\w\.\:]+) *(?P<number>[()\d\.\s\{\}]+)?'
'(?: *(?P<origin_codes>(i|e|\?)))?)?$')
p13_1 = re.compile(r'(?P<path>[()\d\.\s]+)'
' *(?P<origin_codes>(i|e|\?))?$')

p14 = re.compile(r'^Processed *(?P<processed_prefixes>[0-9]+) *'
r'prefixes, *(?P<processed_paths>[0-9]+) *paths$')
Expand Down Expand Up @@ -4117,25 +4117,29 @@ def cli(self, vrf_type='all', neighbor='', vrf='all', instance='all', address_fa
if group_num:
# metric locprf weight path
# 2219 211 0 200 33299 51178 47751 {27016}
m1 = re.compile(r'^(?P<metric>[0-9]+) +'
r'(?P<locprf>[0-9]+) +'
r'(?P<weight>[0-9]+) '
r'(?P<path>[0-9\.\{\}\s]+)$').match(group_num)
# 0 120 500 (64630 64601) 39935

m1 = re.compile(r'^(?P<metric>[0-9]+) +'
'(?P<locprf>[0-9]+) +'
'(?P<weight>[0-9]+) '
'(?P<path>[()0-9\.\{\}\s]+)$').match(group_num)

# metric locprf weight path
# 2219 0 200 33299 51178 47751 {27016}
# locprf weight path
# 211 0 200 33299 51178 47751 {27016} 65000.65000

# 100 0 (64630 64609) 6762 4445 3209 21334

m2 = re.compile(r'^(?P<value>[0-9]+)'
r'(?P<space>\s{2,20})'
r'(?P<weight>[0-9]+) '
r'(?P<path>[0-9\.\{\}\s]+)$').match(group_num)

'(?P<space>\s{2,20})'
'(?P<weight>[0-9]+) '
'(?P<path>[()0-9\.\{\}\s]+)$').match(group_num)
# weight path
# 0 200 33299 51178 47751 {27016} 65000.65000
# 0 (64629 64601 64630 64609) 6762 4445 3209 21334
m3 = re.compile(r'^(?P<weight>[0-9]+) '
r'(?P<path>(([\d\.]+\s)|(\{[\d\.]+\}\s))+)$')\
'(?P<path>(([()\d\.]+\s)|(\{[\d\.]+\}\s))+)$')\
Comment thread
vkoulermos marked this conversation as resolved.
.match(group_num)

if m1:
Expand Down Expand Up @@ -4314,8 +4318,8 @@ def cli(self, vrf_type='all', neighbor='', vrf='all', instance='all', address_fa
p4 = re.compile(
r'^(?P<prefix>(?P<ip>[\w\.\:\[\]]+)/(?P<mask>\d+)) *(?P<next_hop>[\w\.\:]+) *('
r'?P<froms>[\w\.\:]+) *'
r'(?P<path>[\d\.\{\}\s]+)?(?P<origin_code>[e|i\?])?$')
p5_1 = re.compile(r'(?P<path>[\d\.\{\}\s]+)(?P<origin_code>e|i)?$')
r'(?P<path>[()\d\.\{\}\s]+)?(?P<origin_code>[e|i\?])?$')
p5_1 = re.compile(r'(?P<path>[()\d\.\{\}\s]+)(?P<origin_code>e|i)?$')
p6 = re.compile(
r'^Processed *(?P<processed_prefixes>[0-9]+) *prefixes, *(?P<processed_paths>[0-9]+) *paths$')

Expand Down Expand Up @@ -5262,8 +5266,9 @@ def cli(self, vrf_type='all', address_family='', instance='all', vrf='all', outp

# 2219 0 200 33299 51178 47751 {27016} e
# 2219 0 200 33299 51178 47751 {27016} 65107.65107 e
# 0 500 (64630 64601) 39935 i
p16_2 = re.compile(r'^\s*(?P<metric>[0-9]+) +(?P<weight>[0-9]+)'
r' +(?P<path>[0-9\.\{\}\s]+) '
r' +(?P<path>[()0-9\.\{\}\s]+) '
r'+(?P<origin_codes>(i|e|\?))$')

# Network Next Hop Metric LocPrf Weight Path
Expand All @@ -5280,13 +5285,14 @@ def cli(self, vrf_type='all', address_family='', instance='all', vrf='all', outp
# *>i10.169.1.0/24 10.64.4.4 2219 100 0 300 33299 51178 47751 {27016} e
# *>i192.168.111.0/24 10.189.99.98 0 0 i
# *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ?
# *> 195.95.138.0/24 213.140.196.60 0 120 500 (64630 64601) 39935 i
p16 = re.compile(r'^(?P<status_codes>(i|s|x|S|d|h|\*|\>|\s)+)'
r' *(?P<prefix>(?P<ip>[0-9\.\:\[\]]+)\/(?P<mask>\d+))?'
r' +(?P<next_hop>\S+) +(?P<number>[\d\.\s\{\}]+)'
r' *(?P<prefix>(?P<ip>[a-z0-9\.\:\[\]]+)\/(?P<mask>\d+))?'
r' +(?P<next_hop>\S+) +(?P<number>[()\d\.\s\{\}]+)'
r'(?: *(?P<origin_codes>(i|e|\?)))?$')

# 65107.65107 ?
p17 = re.compile(r'(?P<path>[\d\.\s]+)'
p17 = re.compile(r'(?P<path>[()\d\.\s]+)'
r' *(?P<origin_codes>(i|e|\?))?$')

# Processed 40 prefixes, 50 paths
Expand Down Expand Up @@ -5513,9 +5519,9 @@ def cli(self, vrf_type='all', address_family='', instance='all', vrf='all', outp

# Parse and set the numbers
group_num = group['number']
m1 = re.compile(r'^(?P<metric>[0-9]+) +(?P<locprf>[0-9]+) +(?P<weight>[0-9]+) (?P<path>[0-9\.\{\}\s]+)$').match(group_num)
m2 = re.compile(r'^(?P<value>[0-9]+)(?P<space>\s{2,20})(?P<weight>[0-9]+) (?P<path>[0-9\.\{\}\s]+)$').match(group_num)
m3 = re.compile(r'^(?P<weight>[0-9]+) (?P<path>(([\d\.]+\s)|(\{[\d\.]+\}\s))+)$').match(group_num)
m1 = re.compile(r'^(?P<metric>[0-9]+) +(?P<locprf>[0-9]+) +(?P<weight>[0-9]+) (?P<path>[()0-9\.\{\}\s]+)$').match(group_num)
m2 = re.compile(r'^(?P<value>[0-9]+)(?P<space>\s{2,20})(?P<weight>[0-9]+) (?P<path>[()0-9\.\{\}\s]+)$').match(group_num)
m3 = re.compile(r'^(?P<weight>[0-9]+) (?P<path>(([()\d\.]+\s)|(\{[\d\.]+\}\s))+)$').match(group_num)
m4 = re.compile(r'^(?P<locprf>(\d+)) +(?P<weight>(\d+))$').match(group_num.strip())
if m1:
pfx_dict['metric'] = m1.groupdict()['metric']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,52 @@
"weight": "0"
}
}
},
"80.244.17.144/29": {
"index": {
1: {
"metric": "120",
"locprf": "100",
"next_hop": "80.244.17.126",
"origin_codes": "?",
"path": "(64622)",
"status_codes": "*>",
"weight": "0"
},
2: {
"metric": "100",
"locprf": "100",
"next_hop": "213.140.196.36",
"origin_codes": "?",
"path": "(64630 64615 64622)",
"status_codes": "*",
"weight": "0"
}
}
},
"80.244.96.160/27": {
"index": {
1: {
"locprf": "100",
"next_hop": "213.140.196.20",
"origin_codes": "?",
"path": "(64630 64609) 6762 4445 3209 21334",
"status_codes": "*>",
"weight": "0"
},
2: {
"locprf": "100",
"next_hop": "213.140.196.20",
"origin_codes": "?",
"path": "(64629 64601 64630 64609) 6762 4445 3209 21334",
"status_codes": "*",
"weight": "0"
}
}
}
},
"processed_paths": 6,
"processed_prefix": 4,
"processed_paths": 10,
"processed_prefix": 6,
"rd_version": 16,
"router_identifier": "10.10.10.108",
"scan_interval": 60,
Expand Down Expand Up @@ -161,10 +203,65 @@
"weight": "32768"
}
}
},
"2400:cb00:203::/48": {
"index": {
1: {
"locprf": "120",
"next_hop": "2a02:540:5::1",
"origin_codes": "i",
"path": "(64605 64628 64630) 13335",
"status_codes": "*",
"weight": "0"
},
2: {
"locprf": "120",
"next_hop": "2a02:540:13::1",
"origin_codes": "i",
"path": "(64630) 13335",
"status_codes": "*>",
"weight": "500"
}
}
},
"2a02:540::/32": {
"index": {
1: {
"metric": "0",
"locprf": "120",
"next_hop": "2a02:540:13::1",
"origin_codes": "i",
"path": "(64630)",
"status_codes": "*>",
"weight": "500"
}
}
},
"2a0c:5cc0::/29": {
"index": {
1: {
"metric": "0",
"locprf": "120",
"next_hop": "2a02:540:5::1",
"origin_codes": "i",
"path": "(64605 64628 64603) 197648",
"status_codes": "*",
"weight": "0"
},
2: {
"metric": "0",
"locprf": "120",
"next_hop": "2a02:540:13::1",
"origin_codes": "i",
"path": "(64630 64601 64629 64628 64603) 197648",
"status_codes": "*>",
"weight": "500"
}
}
}
},
"processed_paths": 7,
"processed_prefix": 6,
"processed_paths": 12,
"processed_prefix": 9,
"rd_version": 15,
"router_identifier": "10.10.10.108",
"scan_interval": 60,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ Origin codes: i - IGP, e - EGP, ? - incomplete
* 10.10.10.107 0 0 65107.65107 ?
*> 192.168.52.0/24 0.0.0.0 0 32768 ?
* 10.10.10.107 0 0 65107.65107 ?
*> 80.244.17.144/29 80.244.17.126 120 100 0 (64622) ?
* 213.140.196.36 100 100 0 (64630 64615 64622) ?
*> 80.244.96.160/27 213.140.196.20 100 0 (64630 64609) 6762 4445 3209 21334 ?
* 213.140.196.20 100 0 (64629 64601 64630 64609) 6762 4445 3209 21334 ?

Processed 4 prefixes, 6 paths
Processed 6 prefixes, 10 paths

Address Family: IPv6 Unicast
----------------------------
Expand Down Expand Up @@ -58,5 +62,10 @@ Origin codes: i - IGP, e - EGP, ? - incomplete
0 0 65107.65107 ?
*> 2001:2001:2001:2001:2001::7/128
:: 0 32768 ?
* 2400:cb00:203::/48 2a02:540:5::1 120 0 (64605 64628 64630) 13335 i
*> 2a02:540:13::1 120 500 (64630) 13335 i
*> 2a02:540::/32 2a02:540:13::1 0 120 500 (64630) i
* 2a0c:5cc0::/29 2a02:540:5::1 0 120 0 (64605 64628 64603) 197648 i
*> 2a02:540:13::1 0 120 500 (64630 64601 64629 64628 64603) 197648 i

Processed 6 prefixes, 7 paths
Processed 9 prefixes, 12 paths
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,30 @@
"path": "65108.65108"
}
}
},
"82.102.71.0/24": {
"index": {
1: {
"froms": "193.22.30.151",
"next_hop": "213.140.196.25",
"origin_code": "i",
"path": "(64612) 8544"
}
}
},
"82.102.72.0/24": {
"index": {
1: {
"froms": "193.22.30.151",
"next_hop": "213.140.196.25",
"origin_code": "i",
"path": "(64612) 8544 30916"
}
}
}
},
"processed_paths": "3",
"processed_prefixes": "3"
"processed_paths": "5",
"processed_prefixes": "5"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Network Next Hop From AS Path
10.8.8.8/32 10.10.10.108 Local 65108.65108?
10.10.10.0/24 10.10.10.108 Local 65108.65108?
192.168.52.0/24 10.10.10.108 Local 65108.65108?
82.102.71.0/24 213.140.196.25 193.22.30.151 (64612) 8544i
82.102.72.0/24 213.140.196.25 193.22.30.151 (64612) 8544 30916i

Processed 3 prefixes, 3 paths
Processed 5 prefixes, 5 paths

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"nsr_initial_init_ver_status": "reached",
"nsr_initial_initsync_version": "3",
"nsr_issu_sync_group_versions": "0/0",
"processed_paths": 3,
"processed_prefixes": 3,
"processed_paths": 6,
"processed_prefixes": 6,
"rd_version": 8,
"router_identifier": "10.10.10.108",
"routes": {
Expand Down Expand Up @@ -51,6 +51,44 @@
"weight": "0"
}
}
},
"195.95.138.0/24": {
"index": {
1: {
"locprf": "120",
"metric": "0",
"next_hop": "213.140.196.60",
"origin_codes": "i",
"path": "(64630 64601) 39935",
"status_codes": "*>",
"weight": "500"
}
}
},
"212.31.118.0/23": {
"index": {
1: {
"locprf": "120",
"next_hop": "213.140.196.60",
"origin_codes": "i",
"path": "(64630 64601) 50233",
"status_codes": "*>",
"weight": "500"
}
}
},
"212.50.96.0/19": {
"index": {
1: {
"locprf": "120",
"metric": "0",
"next_hop": "213.140.196.60",
"origin_codes": "i",
"path": "(64630)",
"status_codes": "*>",
"weight": "500"
}
}
}
},
"routing_table_version": 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ Origin codes: i - IGP, e - EGP, ? - incomplete
*> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ?
* 10.10.10.0/24 10.10.10.107 0 0 65107.65107 ?
* 192.168.52.0/24 10.10.10.107 0 0 65107.65107 ?
*> 195.95.138.0/24 213.140.196.60 0 120 500 (64630 64601) 39935 i
*> 212.31.118.0/23 213.140.196.60 120 500 (64630 64601) 50233 i
*> 212.50.96.0/19 213.140.196.60 0 120 500 (64630) i

Processed 3 prefixes, 3 paths
Processed 6 prefixes, 6 paths