-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexternal_pointers.pl
More file actions
55 lines (53 loc) · 1.8 KB
/
Copy pathexternal_pointers.pl
File metadata and controls
55 lines (53 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#regexes for commands that refer to other lists of some sort
#
#NOTE THAT THESE ARE DYNAMICALLY CONSTRUCTED FOR EACH FILE BASED ON THE
#POINTEES WE FOUND IN IT (via $list_of_pointees_ref->{"acl"} for example)
#
#Note that the keys/categories in pointers and pointees match (acl, route_map etc)
#This is so we can linkify properly
#You must keep pointers/pointees categories in sync
#
#Each first level key/category is the type of item referenced in the command
#Named capture "points_to" is what to match with %pointees{$pointed_at} hash
'ip_address' => {
1 => qr/^ \s+
(?: permit | deny ) \s+
.*?
host \s+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
2 => qr/^ \s+
neighbor \s+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
3 => qr/\w+ \s+
source-ip \s+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
4 => qr/^ \s*
ip \s+
route \s+
(?: vrf \S+ \s+)?
$RE{net}{IPv4} \s+
$RE{net}{IPv4} \s+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
5 => qr/^ \s*
ip \s+
route \s+
(?: vrf \S+ \s+)?
$RE{net}{IPv4} \/ \d+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
6 => qr/^ \s*
ip \s+
default-gateway \s+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
7 => qr/^ \s*
peer \s+
ip \s+
address \s+
(?<external_ipv4> $RE{net}{IPv4})
/ixsm,
},