alshabib

fixing uplink ports

Change-Id: Iab6116d10b603000878604c182b0e1a21c390a56
...@@ -71,6 +71,7 @@ public class OLT { ...@@ -71,6 +71,7 @@ public class OLT {
71 public static final int OFFSET = 200; 71 public static final int OFFSET = 200;
72 72
73 public static final int UPLINK_PORT = 129; 73 public static final int UPLINK_PORT = 129;
74 + public static final int GFAST_UPLINK_PORT = 100;
74 75
75 public static final String OLT_DEVICE = "of:90e2ba82f97791e9"; 76 public static final String OLT_DEVICE = "of:90e2ba82f97791e9";
76 public static final String GFAST_DEVICE = "of:0011223344551357"; 77 public static final String GFAST_DEVICE = "of:0011223344551357";
...@@ -79,6 +80,10 @@ public class OLT { ...@@ -79,6 +80,10 @@ public class OLT {
79 label = "The OLT's uplink port number") 80 label = "The OLT's uplink port number")
80 private int uplinkPort = UPLINK_PORT; 81 private int uplinkPort = UPLINK_PORT;
81 82
83 + @Property(name = "gfastUplink", intValue = GFAST_UPLINK_PORT,
84 + label = "The OLT's uplink port number")
85 + private int gfastUplink = GFAST_UPLINK_PORT;
86 +
82 //TODO: replace this with an annotation lookup 87 //TODO: replace this with an annotation lookup
83 @Property(name = "oltDevice", value = OLT_DEVICE, 88 @Property(name = "oltDevice", value = OLT_DEVICE,
84 label = "The OLT device id") 89 label = "The OLT device id")
...@@ -98,8 +103,8 @@ public class OLT { ...@@ -98,8 +103,8 @@ public class OLT {
98 if (!port.number().isLogical() && port.isEnabled()) { 103 if (!port.number().isLogical() && port.isEnabled()) {
99 short vlanId = fetchVlanId(port.number()); 104 short vlanId = fetchVlanId(port.number());
100 if (vlanId > 0) { 105 if (vlanId > 0) {
101 - provisionVlanOnPort(oltDevice, port.number(), (short) 7); 106 + provisionVlanOnPort(oltDevice, uplinkPort, port.number(), (short) 7);
102 - provisionVlanOnPort(oltDevice, port.number(), vlanId); 107 + provisionVlanOnPort(oltDevice, uplinkPort, port.number(), vlanId);
103 } 108 }
104 } 109 }
105 } 110 }
...@@ -111,7 +116,7 @@ public class OLT { ...@@ -111,7 +116,7 @@ public class OLT {
111 if (!port.number().isLogical() && port.isEnabled()) { 116 if (!port.number().isLogical() && port.isEnabled()) {
112 short vlanId = (short) (fetchVlanId(port.number()) + OFFSET); 117 short vlanId = (short) (fetchVlanId(port.number()) + OFFSET);
113 if (vlanId > 0) { 118 if (vlanId > 0) {
114 - provisionVlanOnPort(gfastDevice, port.number(), vlanId); 119 + provisionVlanOnPort(gfastDevice, gfastUplink, port.number(), vlanId);
115 } 120 }
116 } 121 }
117 } 122 }
...@@ -148,7 +153,7 @@ public class OLT { ...@@ -148,7 +153,7 @@ public class OLT {
148 } 153 }
149 154
150 155
151 - private void provisionVlanOnPort(String deviceId, PortNumber p, short vlanId) { 156 + private void provisionVlanOnPort(String deviceId, int uplinkPort, PortNumber p, short vlanId) {
152 DeviceId did = DeviceId.deviceId(deviceId); 157 DeviceId did = DeviceId.deviceId(deviceId);
153 158
154 TrafficSelector upstream = DefaultTrafficSelector.builder() 159 TrafficSelector upstream = DefaultTrafficSelector.builder()
...@@ -202,7 +207,7 @@ public class OLT { ...@@ -202,7 +207,7 @@ public class OLT {
202 case PORT_UPDATED: 207 case PORT_UPDATED:
203 if (devId.equals(event.subject().id()) && event.port().isEnabled()) { 208 if (devId.equals(event.subject().id()) && event.port().isEnabled()) {
204 short vlanId = fetchVlanId(event.port().number()); 209 short vlanId = fetchVlanId(event.port().number());
205 - provisionVlanOnPort(gfastDevice, event.port().number(), vlanId); 210 + provisionVlanOnPort(gfastDevice, uplinkPort, event.port().number(), vlanId);
206 } 211 }
207 break; 212 break;
208 case DEVICE_ADDED: 213 case DEVICE_ADDED:
......