Skip to content

Commit

Permalink
parse path-info for announce attributes #1147
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Mar 29, 2023
1 parent e68e8a8 commit 48478fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/exabgp/configuration/static/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from exabgp.configuration.static.mpls import label
from exabgp.configuration.static.mpls import route_distinguisher
from exabgp.configuration.static.parser import path_information


class ParseStatic(ParseStaticRoute):
Expand Down Expand Up @@ -85,6 +86,10 @@ def route(tokeniser):
nlri.rd = route_distinguisher(tokeniser)
continue

if command == 'path-information':
nlri.path_info = path_information(tokeniser)
continue

action = ParseStatic.action.get(command, '')

if action == 'attribute-add':
Expand Down Expand Up @@ -122,6 +127,7 @@ def attributes(tokeniser):

labels = None
rd = None
path_info = None

while True:
command = tokeniser()
Expand All @@ -140,6 +146,10 @@ def attributes(tokeniser):
rd = route_distinguisher(tokeniser)
continue

if command == 'path-information':
path_info = path_information(tokeniser)
continue

action = ParseStatic.action[command]

if action == 'attribute-add':
Expand All @@ -166,6 +176,8 @@ def attributes(tokeniser):
new.nlri.labels = labels
if rd:
new.nlri.rd = rd
if path_info:
new.nlri.path_info = path_info
new.nlri.nexthop = nlri.nexthop
changes.append(new)

Expand Down

0 comments on commit 48478fc

Please sign in to comment.