Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
alshabib
2015-06-05 15:32:15 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b37fd08e36d6d793e280ca36f2004eb334c3a397
b37fd08e
1 parent
ca62750a
fixing uplink ports
Change-Id: Iab6116d10b603000878604c182b0e1a21c390a56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
apps/olt/src/main/java/org/onosproject/olt/OLT.java
apps/olt/src/main/java/org/onosproject/olt/OLT.java
View file @
b37fd08
...
...
@@ -71,6 +71,7 @@ public class OLT {
public
static
final
int
OFFSET
=
200
;
public
static
final
int
UPLINK_PORT
=
129
;
public
static
final
int
GFAST_UPLINK_PORT
=
100
;
public
static
final
String
OLT_DEVICE
=
"of:90e2ba82f97791e9"
;
public
static
final
String
GFAST_DEVICE
=
"of:0011223344551357"
;
...
...
@@ -79,6 +80,10 @@ public class OLT {
label
=
"The OLT's uplink port number"
)
private
int
uplinkPort
=
UPLINK_PORT
;
@Property
(
name
=
"gfastUplink"
,
intValue
=
GFAST_UPLINK_PORT
,
label
=
"The OLT's uplink port number"
)
private
int
gfastUplink
=
GFAST_UPLINK_PORT
;
//TODO: replace this with an annotation lookup
@Property
(
name
=
"oltDevice"
,
value
=
OLT_DEVICE
,
label
=
"The OLT device id"
)
...
...
@@ -98,8 +103,8 @@ public class OLT {
if
(!
port
.
number
().
isLogical
()
&&
port
.
isEnabled
())
{
short
vlanId
=
fetchVlanId
(
port
.
number
());
if
(
vlanId
>
0
)
{
provisionVlanOnPort
(
oltDevice
,
port
.
number
(),
(
short
)
7
);
provisionVlanOnPort
(
oltDevice
,
port
.
number
(),
vlanId
);
provisionVlanOnPort
(
oltDevice
,
uplinkPort
,
port
.
number
(),
(
short
)
7
);
provisionVlanOnPort
(
oltDevice
,
uplinkPort
,
port
.
number
(),
vlanId
);
}
}
}
...
...
@@ -111,7 +116,7 @@ public class OLT {
if
(!
port
.
number
().
isLogical
()
&&
port
.
isEnabled
())
{
short
vlanId
=
(
short
)
(
fetchVlanId
(
port
.
number
())
+
OFFSET
);
if
(
vlanId
>
0
)
{
provisionVlanOnPort
(
gfastDevice
,
port
.
number
(),
vlanId
);
provisionVlanOnPort
(
gfastDevice
,
gfastUplink
,
port
.
number
(),
vlanId
);
}
}
}
...
...
@@ -148,7 +153,7 @@ public class OLT {
}
private
void
provisionVlanOnPort
(
String
deviceId
,
PortNumber
p
,
short
vlanId
)
{
private
void
provisionVlanOnPort
(
String
deviceId
,
int
uplinkPort
,
PortNumber
p
,
short
vlanId
)
{
DeviceId
did
=
DeviceId
.
deviceId
(
deviceId
);
TrafficSelector
upstream
=
DefaultTrafficSelector
.
builder
()
...
...
@@ -202,7 +207,7 @@ public class OLT {
case
PORT_UPDATED:
if
(
devId
.
equals
(
event
.
subject
().
id
())
&&
event
.
port
().
isEnabled
())
{
short
vlanId
=
fetchVlanId
(
event
.
port
().
number
());
provisionVlanOnPort
(
gfastDevice
,
event
.
port
().
number
(),
vlanId
);
provisionVlanOnPort
(
gfastDevice
,
uplinkPort
,
event
.
port
().
number
(),
vlanId
);
}
break
;
case
DEVICE_ADDED:
...
...
Please
register
or
login
to post a comment