Simon Hunt

GUI -- TopoView - capture source and target port numbers on link models.

- "traffic" scenario: made all port numbers unique.

Change-Id: I98f0153e2523d0ad451f92ee1e63e9c12f8428d7
......@@ -109,7 +109,7 @@
if (p.x > line.x1 && p.x > line.x2) return false;
if (p.y < line.y1 && p.y < line.y2) return false;
if (p.y > line.y1 && p.y > line.y2) return false;
// line bisects, but are we close enough?
// line intersects, but are we close enough?
return mdist(p, m) <= proximity;
}
......@@ -190,12 +190,11 @@
function unenhance(d) {
d.el.classed('enhanced', false);
$log.debug('UN-enhancing link: ', d.key);
}
function enhance(d) {
d.el.classed('enhanced', true);
$log.debug('enhancing link: ', d.key);
$log.debug('[' + (d.srcPort || 'H') + '] ---> [' + d.tgtPort + ']', d.key);
}
......
......@@ -158,6 +158,8 @@
angular.extend(lnk, {
key: id,
class: 'link',
// NOTE: srcPort left undefined (host end of the link)
tgtPort: host.cp.port,
type: function () { return 'hostLink'; },
online: function () {
......@@ -180,6 +182,8 @@
key: link.id,
class: 'link',
fromSource: link,
srcPort: link.srcPort,
tgtPort: link.dstPort,
// functions to aggregate dual link state
type: function () {
......@@ -218,7 +222,7 @@
}
return {
source: srcNode,
target: dstNode,
target: dstNode
};
}
......
{
"event": "addLink",
"payload": {
"id": "of:0000ffffffff0008/4-of:0000ffffffffff08/1",
"id": "of:0000ffffffff0008/5-of:0000ffffffffff08/11",
"type": "direct",
"online": true,
"linkWidth": 2,
"src": "of:0000ffffffff0008",
"srcPort": "4",
"srcPort": "5",
"dst": "of:0000ffffffffff08",
"dstPort": "1",
"dstPort": "11",
"props" : {
"BW": "90 Gb"
}
......
{
"event": "addLink",
"payload": {
"id": "of:0000ffffffff0003/4-of:0000ffffffffff03/1",
"id": "of:0000ffffffff0003/6-of:0000ffffffffff03/8",
"type": "direct",
"online": true,
"linkWidth": 2,
"src": "of:0000ffffffff0003",
"srcPort": "4",
"srcPort": "6",
"dst": "of:0000ffffffffff03",
"dstPort": "1",
"dstPort": "8",
"props" : {
"BW": "90 Gb"
}
......
{
"event": "addLink",
"payload": {
"id": "of:0000ffffffffff08/4-of:0000ffffffffff03/1",
"id": "of:0000ffffffffff08/13-of:0000ffffffffff03/17",
"type": "optical",
"online": true,
"linkWidth": 2,
"src": "of:0000ffffffffff08",
"srcPort": "4",
"srcPort": "13",
"dst": "of:0000ffffffffff03",
"dstPort": "1",
"dstPort": "17",
"props" : {
"BW": "90 Gb"
}
......
......@@ -2,11 +2,11 @@
"event": "addHost",
"payload": {
"id": "0E:2A:69:30:13:88/-1",
"ingress": "0E:2A:69:30:13:88/-1/0-of:0000ffffffff0007/101",
"egress": "of:0000ffffffff0007/101-0E:2A:69:30:13:86/-1/0",
"ingress": "0E:2A:69:30:13:88/-1/0-of:0000ffffffff0007/102",
"egress": "of:0000ffffffff0007/102-0E:2A:69:30:13:86/-1/0",
"cp": {
"device": "of:0000ffffffff0007",
"port": 101
"port": 102
},
"labels": [
"4.5.7.6",
......
......@@ -2,11 +2,11 @@
"event": "addHost",
"payload": {
"id": "0E:2A:69:30:13:aa/-1",
"ingress": "0E:2A:69:30:13:aa/-1/0-of:0000ffffffff0008/101",
"egress": "of:0000ffffffff0008/101-0E:2A:69:30:13:aa/-1/0",
"ingress": "0E:2A:69:30:13:aa/-1/0-of:0000ffffffff0008/103",
"egress": "of:0000ffffffff0008/103-0E:2A:69:30:13:aa/-1/0",
"cp": {
"device": "of:0000ffffffff0008",
"port": 101
"port": 103
},
"labels": [
"12.13.14.15",
......
{
"event": "addLink",
"payload": {
"id": "of:0000ffffffffff08/4-of:0000ffffffffff04/1",
"id": "of:0000ffffffffff08/99-of:0000ffffffffff04/65535",
"type": "optical",
"online": true,
"linkWidth": 2,
"src": "of:0000ffffffffff08",
"srcPort": "4",
"srcPort": "99",
"dst": "of:0000ffffffffff04",
"dstPort": "1",
"dstPort": "65535",
"props" : {
"BW": "90 Gb"
}
......
{
"event": "addLink",
"payload": {
"id": "of:0000ffffffff0008/2-of:0000ffffffff0003/1",
"id": "of:0000ffffffff0008/21-of:0000ffffffff0003/1",
"type": "direct",
"online": true,
"linkWidth": 2,
"src": "of:0000ffffffff0008",
"srcPort": "2",
"srcPort": "21",
"dst": "of:0000ffffffff0003",
"dstPort": "1",
"props" : {
......
{
"event": "addLink",
"payload": {
"id": "of:0000ffffffff0008/4-of:0000ffffffff0007/1",
"id": "of:0000ffffffff0008/4-of:0000ffffffff0007/3",
"type": "direct",
"online": true,
"linkWidth": 2,
"src": "of:0000ffffffff0008",
"srcPort": "4",
"dst": "of:0000ffffffff0007",
"dstPort": "1",
"dstPort": "3",
"props" : {
"BW": "90 Gb"
}
......