Add the json support from ISIS vty command.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-{
- "1": {
- "level-1": {
- "ipv4": [
- {
- "vertex": "r1"
- }
- ],
- "ipv6": [
- {
- "vertex": "r1"
- }
- ]
- },
- "level-2": {
- "ipv4": [
- {
- "vertex": "r1"
- },
- {
- "metric": "0",
- "parent": "r1(4)",
- "type": "IP internal",
- "vertex": "10.0.20.0/24"
- },
- {
- "interface": "r1-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r1(4)",
- "type": "TE-IS",
- "vertex": "r3"
- },
- {
- "interface": "r1-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.0.10.0/24"
- },
- {
- "interface": "r1-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.0.20.0/24"
- },
- {
- "interface": "r1-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.254.0.3/32"
- }
- ],
- "ipv6": [
- {
- "vertex": "r1"
- },
- {
- "metric": "0",
- "parent": "r1(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:1::/64"
- },
- {
- "interface": "r1-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r1(4)",
- "type": "TE-IS",
- "vertex": "r3"
- },
- {
- "metric": "10",
- "interface": "r1-eth0",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:1::/64"
+[
+ {
+ "area": "1",
+ "algorithm": 0,
+ "level-1": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r1"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r1"
+ }
+ ]
},
- {
- "metric": "10",
- "interface": "r1-eth0",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::3/128"
+ "level-2": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r1"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r1(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.20.0/24"
+ },
+ {
+ "Interface": "r1-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r1(4)",
+ "Type": "TE-IS",
+ "Vertex": "r3"
+ },
+ {
+ "Interface": "r1-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.10.0/24"
+ },
+ {
+ "Interface": "r1-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.20.0/24"
+ },
+ {
+ "Interface": "r1-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.3/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r1"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r1(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:1::/64"
+ },
+ {
+ "Interface": "r1-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r1(4)",
+ "Type": "TE-IS",
+ "Vertex": "r3"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r1-eth0",
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:1::/64"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r1-eth0",
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::3/128"
+ }
+ ]
}
- ]
}
- }
-}
+]
-{
- "1": {
- "level-1": {
- "ipv4": [
- {
- "vertex": "r2"
- }
- ],
- "ipv6": [
- {
- "vertex": "r2"
- }
- ]
- },
- "level-2": {
- "ipv4": [
- {
- "vertex": "r2"
- },
- {
- "metric": "0",
- "parent": "r2(4)",
- "type": "IP internal",
- "vertex": "10.0.21.0/24"
- },
- {
- "interface": "r2-eth0",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r2(4)",
- "type": "TE-IS",
- "vertex": "r4"
- },
- {
- "interface": "r2-eth0",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.0.11.0/24"
- },
- {
- "interface": "r2-eth0",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.0.21.0/24"
- },
- {
- "interface": "r2-eth0",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.254.0.4/32"
- }
- ],
- "ipv6": [
- {
- "vertex": "r2"
- },
- {
- "metric": "0",
- "parent": "r2(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:2::/64"
- },
- {
- "interface": "r2-eth0",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r2(4)",
- "type": "TE-IS",
- "vertex": "r4"
- },
- {
- "metric": "10",
- "interface": "r2-eth0",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:2::/64"
+[
+ {
+ "area": "1",
+ "algorithm": 0,
+ "level-1": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r2"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r2"
+ }
+ ]
},
- {
- "metric": "10",
- "interface": "r2-eth0",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::4/128"
+ "level-2": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r2"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r2(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.21.0/24"
+ },
+ {
+ "Interface": "r2-eth0",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r2(4)",
+ "Type": "TE-IS",
+ "Vertex": "r4"
+ },
+ {
+ "Interface": "r2-eth0",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.11.0/24"
+ },
+ {
+ "Interface": "r2-eth0",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.21.0/24"
+ },
+ {
+ "Interface": "r2-eth0",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.4/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r2"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r2(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:2::/64"
+ },
+ {
+ "Interface": "r2-eth0",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r2(4)",
+ "Type": "TE-IS",
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r2-eth0",
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:2::/64"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r2-eth0",
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::4/128"
+ }
+ ]
}
- ]
}
- }
-}
+]
-{
- "1": {
- "level-1": {
- "ipv4": [
- {
- "vertex": "r3"
- },
- {
- "metric": "0",
- "parent": "r3(4)",
- "type": "IP internal",
- "vertex": "10.0.10.0/24"
- },
- {
- "interface": "r3-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r3(4)",
- "type": "TE-IS",
- "vertex": "r5"
- },
- {
- "interface": "r3-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP TE",
- "vertex": "10.0.10.0/24"
- },
- {
- "interface": "r3-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP TE",
- "vertex": "10.0.11.0/24"
- },
- {
- "interface": "r3-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP TE",
- "vertex": "10.254.0.5/32"
- },
- {
- "interface": "r3-eth1",
- "metric": "20",
- "next-hop": "r5",
- "type": "TE-IS",
- "vertex": "r4"
- },
- {
- "interface": "r3-eth1",
- "metric": "20",
- "next-hop": "r5",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.0.21.0/24"
- },
- {
- "interface": "r3-eth1",
- "metric": "20",
- "next-hop": "r5",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.254.0.4/32"
- }
- ],
- "ipv6": [
- {
- "vertex": "r3"
- },
- {
- "metric": "0",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:1::/64"
- },
- {
- "interface": "r3-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r3(4)",
- "type": "TE-IS",
- "vertex": "r5"
- },
- {
- "metric": "10",
- "interface": "r3-eth1",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:2::/64"
- },
- {
- "metric": "10",
- "interface": "r3-eth1",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::5/128"
- },
- {
- "interface": "r3-eth1",
- "metric": "20",
- "next-hop": "r5",
- "type": "TE-IS",
- "vertex": "r4"
- },
- {
- "metric": "20",
- "interface": "r3-eth1",
- "next-hop": "r5",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:2::/64"
- },
- {
- "metric": "20",
- "interface": "r3-eth1",
- "next-hop": "r5",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::4/128"
- }
- ]
- },
- "level-2": {
- "ipv4": [
- {
- "vertex": "r3"
- },
- {
- "metric": "0",
- "parent": "r3(4)",
- "type": "IP internal",
- "vertex": "10.0.20.0/24"
- },
- {
- "interface": "r3-eth0",
- "metric": "10",
- "next-hop": "r1",
- "parent": "r3(4)",
- "type": "TE-IS",
- "vertex": "r1"
- },
- {
- "interface": "r3-eth0",
- "metric": "10",
- "next-hop": "r1",
- "parent": "r1(4)",
- "type": "IP TE",
- "vertex": "10.0.20.0/24"
- },
- {
- "interface": "r3-eth0",
- "metric": "10",
- "next-hop": "r1",
- "parent": "r1(4)",
- "type": "IP TE",
- "vertex": "10.254.0.1/32"
- }
- ],
- "ipv6": [
- {
- "vertex": "r3"
- },
- {
- "metric": "0",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:1::/64"
- },
- {
- "interface": "r3-eth0",
- "metric": "10",
- "next-hop": "r1",
- "parent": "r3(4)",
- "type": "TE-IS",
- "vertex": "r1"
- },
- {
- "metric": "10",
- "interface": "r3-eth0",
- "next-hop": "r1",
- "parent": "r1(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::1/128"
+[
+ {
+ "area": "1",
+ "algorithm": 0,
+ "level-1": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r3"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r3(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.10.0/24"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r3(4)",
+ "Type": "TE-IS",
+ "Vertex": "r5"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.10.0/24"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.11.0/24"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.5/32"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Type": "TE-IS",
+ "Vertex": "r4"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.21.0/24"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.4/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r3"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:1::/64"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r3(4)",
+ "Type": "TE-IS",
+ "Vertex": "r5"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r3-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:2::/64"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r3-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::5/128"
+ },
+ {
+ "Interface": "r3-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Type": "TE-IS",
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 20,
+ "Interface": "r3-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:2::/64"
+ },
+ {
+ "Metric": 20,
+ "Interface": "r3-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::4/128"
+ }
+ ]
+ },
+ "level-2": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r3"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r3(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.20.0/24"
+ },
+ {
+ "Interface": "r3-eth0",
+ "Metric": 10,
+ "Next-Hop": "r1",
+ "Parent": "r3(4)",
+ "Type": "TE-IS",
+ "Vertex": "r1"
+ },
+ {
+ "Interface": "r3-eth0",
+ "Metric": 10,
+ "Next-Hop": "r1",
+ "Parent": "r1(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.20.0/24"
+ },
+ {
+ "Interface": "r3-eth0",
+ "Metric": 10,
+ "Next-Hop": "r1",
+ "Parent": "r1(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.1/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r3"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:1::/64"
+ },
+ {
+ "Interface": "r3-eth0",
+ "Metric": 10,
+ "Next-Hop": "r1",
+ "Parent": "r3(4)",
+ "Type": "TE-IS",
+ "Vertex": "r1"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r3-eth0",
+ "Next-Hop": "r1",
+ "Parent": "r1(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::1/128"
+ }
+ ]
}
- ]
}
- }
-}
+]
-{
- "1": {
- "level-1": {
- "ipv4": [
- {
- "vertex": "r4"
- },
- {
- "metric": "0",
- "parent": "r4(4)",
- "type": "IP internal",
- "vertex": "10.0.11.0/24"
- },
- {
- "interface": "r4-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r4(4)",
- "type": "TE-IS",
- "vertex": "r5"
- },
- {
- "interface": "r4-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP TE",
- "vertex": "10.0.10.0/24"
- },
- {
- "interface": "r4-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP TE",
- "vertex": "10.0.11.0/24"
- },
- {
- "interface": "r4-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP TE",
- "vertex": "10.254.0.5/32"
- },
- {
- "interface": "r4-eth1",
- "metric": "20",
- "next-hop": "r5",
- "type": "TE-IS",
- "vertex": "r3"
- },
- {
- "interface": "r4-eth1",
- "metric": "20",
- "next-hop": "r5",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.0.20.0/24"
- },
- {
- "interface": "r4-eth1",
- "metric": "20",
- "next-hop": "r5",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.254.0.3/32"
- }
- ],
- "ipv6": [
- {
- "vertex": "r4"
- },
- {
- "metric": "0",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:2::/64"
- },
- {
- "interface": "r4-eth1",
- "metric": "10",
- "next-hop": "r5",
- "parent": "r4(4)",
- "type": "TE-IS",
- "vertex": "r5"
- },
- {
- "metric": "10",
- "interface": "r4-eth1",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:1::/64"
- },
- {
- "metric": "10",
- "interface": "r4-eth1",
- "next-hop": "r5",
- "parent": "r5(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::5/128"
- },
- {
- "interface": "r4-eth1",
- "metric": "20",
- "next-hop": "r5",
- "type": "TE-IS",
- "vertex": "r3"
- },
- {
- "metric": "20",
- "interface": "r4-eth1",
- "next-hop": "r5",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:1::/64"
- },
- {
- "metric": "20",
- "interface": "r4-eth1",
- "next-hop": "r5",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::3/128"
- }
- ]
- },
- "level-2": {
- "ipv4": [
- {
- "vertex": "r4"
- },
- {
- "metric": "0",
- "parent": "r4(4)",
- "type": "IP internal",
- "vertex": "10.0.21.0/24"
- },
- {
- "interface": "r4-eth0",
- "metric": "10",
- "next-hop": "r2",
- "parent": "r4(4)",
- "type": "TE-IS",
- "vertex": "r2"
- },
- {
- "interface": "r4-eth0",
- "metric": "10",
- "next-hop": "r2",
- "parent": "r2(4)",
- "type": "IP TE",
- "vertex": "10.0.21.0/24"
- },
- {
- "interface": "r4-eth0",
- "metric": "10",
- "next-hop": "r2",
- "parent": "r2(4)",
- "type": "IP TE",
- "vertex": "10.254.0.2/32"
- }
- ],
- "ipv6": [
- {
- "vertex": "r4"
- },
- {
- "metric": "0",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:2::/64"
- },
- {
- "interface": "r4-eth0",
- "metric": "10",
- "next-hop": "r2",
- "parent": "r4(4)",
- "type": "TE-IS",
- "vertex": "r2"
- },
- {
- "metric": "10",
- "interface": "r4-eth0",
- "next-hop": "r2",
- "parent": "r2(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::2/128"
+[
+ {
+ "area": "1",
+ "algorithm": 0,
+ "level-1": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r4(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.11.0/24"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r4(4)",
+ "Type": "TE-IS",
+ "Vertex": "r5"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.10.0/24"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.11.0/24"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.5/32"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Type": "TE-IS",
+ "Vertex": "r3"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.20.0/24"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.3/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:2::/64"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 10,
+ "Next-Hop": "r5",
+ "Parent": "r4(4)",
+ "Type": "TE-IS",
+ "Vertex": "r5"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r4-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:1::/64"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r4-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r5(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::5/128"
+ },
+ {
+ "Interface": "r4-eth1",
+ "Metric": 20,
+ "Next-Hop": "r5",
+ "Type": "TE-IS",
+ "Vertex": "r3"
+ },
+ {
+ "Metric": 20,
+ "Interface": "r4-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:1::/64"
+ },
+ {
+ "Metric": 20,
+ "Interface": "r4-eth1",
+ "Next-Hop": "r5",
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::3/128"
+ }
+ ]
+ },
+ "level-2": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r4(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.21.0/24"
+ },
+ {
+ "Interface": "r4-eth0",
+ "Metric": 10,
+ "Next-Hop": "r2",
+ "Parent": "r4(4)",
+ "Type": "TE-IS",
+ "Vertex": "r2"
+ },
+ {
+ "Interface": "r4-eth0",
+ "Metric": 10,
+ "Next-Hop": "r2",
+ "Parent": "r2(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.21.0/24"
+ },
+ {
+ "Interface": "r4-eth0",
+ "Metric": 10,
+ "Next-Hop": "r2",
+ "Parent": "r2(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.2/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:2::/64"
+ },
+ {
+ "Interface": "r4-eth0",
+ "Metric": 10,
+ "Next-Hop": "r2",
+ "Parent": "r4(4)",
+ "Type": "TE-IS",
+ "Vertex": "r2"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r4-eth0",
+ "Next-Hop": "r2",
+ "Parent": "r2(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::2/128"
+ }
+ ]
}
- ]
}
- }
-}
+]
-{
- "1": {
- "level-1": {
- "ipv4": [
- {
- "vertex": "r5"
- },
- {
- "metric": "0",
- "parent": "r5(4)",
- "type": "IP internal",
- "vertex": "10.0.10.0/24"
- },
- {
- "metric": "0",
- "parent": "r5(4)",
- "type": "IP internal",
- "vertex": "10.0.11.0/24"
- },
- {
- "interface": "r5-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r5(4)",
- "type": "TE-IS",
- "vertex": "r3"
- },
- {
- "interface": "r5-eth1",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r5(4)",
- "type": "TE-IS",
- "vertex": "r4"
- },
- {
- "interface": "r5-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.0.10.0/24"
- },
- {
- "interface": "r5-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.0.20.0/24"
- },
- {
- "interface": "r5-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP TE",
- "vertex": "10.254.0.3/32"
- },
- {
- "interface": "r5-eth1",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.0.11.0/24"
- },
- {
- "interface": "r5-eth1",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.0.21.0/24"
- },
- {
- "interface": "r5-eth1",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP TE",
- "vertex": "10.254.0.4/32"
+[
+ {
+ "area": "1",
+ "algorithm": 0,
+ "level-1": {
+ "ipv4-paths": [
+ {
+ "Vertex": "r5"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r5(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.10.0/24"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r5(4)",
+ "Type": "IP internal",
+ "Vertex": "10.0.11.0/24"
+ },
+ {
+ "Interface": "r5-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r5(4)",
+ "Type": "TE-IS",
+ "Vertex": "r3"
+ },
+ {
+ "Interface": "r5-eth1",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r5(4)",
+ "Type": "TE-IS",
+ "Vertex": "r4"
+ },
+ {
+ "Interface": "r5-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.10.0/24"
+ },
+ {
+ "Interface": "r5-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.20.0/24"
+ },
+ {
+ "Interface": "r5-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.3/32"
+ },
+ {
+ "Interface": "r5-eth1",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.11.0/24"
+ },
+ {
+ "Interface": "r5-eth1",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.0.21.0/24"
+ },
+ {
+ "Interface": "r5-eth1",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP TE",
+ "Vertex": "10.254.0.4/32"
+ }
+ ],
+ "ipv6-paths": [
+ {
+ "Vertex": "r5"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r5(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:1::/64"
+ },
+ {
+ "Metric": 0,
+ "Parent": "r5(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:2:2::/64"
+ },
+ {
+ "Interface": "r5-eth0",
+ "Metric": 10,
+ "Next-Hop": "r3",
+ "Parent": "r5(4)",
+ "Type": "TE-IS",
+ "Vertex": "r3"
+ },
+ {
+ "Interface": "r5-eth1",
+ "Metric": 10,
+ "Next-Hop": "r4",
+ "Parent": "r5(4)",
+ "Type": "TE-IS",
+ "Vertex": "r4"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r5-eth0",
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:1::/64"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r5-eth0",
+ "Next-Hop": "r3",
+ "Parent": "r3(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::3/128"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r5-eth1",
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:1:2::/64"
+ },
+ {
+ "Metric": 10,
+ "Interface": "r5-eth1",
+ "Next-Hop": "r4",
+ "Parent": "r4(4)",
+ "Type": "IP6 internal",
+ "Vertex": "2001:db8:f::4/128"
+ }
+ ]
}
- ],
- "ipv6": [
- {
- "vertex": "r5"
- },
- {
- "metric": "0",
- "parent": "r5(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:1::/64"
- },
- {
- "metric": "0",
- "parent": "r5(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:2:2::/64"
- },
- {
- "interface": "r5-eth0",
- "metric": "10",
- "next-hop": "r3",
- "parent": "r5(4)",
- "type": "TE-IS",
- "vertex": "r3"
- },
- {
- "interface": "r5-eth1",
- "metric": "10",
- "next-hop": "r4",
- "parent": "r5(4)",
- "type": "TE-IS",
- "vertex": "r4"
- },
- {
- "metric": "10",
- "interface": "r5-eth0",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:1::/64"
- },
- {
- "metric": "10",
- "interface": "r5-eth0",
- "next-hop": "r3",
- "parent": "r3(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::3/128"
- },
- {
- "metric": "10",
- "interface": "r5-eth1",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:1:2::/64"
- },
- {
- "metric": "10",
- "interface": "r5-eth1",
- "next-hop": "r4",
- "parent": "r4(4)",
- "type": "IP6 internal",
- "vertex": "2001:db8:f::4/128"
- }
- ]
- },
- "level-2": {
- "ipv4": [],
- "ipv6": []
}
- }
-}
+]
pytest.skip(tgen.errors)
logger.info("waiting for ISIS protocol to converge")
- # Code to generate the json files.
- # for rname, router in tgen.routers().items():
- # open('/tmp/{}_topology.json'.format(rname), 'w').write(
- # json.dumps(show_isis_topology(router), indent=2, sort_keys=True)
- # )
-
for rname, router in tgen.routers().items():
filename = "{0}/{1}/{1}_topology.json".format(CWD, rname)
expected = json.loads(open(filename).read())
def compare_isis_topology(router, expected):
"Helper function to test ISIS topology convergence."
- actual = show_isis_topology(router)
+ actual = json.loads(router.vtysh_cmd("show isis topology json"))
return topotest.json_cmp(actual, expected)
test_func = functools.partial(compare_isis_topology, router, expected)
continue
return areas
-
-
-def show_isis_topology(router):
- """
- Get the ISIS topology in a dictionary format.
-
- Sample:
- {
- 'area-name': {
- 'level-1': [
- {
- 'vertex': 'r1'
- }
- ],
- 'level-2': [
- {
- 'vertex': '10.0.0.1/24',
- 'type': 'IP',
- 'parent': '0',
- 'metric': 'internal'
- }
- ]
- },
- 'area-name-2': {
- 'level-2': [
- {
- "interface": "rX-ethY",
- "metric": "Z",
- "next-hop": "rA",
- "parent": "rC(B)",
- "type": "TE-IS",
- "vertex": "rD"
- }
- ]
- }
- }
- """
- l1out = topotest.normalize_text(
- router.vtysh_cmd("show isis topology level-1")
- ).splitlines()
- l2out = topotest.normalize_text(
- router.vtysh_cmd("show isis topology level-2")
- ).splitlines()
-
- l1 = parse_topology(l1out, "level-1")
- l2 = parse_topology(l2out, "level-2")
-
- dict_merge(l1, l2)
- return l1