GUI -- TopoView - capture source and target port numbers on link models.
- "traffic" scenario: made all port numbers unique. Change-Id: I98f0153e2523d0ad451f92ee1e63e9c12f8428d7
Showing
10 changed files
with
29 additions
and
26 deletions
... | @@ -109,7 +109,7 @@ | ... | @@ -109,7 +109,7 @@ |
109 | if (p.x > line.x1 && p.x > line.x2) return false; | 109 | if (p.x > line.x1 && p.x > line.x2) return false; |
110 | if (p.y < line.y1 && p.y < line.y2) return false; | 110 | if (p.y < line.y1 && p.y < line.y2) return false; |
111 | if (p.y > line.y1 && p.y > line.y2) return false; | 111 | if (p.y > line.y1 && p.y > line.y2) return false; |
112 | - // line bisects, but are we close enough? | 112 | + // line intersects, but are we close enough? |
113 | return mdist(p, m) <= proximity; | 113 | return mdist(p, m) <= proximity; |
114 | } | 114 | } |
115 | 115 | ||
... | @@ -190,12 +190,11 @@ | ... | @@ -190,12 +190,11 @@ |
190 | 190 | ||
191 | function unenhance(d) { | 191 | function unenhance(d) { |
192 | d.el.classed('enhanced', false); | 192 | d.el.classed('enhanced', false); |
193 | - $log.debug('UN-enhancing link: ', d.key); | ||
194 | } | 193 | } |
195 | 194 | ||
196 | function enhance(d) { | 195 | function enhance(d) { |
197 | d.el.classed('enhanced', true); | 196 | d.el.classed('enhanced', true); |
198 | - $log.debug('enhancing link: ', d.key); | 197 | + $log.debug('[' + (d.srcPort || 'H') + '] ---> [' + d.tgtPort + ']', d.key); |
199 | } | 198 | } |
200 | 199 | ||
201 | 200 | ... | ... |
... | @@ -158,6 +158,8 @@ | ... | @@ -158,6 +158,8 @@ |
158 | angular.extend(lnk, { | 158 | angular.extend(lnk, { |
159 | key: id, | 159 | key: id, |
160 | class: 'link', | 160 | class: 'link', |
161 | + // NOTE: srcPort left undefined (host end of the link) | ||
162 | + tgtPort: host.cp.port, | ||
161 | 163 | ||
162 | type: function () { return 'hostLink'; }, | 164 | type: function () { return 'hostLink'; }, |
163 | online: function () { | 165 | online: function () { |
... | @@ -180,6 +182,8 @@ | ... | @@ -180,6 +182,8 @@ |
180 | key: link.id, | 182 | key: link.id, |
181 | class: 'link', | 183 | class: 'link', |
182 | fromSource: link, | 184 | fromSource: link, |
185 | + srcPort: link.srcPort, | ||
186 | + tgtPort: link.dstPort, | ||
183 | 187 | ||
184 | // functions to aggregate dual link state | 188 | // functions to aggregate dual link state |
185 | type: function () { | 189 | type: function () { |
... | @@ -218,7 +222,7 @@ | ... | @@ -218,7 +222,7 @@ |
218 | } | 222 | } |
219 | return { | 223 | return { |
220 | source: srcNode, | 224 | source: srcNode, |
221 | - target: dstNode, | 225 | + target: dstNode |
222 | }; | 226 | }; |
223 | } | 227 | } |
224 | 228 | ... | ... |
1 | { | 1 | { |
2 | "event": "addLink", | 2 | "event": "addLink", |
3 | "payload": { | 3 | "payload": { |
4 | - "id": "of:0000ffffffff0008/4-of:0000ffffffffff08/1", | 4 | + "id": "of:0000ffffffff0008/5-of:0000ffffffffff08/11", |
5 | "type": "direct", | 5 | "type": "direct", |
6 | "online": true, | 6 | "online": true, |
7 | "linkWidth": 2, | 7 | "linkWidth": 2, |
8 | "src": "of:0000ffffffff0008", | 8 | "src": "of:0000ffffffff0008", |
9 | - "srcPort": "4", | 9 | + "srcPort": "5", |
10 | "dst": "of:0000ffffffffff08", | 10 | "dst": "of:0000ffffffffff08", |
11 | - "dstPort": "1", | 11 | + "dstPort": "11", |
12 | "props" : { | 12 | "props" : { |
13 | "BW": "90 Gb" | 13 | "BW": "90 Gb" |
14 | } | 14 | } | ... | ... |
1 | { | 1 | { |
2 | "event": "addLink", | 2 | "event": "addLink", |
3 | "payload": { | 3 | "payload": { |
4 | - "id": "of:0000ffffffff0003/4-of:0000ffffffffff03/1", | 4 | + "id": "of:0000ffffffff0003/6-of:0000ffffffffff03/8", |
5 | "type": "direct", | 5 | "type": "direct", |
6 | "online": true, | 6 | "online": true, |
7 | "linkWidth": 2, | 7 | "linkWidth": 2, |
8 | "src": "of:0000ffffffff0003", | 8 | "src": "of:0000ffffffff0003", |
9 | - "srcPort": "4", | 9 | + "srcPort": "6", |
10 | "dst": "of:0000ffffffffff03", | 10 | "dst": "of:0000ffffffffff03", |
11 | - "dstPort": "1", | 11 | + "dstPort": "8", |
12 | "props" : { | 12 | "props" : { |
13 | "BW": "90 Gb" | 13 | "BW": "90 Gb" |
14 | } | 14 | } | ... | ... |
1 | { | 1 | { |
2 | "event": "addLink", | 2 | "event": "addLink", |
3 | "payload": { | 3 | "payload": { |
4 | - "id": "of:0000ffffffffff08/4-of:0000ffffffffff03/1", | 4 | + "id": "of:0000ffffffffff08/13-of:0000ffffffffff03/17", |
5 | "type": "optical", | 5 | "type": "optical", |
6 | "online": true, | 6 | "online": true, |
7 | "linkWidth": 2, | 7 | "linkWidth": 2, |
8 | "src": "of:0000ffffffffff08", | 8 | "src": "of:0000ffffffffff08", |
9 | - "srcPort": "4", | 9 | + "srcPort": "13", |
10 | "dst": "of:0000ffffffffff03", | 10 | "dst": "of:0000ffffffffff03", |
11 | - "dstPort": "1", | 11 | + "dstPort": "17", |
12 | "props" : { | 12 | "props" : { |
13 | "BW": "90 Gb" | 13 | "BW": "90 Gb" |
14 | } | 14 | } | ... | ... |
... | @@ -2,11 +2,11 @@ | ... | @@ -2,11 +2,11 @@ |
2 | "event": "addHost", | 2 | "event": "addHost", |
3 | "payload": { | 3 | "payload": { |
4 | "id": "0E:2A:69:30:13:88/-1", | 4 | "id": "0E:2A:69:30:13:88/-1", |
5 | - "ingress": "0E:2A:69:30:13:88/-1/0-of:0000ffffffff0007/101", | 5 | + "ingress": "0E:2A:69:30:13:88/-1/0-of:0000ffffffff0007/102", |
6 | - "egress": "of:0000ffffffff0007/101-0E:2A:69:30:13:86/-1/0", | 6 | + "egress": "of:0000ffffffff0007/102-0E:2A:69:30:13:86/-1/0", |
7 | "cp": { | 7 | "cp": { |
8 | "device": "of:0000ffffffff0007", | 8 | "device": "of:0000ffffffff0007", |
9 | - "port": 101 | 9 | + "port": 102 |
10 | }, | 10 | }, |
11 | "labels": [ | 11 | "labels": [ |
12 | "4.5.7.6", | 12 | "4.5.7.6", | ... | ... |
... | @@ -2,11 +2,11 @@ | ... | @@ -2,11 +2,11 @@ |
2 | "event": "addHost", | 2 | "event": "addHost", |
3 | "payload": { | 3 | "payload": { |
4 | "id": "0E:2A:69:30:13:aa/-1", | 4 | "id": "0E:2A:69:30:13:aa/-1", |
5 | - "ingress": "0E:2A:69:30:13:aa/-1/0-of:0000ffffffff0008/101", | 5 | + "ingress": "0E:2A:69:30:13:aa/-1/0-of:0000ffffffff0008/103", |
6 | - "egress": "of:0000ffffffff0008/101-0E:2A:69:30:13:aa/-1/0", | 6 | + "egress": "of:0000ffffffff0008/103-0E:2A:69:30:13:aa/-1/0", |
7 | "cp": { | 7 | "cp": { |
8 | "device": "of:0000ffffffff0008", | 8 | "device": "of:0000ffffffff0008", |
9 | - "port": 101 | 9 | + "port": 103 |
10 | }, | 10 | }, |
11 | "labels": [ | 11 | "labels": [ |
12 | "12.13.14.15", | 12 | "12.13.14.15", | ... | ... |
1 | { | 1 | { |
2 | "event": "addLink", | 2 | "event": "addLink", |
3 | "payload": { | 3 | "payload": { |
4 | - "id": "of:0000ffffffffff08/4-of:0000ffffffffff04/1", | 4 | + "id": "of:0000ffffffffff08/99-of:0000ffffffffff04/65535", |
5 | "type": "optical", | 5 | "type": "optical", |
6 | "online": true, | 6 | "online": true, |
7 | "linkWidth": 2, | 7 | "linkWidth": 2, |
8 | "src": "of:0000ffffffffff08", | 8 | "src": "of:0000ffffffffff08", |
9 | - "srcPort": "4", | 9 | + "srcPort": "99", |
10 | "dst": "of:0000ffffffffff04", | 10 | "dst": "of:0000ffffffffff04", |
11 | - "dstPort": "1", | 11 | + "dstPort": "65535", |
12 | "props" : { | 12 | "props" : { |
13 | "BW": "90 Gb" | 13 | "BW": "90 Gb" |
14 | } | 14 | } | ... | ... |
1 | { | 1 | { |
2 | "event": "addLink", | 2 | "event": "addLink", |
3 | "payload": { | 3 | "payload": { |
4 | - "id": "of:0000ffffffff0008/2-of:0000ffffffff0003/1", | 4 | + "id": "of:0000ffffffff0008/21-of:0000ffffffff0003/1", |
5 | "type": "direct", | 5 | "type": "direct", |
6 | "online": true, | 6 | "online": true, |
7 | "linkWidth": 2, | 7 | "linkWidth": 2, |
8 | "src": "of:0000ffffffff0008", | 8 | "src": "of:0000ffffffff0008", |
9 | - "srcPort": "2", | 9 | + "srcPort": "21", |
10 | "dst": "of:0000ffffffff0003", | 10 | "dst": "of:0000ffffffff0003", |
11 | "dstPort": "1", | 11 | "dstPort": "1", |
12 | "props" : { | 12 | "props" : { | ... | ... |
1 | { | 1 | { |
2 | "event": "addLink", | 2 | "event": "addLink", |
3 | "payload": { | 3 | "payload": { |
4 | - "id": "of:0000ffffffff0008/4-of:0000ffffffff0007/1", | 4 | + "id": "of:0000ffffffff0008/4-of:0000ffffffff0007/3", |
5 | "type": "direct", | 5 | "type": "direct", |
6 | "online": true, | 6 | "online": true, |
7 | "linkWidth": 2, | 7 | "linkWidth": 2, |
8 | "src": "of:0000ffffffff0008", | 8 | "src": "of:0000ffffffff0008", |
9 | "srcPort": "4", | 9 | "srcPort": "4", |
10 | "dst": "of:0000ffffffff0007", | 10 | "dst": "of:0000ffffffff0007", |
11 | - "dstPort": "1", | 11 | + "dstPort": "3", |
12 | "props" : { | 12 | "props" : { |
13 | "BW": "90 Gb" | 13 | "BW": "90 Gb" |
14 | } | 14 | } | ... | ... |
-
Please register or login to post a comment