blob: 3d3b3026c7a166284d0c4456123c7ee22a759ae0 [file] [log] [blame]
Paul Greyson7a300822013-04-09 12:57:49 -07001/***************************************************************************************************
2find the links that include the switch with this dpid
3***************************************************************************************************/
4function debug_findlink(model, dpid) {
5 var links = [];
6 model.links.forEach(function (link) {
7 if (link['src-switch'] == dpid || link['dst-switch'] == dpid) {
8 links.push(link);
9 }
10 });
11 return links;
Paul Greyson14919c42013-04-10 17:50:36 -070012}
13
14function debug_findswitch(model, dpid) {
15 var sw;
16
17 model.edgeSwitches.forEach(function (s) {
18 if (s.dpid == dpid)
19 sw = s;
20 });
21 model.aggregationSwitches.forEach(function (s) {
22 if (s.dpid == dpid)
23 sw = s;
24 });
25 model.coreSwitches.forEach(function (s) {
26 if (s.dpid == dpid)
27 sw = s;
28 });
29
30 return sw;
Paul Greyson7a300822013-04-09 12:57:49 -070031}