Skip to content

Commit

Permalink
Update main.py - basic VRF support. Need to add UI components to dist…
Browse files Browse the repository at this point in the history
…inguish VRFs
  • Loading branch information
knewell committed Mar 16, 2019
1 parent c12a94d commit a28a5cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def getActiveFlowRoutes(self):

# data = dev.rpc.get_config(filter_xml='routing-options/flow/route/name')
frt = FlowRoutesTable(dev)
for flowtable in ['inetflow.0', 'inet6flow.0']:
for flowtable in ['inetflow.0', 'inet6flow.0', 'trcps.inetflow.0', 'trcps.inet6flow.0']:
frt.get(table=flowtable)

for flow in frt:
Expand Down Expand Up @@ -262,7 +262,7 @@ def getActiveFlowRouteFilter(self):
with Device(host=value['ip'], user=self.dev_user, password=self.dev_pw) as dev:

frft = FlowFilterTable(dev)
for table in ['__flowspec_default_inet__', '__flowspec_default_inet6__']:
for table in ['__flowspec_default_inet__', '__flowspec_default_inet6__', '__flowspec_trcps_inet__', '__flowspec_trcps_inet6__']:
frft.get(filtername=table)

for filter in frft:
Expand Down Expand Up @@ -299,6 +299,10 @@ def loadFlowRouteConfig(self):

# Retrieving all routing-options so we can get both v4 and v6. Might also work for VRFs
data = dev.rpc.get_config(options={'format': 'xml'}, filter_xml='routing-options')
# Retrieving all routing-instances. Should figure out how to limit to specified VRFs
data_trcps = dev.rpc.get_config(options={'format': 'xml'}, filter_xml='routing-instances')

data.append(data_trcps)

# iterate only over <flow> children. Appears to enter into multiple levels implicitly
for routes in data.iter('flow'):
Expand Down

0 comments on commit a28a5cb

Please sign in to comment.